After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 712349 - kqueue monitoring, bump limits
kqueue monitoring, bump limits
Status: RESOLVED FIXED
Product: tracker
Classification: Core
Component: General
git master
Other OpenBSD
: Normal minor
: ---
Assigned To: tracker-general
Depends on:
Blocks:
 
 
Reported: 2013-11-15 05:24 UTC by Antoine Jacoutot
Modified: 2013-11-25 12:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
setrlimit to bump nofiles (1.11 KB, patch)
2013-11-15 05:24 UTC, Antoine Jacoutot
none Details | Review

Description Antoine Jacoutot 2013-11-15 05:24:45 UTC
Created attachment 259854 [details] [review]
setrlimit to bump nofiles

Hi.

kqueue(2) is very hungry for FDs when monitoring files and directories,
so use the max NOFILES value as a base for setting up monitor limits.
This mitigate the chance to run in the infamous "Too many open files"...

I successfully tested this on OpenBSD where I was able to crawl and monitor big hierarchies of files and directories.

Would it be OK to push?
Thanks.
Comment 1 Antoine Jacoutot 2013-11-19 15:49:43 UTC
Since this change only impact BSD systems, I went ahead and pushed it: 0b3d4831a488427abbdbaef988b01f74a0870f9a
Comment 2 Martyn Russell 2013-11-25 12:16:17 UTC
Thank you Antoine, the patch looks sane. Normally I wouldn't suggest we set the limit because this is not our responsibility. Let's see how we get on with this patch.
Comment 3 Antoine Jacoutot 2013-11-25 12:49:29 UTC
(In reply to comment #2)
> Thank you Antoine, the patch looks sane. Normally I wouldn't suggest we set the
> limit because this is not our responsibility. Let's see how we get on with this
> patch.

In a regular situation, I would agree with you. But the difference here is that the max number of monitors is based on the limits and it makes more sense to base it on the max limit rather than cur.
If that triggers an issue in the future, we can easily limit the number of monitors to a specific amount.

Thanks for the review ;-)