max inotify user watches in the kernel should be increased

Bug #115801 reported by Mads Chr. Olesen
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
beagle (Ubuntu)
Invalid
Undecided
Unassigned
procps (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: beagle

As described by Joe Shaw in http://thomas.apestaart.org/log/?p=482#comment-2699 beagle will fall-back to continously indexing a user's files, if it fails to inotfy watch all directories for changes. The described solution is increasing /proc/sys/fs/inotify/max_user_watches to some higher value. Increasing this number should not have any adverse effects, unless the watches are actually used.

On my system I increased the number to 32768, as i have almost that many sub-directories in my homedir:
find . -type d | wc -l

I increased the value by adding "fs.inotify.max_user_watches = 32768" to /etc/sysctl.conf, not sure if it can be done in some way only if beagle has been installed?

Revision history for this message
Mads Chr. Olesen (shiyee) wrote :

This is possibly also the cause for bug #77106

Revision history for this message
Joe Shaw (joeshaw) wrote :

I added procps to this as an affected package, because I think the right place to fix this is there. This can happen with any program that will set up lots of inotify watches, not just Beagle, although it's the most likely culprit at this point.

I'd suggest setting it to at least 65536. A higher number of watches will take additional kernel memory, but only if those watches are used. So for the vast majority of users who fit under the 8192 default limit, increasing the value will have no adverse effects.

Bug #77106 is not caused by this, that is another bug that was fixed in Beagle 0.2.14, I believe.

Revision history for this message
Andreas Zitzelsberger (az82) wrote :

I think max_user_watches should be set according on the system's RAM in the desktop distribution and kept at the low default for the server distribution.
Does anybody actually know how much memory an inotify watch consumes?

Revision history for this message
Joe Shaw (joeshaw) wrote :

If an inotify watch isn't used, it uses no memory. So simply increasing the limit has no overhead on the system.

It's only when they're used that they actually consume kernel memory. I don't know exactly how much is used, but I believe there's no additional overhead other than the inotify structure in the kernel.

Revision history for this message
Kees Cook (kees) wrote :

This was addressed in procps 1:3.2.7-3ubuntu6

Changed in procps:
status: New → Fix Released
Daniel T Chen (crimsun)
Changed in beagle:
status: New → Invalid
Revision history for this message
jay armstrong (jayarmstrong) wrote :

As an end user, i'm curious -- how was this addressed in procps 1:3.2.7-3ubuntu6? I'm still running into this hard limit in jaunty.

summary: - max inotify user watches in the kernel should be increased for beagle
- indexing to be optimal
+ max inotify user watches in the kernel should be increased
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.