Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a configuration option to tune epoll timeout in lighttpd?
I'm developing an embedded Linux (2.6) device, with lighttpd 1.4.30. And I'm observing the following issue: even when the system is idle and there are no web clients connected, the lighttpd wakes up every second (see below).

/# cat /proc/timer_stats
Timer Stats Version: v0.2
Sample period: 6.382 s
15, 137 alt-ecm hrtimer_start_range_ns (hrtimer_wakeup)
23, 5 events/0 uectl_readerwork (delayed_work_timer_fn)
10, 380 db_probe hrtimer_start_range_ns (hrtimer_wakeup)
3, 121 atswitch hrtimer_start_range_ns (posix_timer_fn)
6, 380 db_probe hrtimer_start (timerfd_tmrproc)
6, 226 lighttpd sys_epoll_wait (process_timeout)

the goal is to minimize number of wakeups from idle in the system Thanks in advance!

share|improve this question
up vote 0 down vote accepted

the one second timer is needed for:

  • the plugin api: each plugin can have a _trigger method, which is supposed to be called every second
  • stat_cache_cleanup
  • checking every connection for io timeouts

You could increase the timeout for the poll in src/server.c around line 1460:

if ((n = fdevent_poll(srv->ev, 1000)) > 0) {

The value is in milliseconds and is hardcoded to 1000 -> 1 second. But even setting this to 5 or 10 seconds won't help you much imho...

share|improve this answer
Thanks! Why do you think it won't help? – alexa May 1 '13 at 7:10
I guess, these actions not required when there is no client connected? – alexa May 1 '13 at 7:11
I said won't help "much". Because 1 wakeup a second is not that bad, considering the things you might break. I guess most plugins won't care about the trigger if there is no client connected, but I didn't try it. – Stefan May 4 '13 at 16:01
Thanks a lot! I tried the patch, looks like it works. – alexa May 5 '13 at 7:18

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.