How Can We Help?
< All Topics

What is inotify watch and how will it affects server performance

What is Inotify

To start with let us discuss what is inotify :- Inotify (inode notify) is a Linux kernel subsystem that acts to extend filesystems to notice changes to the filesystem, and reports those changes to applications through the APIs provided. This particular subsystem support was added to Glibc version in 2006; to use inotify, you must have a Linux machine with kernel 2.6.13 or later.

What is Inotify Watch

Inotify Watch helps to keep track of the file changes under the directories on “watch” and report back to the application in a standard format using the API calls. We can monitor multiple file events under the watched directory using the API calls. There is a default limit for the number of watches that can be enabled on the system and this limit should be increased for cPGuard to function. if you hit inotify watch limit, it may interrupt the system performance and you may see the “upper limit on inotify watches reached” message from the system log.

Does increasing the watch limit affect system performance?

Obviously, it does not make any direct harm to the system. For a 64-bit system, 1 kB memory will be allocated for each watch on board. So with sufficient memory, increasing the watch will be just fine and we have crafted our application to utilize the memory as efficiently as possible.

So what is happening with Virtuozzo/OpenVZ?

The Virtuozzo/OpenVZ implementation does not allow to change of kernel parameters within the container and may require max_user_watches to be increased by the hosting provider. Some providers may not be willing to do this, though it is completely safe. So before purchasing/installing cPGuard, please make sure that your hosting provider can increase the value for you [ we recommend setting it up to a value of 1000000 for servers hosting multiple accounts, though the limit will be based on the directory structure ] and if they use a custom kernel, the kernel will support “inotify”.

Was this article helpful?
2.5 out of 5 stars

1 rating

5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 100%
1 Stars 0%
How can we improve this article?
Please submit the reason for your vote so that we can improve the article.
Table of Contents