Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
1  
Is there anything in the error logs? –  mdpc Oct 30 '12 at 19:27

2 Answers 2

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.

share|improve this answer

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.

share|improve this answer
1  
You have completely failed to address the question that was asked. –  John Gardeniers Oct 30 '12 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 '12 at 21:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.