Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How about many files? #13

Open
Cyber1000 opened this issue Apr 14, 2016 · 2 comments
Open

How about many files? #13

Cyber1000 opened this issue Apr 14, 2016 · 2 comments

Comments

@Cyber1000
Copy link

Not a bug, just a question how hound handles this.
If I watch a folder where a lot of files get copied to, will the processes all run at once? Let's say I copy 200 files in there which should be processed (a deeper processing of the files is done). I've concerns that this blocks CPU or IO. Is it possible to just process a defined number of files at once?

Thanks in advance!

@georgeoffley
Copy link

I know this is an old one, but I am curious about high loads as well. I am doing some testing and I am already seeing issues with files going in and out.

@Cyber1000
Copy link
Author

I haven't used this project back then and it seems that the last commit was around 2018.
But hound seems just to be a wrapper around fs.watch: https://nodejs.org/docs/latest/api/fs.html#fs_fs_watch_filename_options_listener

fs.watch seems to use inotify on linux for example and I've made good experience in respect to IO/CPU with inotify, it just eats memory (up to 1k per file which isn't that much nowadays)
It may differ on macOS or Windows (see link what is used there)

And it may also depend what's your process after detecting a change. And to answer my question: It doesn't seem to be possible to process just a defined number with hound, looking at the code ...
So in short: hound just manages watching and unwatching of files, reducing loads while processing changed files must be done on your own. For example: You may collect all changed files somewhere in an array and process them in an own process, which has some timeout-statements or runs only at specified times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants