SECURITY WARNING: Never run commands you don't understand. Always review code before execution. Use at your own risk.
WebServer New Added 26 October 2026

Apache: AH00161: server reached MaxRequestWorkers setting, consider raising

Every Apache worker is busy, so new connections wait in the listen queue and the site slows down or hangs. Raising the limit treats the symptom; the real question is what is holding the workers. Under the prefork MPM with mod_php, each request ties up a whole process for as long as a slow PHP script or database query takes, and keep-alive connections hold workers that are doing nothing. It often turns up next to php-fpm max_children warnings, because Apache is simply waiting on PHP.

Quick fix

Read the commands before running them. Anything that restarts a service, deletes data or changes permissions should be tried on a non-production system first.

Quick fix
# Which MPM is running, and what limits are set?
sudo apachectl -M | grep mpm
grep -rnE "MaxRequestWorkers|ServerLimit|ThreadsPerChild" /etc/apache2/mods-enabled/ /etc/httpd/conf.modules.d/ 2>/dev/null

# What are the workers doing right now? (needs mod_status)
curl -s "http://localhost/server-status?auto" | grep -E "BusyWorkers|IdleWorkers"

# Size it from memory: RAM you can give Apache / average process size
ps -C apache2,httpd -o rss= | awk '{s+=$1;n++} END {print n " procs, " s/n/1024 " MB avg"}'

# Event MPM example: MaxRequestWorkers <= ServerLimit x ThreadsPerChild
# ServerLimit        16
# ThreadsPerChild    25
# MaxRequestWorkers 400
sudo apachectl configtest && sudo systemctl restart apache2

# Longer term: mpm_event with php-fpm, and a short KeepAliveTimeout

How to diagnose WebServer errors

Web server errors are usually about permissions, binding, or configuration that was never loaded. A common trap: the server runs as an unprivileged user (www-data, nginx), so it needs execute permission on every directory in the path to a file, not just read permission on the file itself. Another: editing a config file changes nothing until the server is reloaded and the file is actually included.

If the quick fix above does not resolve it, work through these steps. They apply to this whole class of error, not just to this one message, which is usually what saves the time.

  1. Validate configuration before reloading: nginx -t, apachectl configtest, caddy validate. This catches syntax errors without dropping traffic.
  2. Dump the fully resolved configuration with nginx -T to see what is actually in effect, including every include.
  3. Read the error log, not the access log, for 5xx causes. nginx names the failing upstream and the exact filesystem path it could not open.
  4. For permission errors, test as the server user: sudo -u www-data cat /path/to/file. Check execute bits on every parent directory.
  5. For binding failures, find the current listener with ss -tulpn | grep :80. Ports below 1024 need privileges or a capability such as CAP_NET_BIND_SERVICE.

Tools worth reaching for

  • nginx -t / nginx -T
  • apachectl configtest
  • ss -tulpn
  • tail -f error.log
  • sudo -u www-data

Authoritative references

Primary documentation for this error, worth reading before applying any fix in production.

httpd.apache.org httpd.apache.org

Related WebServer errors

See all 20 WebServer errors →

Browse other categories

Something missing or wrong?

This entry is maintained by hand. If the fix is out of date, incomplete, or you have a better one, email a correction and it will be reviewed.