Feature #2142
closedstat_cache increase
Description
The simple stat_cache engine only caches for one second. On large static servers with sparse file changes, it could be a good idea to cache for a few more seconds - especially if you have really hard concurrency.
The attached patch uses a macro, which set the timeout to 1/4 minute. I think a config variable is not needed, but maybe a port to the build system.
Files
Updated by stbuehler about 15 years ago
- Target version changed from 1.4.26 to 1.4.27
Updated by stbuehler almost 15 years ago
- Target version changed from 1.4.27 to 1.4.x
I don't think this is really important - stat calls should only be slow if the kernel has to load it from disk or network - i'll move it to 1.4.x (no time to review it right now).
Updated by gstrauss about 9 years ago
While patch is trivial, the question remains "should this be done here?" I think the answer is no. There are better alternatives.
server.stat-cache-engine = "simple" is intended to be exactly that: simple, and so I think the 1 second stat cache is reasonable. A better alternative, where available, is server.stat-cache-engine = "fam" which will reduce the stat() calls for filesystems that seldom change.
For highly loaded websites a caching proxy such as Varnish or Squid is recommended, as is offloading to a CDN for really high volume. Any of these will be much more efficient than just extending time to cache stat values.
Updated by stbuehler about 9 years ago
- Status changed from New to Wontfix
- Target version deleted (
1.4.x)
Also given the stat-cache is cleared after 2 seconds anyway this patch is broken anyway.
Updated by gstrauss over 1 year ago
- Status changed from Wontfix to Fixed
- ASK QUESTIONS IN Forums set to No
server.stat-cache-engine = "inotify"
(or "kqueue"
) will cache for up to 32 seconds.
Also available in: Atom