Skip to content
This repository has been archived by the owner on Jun 8, 2022. It is now read-only.

MacOSX: too many open files #35

Closed
nbkolchin opened this issue Mar 11, 2013 · 4 comments
Closed

MacOSX: too many open files #35

nbkolchin opened this issue Mar 11, 2013 · 4 comments
Labels

Comments

@nbkolchin
Copy link

MacOSX 10.8.2, GO1.0.3

Code: https://gist.github.com/nbkolchin/5137058

$ for i in seq 0 20000 ; do touch $i ; done

Output (MacOSX):
2013/03/12 02:08:13 event: "tmp/17928": CREATE
2013/03/12 02:08:13 removing tmp/17928
2013/03/12 02:08:13 event: "tmp/17929": CREATE
2013/03/12 02:08:13 removing tmp/17929
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files

Works fine on Linux for ~2.000.000 files.

@howeyc
Copy link
Owner

howeyc commented Mar 11, 2013

Yeah, I'm really not sure about this one. You are not the first to report
it.

It has to do with the kqueue/kevent api in the OS requiring an open file
handle for each file/directory you wish to watch. The default limit of open
file handles per process is low, around 200 or so.

You can see another similar issue and my reply here:
#32 (comment)

On 11 March 2013 17:13, nbkolchin [email protected] wrote:

MacOSX 10.8.2, GO1.0.3

Code: https://gist.github.com/nbkolchin/5137058

$ for i in seq 0 20000 ; do touch $i ; done

Output (MacOSX):
2013/03/12 02:08:13 event: "tmp/17928": CREATE
2013/03/12 02:08:13 removing tmp/17928
2013/03/12 02:08:13 event: "tmp/17929": CREATE
2013/03/12 02:08:13 removing tmp/17929
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files
2013/03/12 02:08:13 error: open tmp: too many open files

Works fine on Linux for ~2.000.000 files.


Reply to this email directly or view it on GitHubhttps://github.com//issues/35
.

@pcrawfor
Copy link

I've run into this too in my own use of fsnotify, I've been playing with a solution that would catch the case and split the work into to two or more processes.

@nbkolchin
Copy link
Author

Any chance for FSEvents backend?

@howeyc
Copy link
Owner

howeyc commented Mar 13, 2013

I haven't planned on an FSEvents backend. As far as I understand it you can't get modifications to individual files that way.

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

No branches or pull requests

3 participants