https://bz.apache.org/bugzilla/show_bug.cgi?id=69496
Bug ID: 69496
Summary: The httpd process hangs with idle=1, accepting=no.
Product: Apache httpd-2
Version: 2.4.62
Hardware: PC
OS: Linux
Status: NEW
Severity: critical
Priority: P2
Component: mpm_event
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: ---
Hi All,
Continuous access causes the httpd process to hang with idle=1, accepting=no,
and the number of processes continues to grow. This occurs when ThreadsPerChild
is set to 1, even with just one access per second to the following URL. The
processes does not decrease even after the access is stopped.
http://hostname/server-status?refresh=1
[server-status]
| | | Connections | Threads | Async
connections |
Slot | PID | Stopping
|-------------------+-----------------+-----------------------------+---------
| | | total | accepting | busy | graceful | idle | writing |
keep-alive | closing
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
0 |8997 | no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
1 |8998 | no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
2 |8999 | no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
3 |9895 | no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
4 |9949 | no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
5 |10068| no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
6 |10178| no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
7 |11879| no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
8 |12915| no | 0 | no | 0 | 0 | 1 | 0 |
0 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
9 |12970| no | 1 | yes | 1 | 0 | 0 | 0 |
1 | 0
-----+-----+----------+-------+-----------+------+----------+------+---------+------------+---------
Sum |10 | 0 | 1 | | 1 | 0 | 9 | 0 |
1 | 0
[httpd-mpm.conf]
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 1
MaxSpareThreads 3
ThreadsPerChild 1
MaxRequestWorkers 10
MaxConnectionsPerChild 0
</IfModule>
[event.c: listener_thread()]
get_worker(&have_idle_worker, 1, &workers_were_busy);
#Because ThreadsPerChild is 1, the idle count is 0 in get_worker().
rc = lr->accept_func(&csd, lr, ptrans);
#accept_func() may return EAGAIN, and subsequent push2worker() will not be
executed and will not transfer control to the worker thread.
/* later we trash rv and rely on csd to indicate
* success/failure
*/
AP_DEBUG_ASSERT(rc == APR_SUCCESS || !csd);
if (rc == APR_EGENERAL) {
/* E[NM]FILE, ENOMEM, etc */
resource_shortage = 1;
signal_threads(ST_GRACEFUL);
}
if (csd != NULL) {
conns_this_child--;
if (push2worker(NULL, csd, ptrans) == APR_SUCCESS) {
have_idle_worker = 0;
}
}
else {
ap_queue_info_push_pool(worker_queue_info, ptrans);
}
---omit---
else if (connections_above_limit(&workers_were_busy)) {
disable_listensocks();
#Because there are 0 idles, disable_listensocks() is executed and accepting=no.
#The httpd process hangs because control has not been transferred to the worker
thread.
#If you modify the above process as follows, it will no longer occur.
else if (!((threads_per_child == 1) &&
(ap_queue_info_num_idlers(worker_queue_info) == 0)
&&
have_idle_worker ) &&
connections_above_limit(&workers_were_busy)) {
disable_listensocks();
Thanks
--
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]