Skip to content

add a option --watch-buffer-size to dynamic change fs event buffer size #58506

Open
@coderall2

Description

@coderall2

What is the problem this feature will solve?

we did a test using fs.watch with a backgroud thread which write or modify files in watched-dir. The write or modify QPS is closed to 10K/s. We observed some fs event loss.We refered to fsnotify with Go, modify the source code of node to adjust the buffer size to 65536, the event loss is gone.

What is the feature you are proposing to solve the problem?

Windows ReadDirectoryChangeW and Linux inotify both need a buffer to read fs event. Now, the buffer size is const (4096 bytes) and can't be larger to process fs burst request well. So, could we add an option (the name may be --watch-buffer-size ) to tell node the suitable buffer size?

Image Image

What alternatives have you considered?

Get the node's source code, modify the buffer size manually and rebuild a new binary, but it's better to add a command-line option to solve this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliIssues and PRs related to the Node.js command line interface.feature requestIssues that request new features to be added to Node.js.watch-modeIssues and PRs related to watch mode

    Type

    No type

    Projects

    Status

    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions