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
Failed to pick up create event under heavy load #148
Comments
I've personally not test with 10k+ files. We should try to establish if the underlying inotify code handles that many files properly (for a given kernel). Assuming it does, then we will at least know it's an issue in fsnotify. |
This is normal because there is an upper limit for queued iNotify events. See From the manual :
and also
So, considering your particular use case, I suggest you increase the value of |
I am having a similar problem but with a lower number of files. I read the My code checks for directory creations and use the |
Still facing this same problem. @sethgrid did you get it working? I increased the number to 10 times more (1 million) and it still does not work. |
I set up a watcher on
And then I ran the following code to create, write to, and remove 100,000 files:
I ran it a few times, and looking at the output everything seems to work, and the number of reported events match the number of expected events. This is on my Linux system with the default settings:
Maybe I'm doing something different? To move ahead on this, we need a way to reproduce the problem. I also ran it in
|
I added a test which creates and removes 1.5 million files; this consistently seems to work well on my laptop and in the CI (where it has run many times now, as I was trying to get the kqueue tests fixed). So yeah, I don't know. Really need a specific example to reproduce, or someone who can reproduce it on their system where we can investigate what the cause it. I'll close this for the time being as it's not clear this is a fsnotify problem and it's not clear if it still exists in the current version (#434 changed quite a bit of inotify backend internals); can always reopen later. |
I'm using fsnotify with go 1.6 on CentOS release 6.7 (Final). The app uses fsnotify to watch a directory and when files are created it does some stuff and deletes the file. Thousands of files can be dropped in the directory very quickly. Normally, the directory will only have up to a few hundred items in it at a time, but we have seen it go over 30k. Normally, everything is fine and the script clears out all the directory contents.
We are seeing in some spiky situations (10k+ files put into the watched directory) and fsnotify is seemingly failing to pick some up newly created files. In the 10k+ case, it failed to pick up around 600 files. Any thoughts, ideas, or suggestions?
The text was updated successfully, but these errors were encountered: