3

Im using Apache 2.4 with prefork.

My MPM directives are set as follows:

<IfModule mpm_prefork_module>
MinSpareServers 200
MaxSpareServers 400
StartServers 200
ServerLimit 1300
MaxClients 1300
MaxRequestWorkers   1300
MaxRequestsPerChild 10000
</IfModule>

However my server-status page shows:

Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 34 minutes 54 seconds
Total accesses: 551221 - Total Traffic: 11.8 GB
CPU Usage: u8151.55 s2320.18 cu.02 cs.11 - 500% CPU load
263 requests/sec - 5.8 MB/second - 22.5 kB/request
1024 requests currently being processed, 0 idle workers

WKWKKWWWWKWKKKWKKCRWWKWWKKWKKWKWKWKWWWWWKKKWKWWKKWKKWWWWWKWWKWWK
WWWWKWKWWWWWKWKKWKWKWCKWKKKKKWKKWWKKCKKKKWWWKKWKKWWWKKWCKKWKKKKW
WWKKWKKWWWKWKWWKKKWKKWWWKKWWKKKWWKKKKWKKWKCKKWKKWKKKKWWWKWKKWKWW
WWKWWKWWKKWKWKKWKRWKWKKWWWWWWKCKKKKKWWWKWWWKKKKWWKWWKWWKKKKWWKKK
WKKKWWWWWWWKWKWKWWKKWKKKKKKWKWWKWWWKKKKWKKKWWKKWWKKWKWKWWWWKKWKW
KWKWWWWKCWKKKCWKKWWWWWKWKWWKWKWRWKKWWKWKWKKWWKKWKWKWKKKKWWKKKWKW
WKKKKKWKKKKWWKWKWKWWWKKKWWKWCCKWKWWKKWKKWWCKKWWWWKKWKWWWWWWWWKKK
WWKKKWKWKKKKKKKKWKKKKKKKWWWCKWWWKKWWWWKWCWWKKKKWKWWKKKWKWKWWWWWW
WKWKKKWKWKKWWWWKWWWWWKKCWKWWKWKWWWWWWKWWWWKKWWWKWWWWKWKWKKKWKKWK
WWKKKWKWWWKKWWWKWKWKWKKKKWKWWWWWWWKKWWWWKKKCKKKWKWKWWWWKWKWWWWWW
WWKKKWKWWWKWWKWWKKWKWKWKWKKWKKWKKKCKKWWWKWCWKKWWKKWWKKWKKWWKKWWK
WWKKWKWKKWKWKWKWWKWKKWWKKWWKKKWKWWKKWWWKKWWKKCKKKWWKKWKWWWCWKKWK
KKWKWKWWWWWKKKKKKKWKWKWKWWWWKKKWWKWKWKKKWKWWWKWCWWKWKWWKKKWWWCWK
WCWCKWWKKWKWWKWKKWWWKKWWKRKWWKKWWWKWKWWKWKKWWWKKWWKWKWKWWWKWKWKW
WKWKWWKWKKKWWWKWWWKCWWWWKWWWKKKKKKWKWKKKKKKKKWKKWWWWWWWWWKWWWKKW
KWKKKWWKKWWKWKWWKKWWKKKKKWKWWWKKWKWWKWWWKKKWKWCKKKKWWKWWKWCKKCKK
SSSSSSSSSSSSSSSSSSSSSSSSS.......................................
................................................................
................................................................
................................................................
....................

Notice the line that says 1024 requests currently being processeed with 0 idle workers. It just pegs at 1024 requests.

Now at the top of my /etc/init.d/httpd I have ulimit -HSn 32768 so I don't think it's an open files limit issue.

I can't really think of why connections are getting cut at 1024 even though my MaxClients is set higher and server-status seems to want more connections but stops at 1024.

1
  • 1
    Is there anything in the error logs?
    – mdpc
    Oct 30, 2012 at 19:27

2 Answers 2

4

According to the Apache 2.4 ServerLimit docs:

There is a hard limit of ServerLimit 20000 compiled into the server (for the prefork MPM 200000).

So, you should not be hitting the hard limit.

I've had trouble adjusting ServerLimit in earlier versions; try apache2ctl stop and then apache2ctl start. (Using graceful and even restart failed to pick up the change.)

On a side note: You may want to reduce your KeepAliveTimeout and/or MaxKeepAliveRequests, or try KeepAlive Off since you have so many workers in the 'K' state. Also, those 'S'es indicate that the server is having trouble starting up workers, likely due to the 500% CPU load (which I assume is the max available.) If tweaking the KeepAlive settings doesn't help, you may need to look into upgrading the server or load balancing.

-2

You should investigate HA Proxy (if you have not already) to split up your requests to multiple servers.

Even on fast hardware, you are pumping alot of data from a single machine. If you need to keep a single machine, try Nginx. It will run circles around Apache at high load.

2
  • 1
    You have completely failed to address the question that was asked. Oct 30, 2012 at 19:21
  • I was attempting to guide the user that if there is this much traffic to one server, it might be time to look at load balancing.
    – gmck
    Nov 16, 2012 at 21:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .