If your DirectAdmin server's load average is consistently above the number of CPU cores, the first thing to check is Apache. Too many Apache processes running simultaneously saturate RAM, push the server into swap, and bring everything to a crawl — including the DirectAdmin control panel itself. The error message in your Apache logs (AH00484: server reached MaxRequestWorkers setting) is the clearest signal that your Apache configuration needs tuning. This guide shows you how to diagnose the exact cause, calculate the right limits, persist changes through CustomBuild updates, and switch to a higher-performance MPM if needed.
💡 None of these worked? Skip the guesswork.
Get Expert Help →Step 1: Diagnose the Root Cause
uptime
# Load average output: 1.23 5.67 8.90 (1-min, 5-min, 15-min)
# If 1-min load exceeds CPU core count, Apache is the likely culprit
free -m
# Check: how much RAM is used, how much swap is active
top -bn1 | grep httpd | wc -l
# Count: current number of Apache (httpd) processes running
grep -i "maxrequestworkers\|maxclients\|reached" /var/log/httpd/error_log | tail -20
If you see AH00484: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting, Apache hit its process limit and started rejecting requests. Ironically, raising this limit without enough RAM makes things worse — so read the next section before changing any numbers.
# Enable mod_status if not already active, then check:
curl http://localhost/server-status?auto 2>/dev/null | grep -E "^(Busy|Idle|Total)"
# Check which domains are getting the most hits right now:
tail -1000 /var/log/httpd/access_log | awk '{print $1}' | sort | uniq -c | sort -rn | head -20
# Check for xmlrpc.php attacks (WordPress-specific CPU drain):
grep "xmlrpc.php" /var/log/httpd/access_log | wc -l
ps -ylC httpd --sort:rss | awk '{sum+=$8; count++} END {print "Avg RSS:", sum/count/1024, "MB"}'
On a typical PHP hosting server with no OPcache pre-load, each Apache process consumes 25–60 MB. Use the actual number from this command.
Example: 8 GB RAM server, 1.5 GB reserved for MariaDB, PHP-FPM, and the OS, average Apache process size 45 MB:
(8192 MB - 1536 MB) / 45 MB ≈ 149
# Round down to a safe value:
MaxRequestWorkers 120
Always leave a 20% buffer below the calculated maximum. The goal is to cap Apache before it forces the kernel to start swapping.
apachectl -V | grep "MPM"
# Output: Server MPM: prefork (or worker, or event)
# Check where MPM settings live:
grep -r "MaxRequestWorkers\|MaxClients" /etc/httpd/conf/ 2>/dev/null
grep -r "MaxRequestWorkers\|MaxClients" /usr/local/directadmin/custombuild/custom/ 2>/dev/null
mkdir -p /usr/local/directadmin/custombuild/custom/ap2/
cp /etc/httpd/conf/extra/httpd-mpm.conf /usr/local/directadmin/custombuild/custom/ap2/httpd-mpm.conf
Open /usr/local/directadmin/custombuild/custom/ap2/httpd-mpm.conf and find the <IfModule mpm_prefork_module> block (or worker/event, depending on your MPM):
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxRequestWorkers 120
MaxConnectionsPerChild 0
</IfModule>
Set MaxRequestWorkers to your calculated value. Setting MaxConnectionsPerChild to a non-zero value (e.g., 1000) causes Apache to recycle processes after handling that many requests, which prevents slow memory leaks over time.
/scripts/restartsrv_httpd
apachectl -t # Verify configuration syntax
top -bn1 | grep httpd | wc -l # Watch process count drop
cd /usr/local/directadmin/custombuild
./build set php1_mode php-fpm
./build php n
DirectAdmin admin panel → Reseller Level → Manage User Packages → select the user → PHP Version Selector → choose PHP-FPM mode. Alternatively, set it for all accounts at once via the PHP Version Selector in Admin Level.
systemctl status php-fpm
ps aux | grep php-fpm | head -5
# Apache processes should now be much smaller:
ps -ylC httpd --sort:rss | awk '{sum+=$8; count++} END {print "Avg RSS:", sum/count/1024, "MB"}'
Step 5: Add Nginx as a Reverse Proxy (Optional, High Traffic)
For servers handling sustained high traffic, placing Nginx in front of Apache dramatically reduces load. Nginx handles static files and concurrent connections efficiently, passing only dynamic PHP requests to Apache. DirectAdmin's CustomBuild supports this directly:
cd /usr/local/directadmin/custombuild
./build set webserver nginx_apache
./build nginx
./build apache n
./build rewrite_confs
After this, Nginx listens on port 80/443 and Apache listens on port 8080. All static files (images, CSS, JS) are served by Nginx without touching Apache, and Apache's MaxRequestWorkers limit is hit far less frequently.
Step 6: Block Resource-Draining Attacks at the Apache Level
Many DirectAdmin servers with high load are actually under low-level attacks rather than legitimate traffic spikes. The most common are WordPress xmlrpc.php floods and slow-loris HTTP attacks.
Block xmlrpc.php attacks
# Add to /etc/httpd/conf/extra/httpd-vhosts.conf or per-domain .htaccess:
<Files xmlrpc.php>
Order Deny,Allow
Deny from all
</Files>
Enable mod_reqtimeout to mitigate slow-loris
# Verify mod_reqtimeout is loaded:
apache2ctl -M | grep reqtimeout
# Add to httpd.conf or a custom include:
RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500
Rate-limit by IP using mod_evasive
cd /usr/local/directadmin/custombuild
./build set mod_evasive yes
./build mod_evasive
Step 7: Monitor Load After Changes
# Watch load average in real time:
watch -n5 "uptime && free -m && ps aux | grep httpd | wc -l"
# Set a cron alert if load exceeds threshold:
echo "*/5 * * * * root [ \$(cut -d' ' -f1 /proc/loadavg | cut -d. -f1) -gt 8 ] && echo 'High load' | mail -s 'Server Load Alert' admin@yourdomain.com" >> /etc/cron.d/load-monitor
Tuning Apache on a DirectAdmin server is an iterative process — the right MaxRequestWorkers value depends on your specific mix of PHP applications, traffic patterns, and RAM. If load spikes persist after these changes, it's often a sign that a specific site or cron job is the bottleneck. For managed DirectAdmin servers where consistent performance is critical, CloudHouse's server management team can audit your configuration and implement the full PHP-FPM + Nginx stack tuned for your workload.
