inotify resources exhausted (btsync on linux)


stevecrozz

Recommended Posts

When I start btsync, it very quickly exausts my system's maximum number of inotify watches. I only have a single shared folder, so I would expect btsync to use just one inotify watch and not ~25,000. It's not the end of the world, but it would be nice if btsync was a little friendlier because I like using inotify for other purposes (tail -f for instance). When I try to use tail -f, it warns me saying:

tail: inotify resources exhausted

tail: inotify cannot be used, reverting to polling

Is there something I can do to tell btsync to stop hogging all the inotify watches?

Link to comment
Share on other sites

That's exactly the method I was using to find out who was using all my inotify watches. The total number of inotify watches went from a few dozen to ~25,000 after starting btsync.

That combined with the fact that I can always get an inotify watch when I'm not running btsync, and I can never get one when I am running btsync makes me pretty certain the culprit is btsync.

Link to comment
Share on other sites

Yep. I can certainly go through the regular support channel. Although I've learned a bit more about how inotify works and it seems normal that you need one inotify watch per directory even if all the directories have the same parent.

From inotify's man page:

Inotify monitoring of directories is not recursive: to monitor subdirectories under a directory, additional watches must be created.

I think btsync's own log file is telling me when it can and can't add an inotify watch with the phrases "Added path" and "Error while adding watch for ... errno=28". The numbers do seem to add up to what I expected:


/opt/btsync$ grep "Added path" < .sync/sync.log | wc -l
8032
/opt/btsync$ grep "Error while adding watch for" < .sync/sync.log | wc -l
19447

Maybe the fix is to just increase the maximum number of inotify watches allowed on my system. Although one thing I have noticed here is that btsync does seem to be adding watches for subdirectories of folders that I've explicitly ignored.

I'll go ahead and send my log files over the support channel. I may have a few other support requests to file anyway.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.