MaxRequestWorkers, called MaxClients before Apache 2.4) is set higher than ServerLimit allows, so Apache lowers it at start-up. On cPanel, change both values in WHM > Service Configuration > Apache Configuration > Global Configuration, not in httpd.conf. With the event or worker MPM, ServerLimit × ThreadsPerChild must be at least MaxRequestWorkers; with prefork, ServerLimit must be at least MaxRequestWorkers.What the warning looks like
WARNING: MaxRequestWorkers of 500 would require 20 servers and
would exceed ServerLimit of 16, decreasing to 400.
Older Apache versions word it as MaxClients of 500 exceeds ServerLimit value of 256 servers, lowering MaxClients to 256. Either way, Apache starts, but with fewer workers than you asked for.
The settings in plain words
| Directive | Meaning |
|---|---|
| MaxRequestWorkers (MaxClients) | The most requests Apache serves at the same time. Extra requests wait in a queue. |
| ServerLimit | The most Apache child processes that can exist. A hard cap set at start-up. |
| ThreadsPerChild | Threads in each child process (event and worker MPMs only). |
| StartServers, MinSpareThreads, MaxSpareThreads | How many processes or threads Apache keeps ready. |
Step 1: check the Apache version and MPM
httpd -v # Apache version
httpd -V | grep -i mpm # event, worker or prefork
Current cPanel servers run Apache 2.4, usually with the event MPM and PHP-FPM. Some older setups use prefork with mod_php or another handler. The maths is different for each.
Step 2: work out matching values
| MPM | Rule | Example |
|---|---|---|
| event or worker | ServerLimit × ThreadsPerChild ≥ MaxRequestWorkers | ThreadsPerChild 25, MaxRequestWorkers 400, ServerLimit 16 |
| prefork | ServerLimit ≥ MaxRequestWorkers | MaxRequestWorkers 150, ServerLimit 150 |
Do not raise the limits further than the server’s memory allows. With prefork, each worker is a full process. Measure the average size of an Apache process, then divide the memory you can give Apache by that size:
ps -ylC httpd --sort:rss | awk 'NR>1 {sum+=$8; n++} END {print "avg MB:", sum/n/1024, "processes:", n}'
With event and PHP-FPM, Apache threads are small, and memory is mostly used by PHP-FPM, which has its own limits per domain in MultiPHP Manager.
Step 3: change the values in WHM
- Log in to WHM and open Service Configuration > Apache Configuration.
- Open Global Configuration.
- Set Server Limit and Max Request Workers using the rule for your MPM.
- Save, then click Rebuild Configuration and Restart Apache.
WHM stores these values and writes them into httpd.conf each time it rebuilds the configuration. Values typed directly into httpd.conf are lost at the next rebuild. If you need a directive WHM does not offer, use the Include Editor on the same page.
Step 4: confirm the change
/scripts/restartsrv_httpd
grep -iE "MaxRequestWorkers|ServerLimit" /etc/apache2/conf/httpd.conf
tail -n 20 /etc/apache2/logs/error_log
The warning should no longer appear after the restart.
Is the limit really the problem?
Before you raise limits, check whether Apache actually runs out of workers:
grep -i "MaxRequestWorkers" /etc/apache2/logs/error_log | tail
# "server reached MaxRequestWorkers setting" means the limit was hit
If the limit is hit often, raising it helps only if the server has spare CPU and memory. Very often the real cause is slow PHP pages, a bot flood or a slow database, and more workers just make the server swap. Look at the busiest processes with htop, and add caching or a CDN before adding workers. See our database performance guide as well.
Troubleshooting
| Problem | Likely cause | Fix |
|---|---|---|
| The warning returns after a cPanel update | Values were edited in httpd.conf | Set them in WHM Global Configuration instead. |
| Apache will not start | ServerLimit is far too high for the memory, or a typo in an include | Lower the values and check the error log. |
| The server swaps heavily after the change | Too many workers for the memory | Lower MaxRequestWorkers and tune PHP-FPM limits. |
Need help with this?
Apache struggling under load? Our team can tune Apache, PHP-FPM and caching for your traffic.
Frequently asked questions
What replaced MaxClients in Apache 2.4?
MaxRequestWorkers. MaxClients is still accepted as an old name.
Where do I change MaxRequestWorkers on cPanel?
In WHM > Service Configuration > Apache Configuration > Global Configuration. Then rebuild and restart Apache.
How do I know which MPM I use?
Run httpd -V | grep -i mpm. Most current cPanel servers use event.
Should I set MaxRequestWorkers as high as possible?
No. Set it to what the server’s memory and CPU can handle. Too many workers make the server slower.
Does MaxRequestWorkers limit PHP-FPM too?
No. PHP-FPM has its own process limits for each domain, set in MultiPHP Manager. Tune both together, so Apache does not accept more requests than PHP can handle.
Why does Apache lower my value?
ServerLimit, or ServerLimit times ThreadsPerChild, is too small for the MaxRequestWorkers value you set.
Related guides
