How to raise ServerLimit and MaxClient

If your server starts getting more and more traffic you’ll need to lift up number of allowed Apache connections. This guide works only on cPanel/WHM powered servers.

The easy way
Log in at WHM and to go to Service Configuration > Apache Configuration > Global Configuration. In there find ServerLimit and MaxClients and set those to some nice value (eg. 1024 or 2048 depends how much memory you have). Save and that should be it.

The geek way
Edit of httpd.conf (usually located at /usr/local/apache/conf folder). It should look something like this (depending on your server specification):

StartServers        5
MinSpareServers     5
MaxSpareServers     10
ServerLimit         1024
MaxClients          1024
MaxRequestsPerChild 10000

Save, Distill settings, restart Apache:

/usr/local/cpanel/bin/apache_conf_distiller --update
/scripts/rebuildhttpdconf
/etc/init.d/httpd restart

Check
After you do something like this you simply MUST take a look at your Apache error_log file (usually located at /usr/local/apache/logs folder). If you see following line in Apache error_log:

** [warn] WARNING: Attempt to change ServerLimit ignored during restart

You should stop and run the Apache again since ServerLimit can’t be changed by restarting Apache. To do so execute following at SSH:

apachectl stop
apachectl start
Tags: serverlimit, apache serverlimit, WARNING: Attempt to change ServerLimit ignored during restart, serverlimit maxclients, serverlimit vs maxclients, serverlimit apache
Share
Published by
Nick

Recent Posts

How to Manage Storage on Smartphone: 12 Ways

Can't download new apps to your phone because there isn't enough storage space? Lack of…

10 months ago

Spotlight Search won’t open the files it finds in Dropbox with associated application

This issue started to appear on macOS 13 Ventura after recent Dropbox update. I would…

1 year ago

Windows 10 Search fix

Since this morning (Feb 5th 2020) search just stopped working on my Windows 10 (version…

4 years ago

The mysql_result in mysqli

Many of you have run into a problem when you were working on some old…

4 years ago

How to convert physical Windows PC into a virtual machine

After 10 years of running my main desktop computer on Windows 7 - time has…

4 years ago

How to downgrade PHP 7.4 to PHP 7.3 on VestaCP running on CentOS 7

I installed VestaCP for a clien on a new dedicated server running CentOS 7. Once…

5 years ago