You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Linder <pe...@fiberdirekt.se> on 2012/12/20 11:15:36 UTC

[users@httpd] Starting httpd somehow disables NFS caching

Hello everybody!

I have an issue that I've been trying to figure out for a while now. 
I'll start from the beginning;

First, I have an NFS share with around 2 million files in various 
directories (users home directories). This is mounted on a separate 
server that will serve web pages. If I choose a user and run "time find 
-print0 | xargs -0 stat >/dev/null" in their home directory on that 
server, it takes 14 seconds. The second time it takes 1 second, because 
the result is mostly cached. This is what I would expect.

Now, if reboot the server and start httpd first (loading around 6000 
vhosts scattered around on the nfs share), and then run the same test, 
it always takes 14 seconds, that is the cache is not used (even though 
dentry and nfs_inode_cache objects are created). Even hours later, the 
situation remains the same. Even if apache is stopped, the situation is 
the same. issuing "echo 2 >/proc/sys/vm/drop_caches" (sometimes more 
than once) seems to "fix" the problem, even if apache remains running. 
If I run the test before I start apache, the data is still cached for 
that users homedir but not for any other users. Issuing a reload on 
apache makes the problem come back, until caches are dropped again.

I've been studying /proc/slabinfo, messed around with nfs mount options 
(which got me down to 14 seconds by specifying nocto and actimeo=300, 
but no faster), tried different kernel versions, set EnableMMAP Off, 
reduced the number of vhosts a bit etc, but I'm none the wiser.

I'm fairly sure this is a bug, or at least something that is not tuned 
properly, but I'm not sure where (nfs client or other kernel 
component?). I have only found this problem with apache, so I'm starting 
here in the hope that someone has seen the same thing before. I'll be 
happy to provide any information or run tests to help clarify things.

Merry Christmas everybody!

/Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org