3 ms·
fs events do not scale on linux, at least not with the inotify facility as watching directories is not recursive and watching large trees, e.g. for creations, m
by rndgermandude 5y ago
fs events do not scale on linux, at least not with the inotify facility as watching directories is not recursive and watching large trees, e.g. for creations, modifications or removals .htaccess, will essentially require you to have an additional watch descriptor per directory, and there are limits on number of queued events as well as number of watch descriptors per user. The alternate fanotify has it's own set of drawbacks, such as the need for CAP_ADMIN. Not to mention the mess you may get in when you're trying to monitor certain file systems, especially certain network-attached ones.
Other operating systems have drawbacks as well.
It's probably a safer and maybe even more efficient bet to just do the stats and opens and hope that the kernel/OS file system caches will save the day. Or you can go the nginx route and not support .htaccess like facilities (e.g. turn if off in apache).
- vlovich123 5y agoIn theory yes. In practice, how often are people who are using htaccess going to be running into these corner cases? I would bet anyone using it is likely running a very small site anyway where the convenience is worth it. You can also detect when you have too many watches needed or a network filesystem to fall back to the existing path. It’s a philosophical difference ultimately.