mpm_worker has a limit of 64 ThreadsPerChild even if you configure it with a larger number

Bug #1628278 reported by Jay R. Wren on 2016-09-27
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
Undecided
Unassigned

Bug Description

$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jul 15 2016 15:34:04
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.4 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.4 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

Configure apache like so:

<IfModule mpm_worker_module>
 StartServers 10
 MinSpareThreads 25
 MaxSpareThreads 750
 ThreadLimit 1000
 ThreadsPerChild 750
# MaxRequestWorkers aka MaxClients => ServerLimit *ThreadsPerChild
 MaxRequestWorkers 15000
 MaxConnectionsPerChild 0
 ServerLimit 20
 ThreadStackSize 524288
</IfModule>

Use a tool such as slowhttptest to keep lots of connections open:

$ slowhttptest -c 20000 -H -g -o my_header_stats-20k -i 10 -r 2000 -t GET -u http://localhost/ -x 24 -p 3

Notice how the httpd processes only have 66 threads each:

$ ps -uwww-data -opid,ppid,nlwp | wc -l
  PID PPID NLWP
  357 30954 9
  561 30954 4
  706 30954 22
 1057 30954 66
 1125 30954 66
 1126 30954 66
 1259 30954 66
 1326 30954 66
 1327 30954 66
 1461 30954 66
 1528 30954 66
 1529 30954 66
 1662 30954 66
 1729 30954 66

Now change to mpm_event with the same settings and do the test again:

$ ps -uwww-data -opid,ppid,nlwp
  PID PPID NLWP
 3100 3097 752
 3102 3097 752
 3229 3097 752
 3448 3097 752
10650 3097 752

Expected behavior: worker should behave much like event as documented: http://httpd.apache.org/docs/current/mod/event.html http://httpd.apache.org/docs/current/mod/worker.html

ChristianEhrhardt (paelzer) wrote :

Note: Need to check upstream and Debian for their status.

If you might already have identified an upstream fix or discussion around this please update the bug with it.

Changed in apache2 (Ubuntu):
status: New → Confirmed
Robie Basak (racb) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. I'm sure it'll be helpful to others experiencing the same issue.

This sounds like an upstream bug to me. Please can you verify this by building directly from the latest upstream source? If this can be confirmed as an upstream bug, the best route to getting it fixed in Ubuntu in this case would be to file an upstream bug if you're able to do that. Otherwise, I'm not sure what we can do directly in Ubuntu to fix the problem.

If you do end up filing an upstream bug, please link to it from here. Thanks!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers