Bug #1517

one second delay after stat() / Linux epoll / lighttpd-r2025

Added by Safari about 12 years ago. Updated over 11 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Missing in 1.5.x:


Most of the time, there is one second delay between stat() is called and
some action is visible to client (e.g. 404 error written).

Attached strace files:
server.stat-cache-engine = "simple"
server.max-stat-threads = 32

no stat-cache.

Both have:
server.event-handler = "linux-sysepoll"


slow-with-stat_cache.txt (20.3 KB) slow-with-stat_cache.txt Safari, 2008-01-13 01:08
slow-no-stat_cache.txt (4.83 KB) slow-no-stat_cache.txt Safari, 2008-01-13 01:09
lighttpd-svn-fix-1s-delay.patch (2.53 KB) lighttpd-svn-fix-1s-delay.patch Safari, 2008-03-02 01:48

Related issues

Blocks Feature #1795: add gthread-freebsd-sendfile (patch)Fixed2008-10-10


Updated by Safari almost 12 years ago

If I make N (N > 1) requests in parallel, the (N - 1) first work OK, but the last one is delayed by one second. Some queue management bug? Debug prints for queues are non-existent, queue loop is pretty complex... someone want to help me with this?


Updated by Safari almost 12 years ago

Found the bug. SIGUSR1 hack is not working as hoped: epoll_wait is not always interrupted with EINTR. I nuked SIGUSR1 and replaced with reading/writing a pipe.
There may be other ways to solve this problem, too.

You are welcome.


Updated by Safari almost 12 years ago

This patch also fixes the performance problem with gthread-aio.
I get now 180 MB/s instead of < 1 MB/s.
See #1186


Updated by Anonymous over 11 years ago

new patch for rev 2169? gthread-aio is really slow


Updated by peto over 11 years ago

This issue still exists in r2294, and also makes AIO unusable in FBSD. This patch works (with a couple obvious lines added to base.h that were missing). Please apply this before the final 1.5 release; AIO is the biggest 1.5 feature and this is a critical fix.


Updated by stbuehler over 11 years ago

  • Patch available set to Yes

Updated by stbuehler over 11 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

Applied in changeset r2342.

Also available in: Atom