Project

General

Profile

Server stat-cache-engineDetails » History » Revision 9

Revision 8 (stbuehler, 2012-08-11 10:42) → Revision 9/11 (gstrauss, 2020-11-04 10:07)

h2. server.stat-cache-engine option 

 stat() system call caching; lighttpd can utilize FAM/Gamin to cache stat call. 

 possible values are:    "disable", "simple", "fam", "inotify", disable, simple or "kqueue". fam. 

 * @"disable"@ disable 
   no stat() call is cached (a single request might result in 3-4 stat() calls) 
   If your files are changing in size a lot, you might have to have the stat-cache 
   disabled 
 * @"simple"@ (default; recommended) simple (default) 
   cache each stat() call for one second. 
 * @"fam"@ 
   fam    
   if FAM or gamin are installed and lighty is linked against those libraries you 
   can use them to control the freshness of the stat-cache. 
 * @"inotify"@ (since lighttpd 1.4.56) 
   On Linux, @inotify()@ is used instead of FAM or gamin (which use @inotify()@ on Linux) 
 * @"kqueue"@ (since lighttpd 1.4.56) 
   On *BSD, @kqueue()@ is used instead of FAM or gamin (which use @kqueue()@ on *BSD) 


 

 h3. Example 

 <pre> 
 server.stat-cache-engine = "simple" 
 </pre> 


 h2. Limitations 

 Caches have limitations.    There have always been limitations with lighttpd stat_cache.    lighttpd stat_cache only monitors directories.    lighttpd stat_cache is notified about additions and removals of files within a monitored directory but depending on the OS implementation of FAM or gamin (e.g. inotify or kqueue), lighttpd might not be notified of changes on files within a directory such as timestamps (touch), ownership, or even changes in contents (e.g. if a file is edited through a hard link). 
    
 @server.stat-cache-engine = "disable"@ should be used when files should not be cached.    Full stop.    Similarly, @"disable"@ is recommended if files change frequently.    If using @server.stat-cache-engine@ with any engine, there are caching effects and tradeoffs. 
    
 On *BSD and using @kqueue()@ on directories, any change reported results in clearing the stat_cache of all entries for that directory, since monitoring only the directory does not indicate which file was added or removed.    This is not efficient for directories containing frequently changed files. 


 h2. See Also 


 * [[lighttpd:Docs_Performance#stat-cache|Performance: Stat Cache]]