From: hooanon05@yahoo.co.jp
To: Marcin Krol <mrkafk@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: inotify limits - thousands (tens of thousands?) of watches
Date: Wed, 20 May 2009 22:58:26 +0900 [thread overview]
Message-ID: <8255.1242827906@jrobl> (raw)
In-Reply-To: <4A13CCE1.5000106@gmail.com>
Marcin Krol:
> I'm not a kernel programmer, but I want to develop a program that would
> watch modifications in *all* user directories on a busy server using
> inotify.
:::
> 1. is it safe? that is, will it not lock the kernel up, or cause
> excessive memory consumption?
>
> 2. is it economic in terms of CPU time and RAM? I have no idea how to
> even measure such a thing happening in the kernel..
The maximum number of inotify instances per user is limited to
/proc/sys/fs/inotify/max_user_instances which is 128 by default.
And also the number of watches per user is limited by
/proc/sys/fs/inotify/max_user_watches (8192 by defaut).
Theoretically you may be able to monitor 8192 directories, but it
consumes memory.
If periodical rsync is out of question for you, how about kprobe?
While I don't think it is a beautiful solution, to set a hook to
vfs_mkdir, vfs_unlink, etc and to compare the target super_block may
work for you.
See Documentation/kprobe.txt in detail.
J. R. Okajima
prev parent reply other threads:[~2009-05-20 13:58 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-20 9:26 inotify limits - thousands (tens of thousands?) of watches Marcin Krol
2009-05-20 10:04 ` Matthias Kaehlcke
2009-05-20 10:12 ` Tvrtko Ursulin
2009-05-20 11:22 ` Martin Steigerwald
2009-05-20 12:16 ` Marcin Krol
2009-05-20 12:48 ` Martin Steigerwald
2009-05-20 12:58 ` Martin Steigerwald
2009-05-20 13:58 ` hooanon05 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8255.1242827906@jrobl \
--to=hooanon05@yahoo.co.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=mrkafk@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox