Project

General

Profile

Actions

Feature #2142

closed

stat_cache increase

Added by crypt over 14 years ago. Updated 4 months ago.

Status:
Fixed
Priority:
Normal
Category:
core
Target version:
-
ASK QUESTIONS IN Forums:
No

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

stat_cache.patch (631 Bytes) stat_cache.patch crypt, 2009-12-31 15:12

Related issues 1 (0 open1 closed)

Related to Feature #2126: lighttpd patchesDuplicate2009-12-28Actions
Actions #1

Updated by stbuehler about 14 years ago

  • Target version changed from 1.4.26 to 1.4.27
Actions #2

Updated by stbuehler almost 14 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).

Actions #3

Updated by gstrauss about 8 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.

Actions #4

Updated by stbuehler about 8 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.

Actions #5

Updated by gstrauss 4 months 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.

Actions

Also available in: Atom