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.

  • 1
    Not sure if this helps, but it looks like there is an enhancement request for fsnotify github.com/howeyc/fsnotify/issues/54
    – spuder
    Aug 12, 2013 at 2:43
  • Thanks for the link, but fsnotify more or less already supports "efficient" events (i.e. logging one "DELETE" for a directory instead of one each for all of its contents). My problems is that, efficient or not, I'm throwing too many events at it, and hoping to increase its storage threshold.
    – Zac B
    Aug 12, 2013 at 11:51

1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.