0

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!

HopelessN00b
  • 53,385
  • 32
  • 133
  • 208
alexa
  • 3
  • 1

1 Answers1

0

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...

Stefan
  • 819
  • 1
  • 7
  • 18
  • Thanks! Why do you think it won't help? – alexa May 01 '13 at 07:10
  • I guess, these actions not required when there is no client connected? – alexa May 01 '13 at 07: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 04 '13 at 16:01