https://issues.apache.org/bugzilla/show_bug.cgi?id=57399
Bug ID: 57399
Summary: Many unnecessary CPU wakeups per second
Product: Apache httpd-2
Version: 2.4.10
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P2
Component: mpm_event
Assignee: [email protected]
Reporter: [email protected]
PowerTOP shows httpd waking up 20 times per second on a completely idle server.
This is wasteful of CPU time and power, especially on a laptop or a virtual
machine. The biggest culprit appears to be the following code in
server/mpm/event/event.c:
apr_thread_mutex_lock(g_timer_skiplist_mtx);
te = apr_skiplist_peek(timer_skiplist);
if (te) {
if (te->when > now) {
timeout_interval = te->when - now;
}
else {
timeout_interval = 1;
}
}
else {
timeout_interval = apr_time_from_msec(100);
}
apr_thread_mutex_unlock(g_timer_skiplist_mtx);
rc = apr_pollset_poll(event_pollset, timeout_interval, &num, &out_pfd);
which says if there’s no reason to wake up, wake up every 100 ms anyway.
apr_time_from_msec(100) should be replaced with -1.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]