7

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!

  • 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
14

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."

7

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.

4

apachectl graceful will not work, the more important that apachectl restart will not work either.

The solution is /etc/init.d/httpd restart or service httpd restart

  • 1
    In case of Ubuntu: service apache2 restart – Slavik Nov 29 '18 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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