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

I've been trying to raise my MaxClients in apache for quite a high traffic site..

But I kept receiving this error:

WARNING: MaxClients of 565 exceeds ServerLimit value of 256 servers,
 lowering MaxClients to 256.  To increase, please see the ServerLimit
 directive.
Syntax OK

So after some searching, I've included:

    StartServers        5
    MinSpareServers     15
    MaxSpareServers     30
    ServerLimit         565
    MaxClients          565
    MaxRequestsPerChild 2000

After doing a graceful restart the warning didn't occur, and everything seemed OK.

However, after checking my apache error.log - the Warning still exists.

** [notice] Graceful restart requested, doing restart
WARNING: MaxClients of 565 exceeds ServerLimit value of 256 servers,
 lowering MaxClients to 256.  To increase, please see the ServerLimit
 directive.
** [warn] WARNING: Attempt to change ServerLimit ignored during restart

Would the ServerLimit taken affect? as the Graceful restart worked... Can anyone shed some light?

Cheers!

share|improve this question
2  
As a side note having "MaxRequestsPerChild" != 0 has an impact on how frequent each apache process will recycle, 2000 is really low (start with 20k) ! The only interest of this setting is limiting memory leaks in case it happens, please change that setting ! –  Shadok Jan 20 '12 at 11:05
add comment

2 Answers

up vote 4 down vote accepted

I think you will need to do a stop and start of httpd (so that the "master" httpd process is stopped and started, not just the child processes). From the Apache documentation's entry on ServerLimit:

"Any attempts to change this directive during a restart will be ignored, but MaxClients can be modified during a restart."

share|improve this answer
add comment

You must actually ensure two things for this to take effect:

  • restart apache rather than merely reload
  • ensure that ServerLimit comes before MaxClients in the Apache configuration, otherwise Apache will read MaxClients first and produce the same error

There are other very obvious caveats such as ensuring it's not in the wrong place, inside an <If> block that is not read for example.

share|improve this answer
add comment

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.