Project

General

Profile

Feature #2142

stat_cache increase

Added by crypt over 9 years ago. Updated over 3 years ago.

Status:
Wontfix
Priority:
Normal
Assignee:
-
Category:
core
Target version:
-
Start date:
2009-12-31
Due date:
% Done:

90%

Estimated time:
Missing in 1.5.x:
Yes

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.

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

Related issues

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

Actions

History

#1

Updated by stbuehler over 9 years ago

  • Target version changed from 1.4.26 to 1.4.27
#2

Updated by stbuehler over 9 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).

#3

Updated by gstrauss over 3 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.

#4

Updated by stbuehler over 3 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.

Also available in: Atom