5

Note: This might be a StackOverflow question, since it's about something that's only accessible via the internal API on OSX, but I'm posting it here since it seems to be more about using a tool that's already available than about programming for it.

Question: I've been using lsyncd (with the fsnotify backend, not inotify) to watch filesystem events on OSX. I've been getting a lot of OVERFLOW events, since I'm handing it a rather large number of high-volatility files.

How do I configure the maximum internal queue size for fsnotify on OSX 10.8 Mountain Lion (or any other version, really)? On inotify/Linux, I'd use /proc/sys/fs/inotify/max_user_watches, but I'm stumped on how to configure this using fsnotify, and on OSX.

If I really must, I can recompile the kernel with some baked-in arcana to configure the number higher, but I'd prefer to avoid that if possible.

Zac B
  • 2,903
  • 4
  • 27
  • 39

1 Answers1

9

For anybody still wanting to do this, I ran this in Terminal in latest Mojave:

sudo sysctl -w kern.maxfiles=524288

This change was related to Webpack not catching changes. My original limit was something like 49000-ish. Upping the setting got the watcher to trigger again on file changes.