Skip to content
Log In Sign Up info@muvcloud.com

What a 503 Error Means

503 Service Unavailable says the server is up but will not handle the request at the moment. Unlike a 500 Internal Server Error, it describes a temporary condition: the backend is overloaded, out of workers, stopped, or in maintenance on purpose. A 503 may carry a Retry-After header that tells clients when to try again.

If You See It on Someone Else's Site

  • Wait a minute and reload: a 503 often clears once a traffic peak or a restart is over.
  • Look for a maintenance notice: the site's status page may announce planned work.
  • Avoid rapid reloads: they add load to a server that is already struggling.

Find Which Layer Sent It

A 503 can come from the web server, a proxy or CDN in front of it, or the application. Start with the headers:

curl -I https://example.com/

The Server header and the page body often name the software. Then find the 503 entries in the access log and read the error log for the same minutes:

sudo grep '" 503 ' /var/log/nginx/access.log | tail -20
sudo tail -n 50 /var/log/nginx/error.log

Apache writes to /var/log/apache2/ on Debian and Ubuntu and to /var/log/httpd/ on AlmaLinux and Rocky Linux.

Check the Server's Load

uptime
nproc
free -m
top

A load average far above the core count from nproc, almost nothing in the available column of free, or heavy swap use mean the server cannot keep up. In top, press M to sort by memory and P by CPU. If the kernel ran out of memory, sudo journalctl -k | grep -i oom shows which process it stopped.

PHP-FPM Out of Workers

PHP-FPM runs at most pm.max_children worker processes. When all of them are busy, new requests wait, and the web server gives up with a 503 or 504. PHP-FPM writes a warning to its log that the server reached the pm.max_children setting.

The pool file is /etc/php/8.3/fpm/pool.d/www.conf on Debian and Ubuntu (replace 8.3 with your PHP version) and /etc/php-fpm.d/www.conf on AlmaLinux and Rocky Linux. Size the limit by memory. Measure the average worker first:

ps -C php-fpm8.3 -o rss= | awk '{s+=$1} END {print s/NR/1024 " MB"}'

On the Red Hat family the process name is php-fpm. With 2 GB set aside for PHP and 60 MB per worker, about 30 workers fit:

pm.max_children = 30

Test the configuration, then restart:

sudo php-fpm8.3 -t
sudo systemctl restart php8.3-fpm

A limit higher than memory allows makes things worse: the server starts swapping and every request slows down.

Apache MaxRequestWorkers

Apache caps simultaneous requests with MaxRequestWorkers. When the cap is reached, the error log says so and new connections queue. The setting is in /etc/apache2/mods-available/mpm_event.conf on Debian and Ubuntu. On AlmaLinux and Rocky Linux the MPM is chosen in /etc/httpd/conf.modules.d/00-mpm.conf and the limits are not set at all, so add them in a file under /etc/httpd/conf.d/. With the event MPM, ServerLimit multiplied by ThreadsPerChild must be at least MaxRequestWorkers. Raise it only as far as memory allows, run sudo apachectl configtest, then reload Apache.

Maintenance, Stopped Services, and Rate Limits

  • WordPress updates: during an update WordPress shows a short maintenance message with a 503. If an interrupted update leaves the message in place, confirm no update is running and turn the mode off with WP-CLI: wp maintenance-mode deactivate.
  • Planned maintenance: a 503 with Retry-After is the correct answer while a site is down on purpose. Google slows its crawling and retries later, but pages that keep returning 503 for a long time can drop out of the index, so keep the window short.
  • A stopped backend: Apache returns 503 when the application it proxies to refuses connections. Check that service with systemctl status and its own log.
  • Rate limits: Nginx's limit_req and limit_conn answer 503 by default when a client goes over the limit. 429 Too Many Requests shows how to send the clearer 429 code.

Confirm the Fix

curl -I https://example.com/

Expect 200 again. Repeat the request during the next busy hour, and watch the PHP-FPM log for new warnings about reaching the worker limit. If requests now finish but take very long behind a CDN, see Cloudflare error 524.

Updated:

Linux VPS with Full Root Access

MUVCloud cloud servers run on KVM with Enterprise NVMe SSD storage and full root access, in Turkey, the Netherlands, and the USA.

Cloud VPS Plans Starting at2.99 $/mo Cheap Linux VPS

No Limits on Service or Support

You are not on your own as your projects grow. Our support engineers are ready 24/7, on several channels, whenever you need them.

Support specialist
  • 100% customer satisfaction goal
  • Our own hardware
  • 24/7 ticket and email support
  • 4 countries with locations