Skip to content

Error 503 and error 522: what they mean and how to fix them

· The AYT team · 4 min read

Network cables plugged into a switch

Both show up as a page with a code instead of your site, and both mean visitors see nothing. They come from different places, though, so the checks differ too.

Telling them apart

503 Service Unavailable is sent by the server your site runs on. The server got the request but can't serve it right now: it's busy, in maintenance, or PHP isn't responding.

522 Connection timed out is a Cloudflare code and only appears if the site goes through their proxy (the orange cloud in the DNS list). Cloudflare tried to connect to your server and got no answer in time, so the request never reached WordPress.

Cloudflare's error page also shows where the request stopped, with three boxes: the browser, Cloudflare and the server (Host). On a 522, the red X is on the server.

503: the usual causes on WordPress

Maintenance mode left on

During an update, WordPress puts a .maintenance file in the site's root folder. If the update is interrupted, the file stays, and the site shows "Briefly unavailable for scheduled maintenance" with a 503 code. Delete the file in File Manager and run the update again.

Every PHP process is busy

Each account has a number of PHP processes that can run at once. When they're all busy, with visitors, with a bot downloading the whole site, or with a plugin running a long operation, new requests get a 503. In the AYT panel, the account's process graph shows whether you hit the limit, and the slow plugins report shows which pages keep processes busy.

Start with the simplest fix: turn on the page cache, so ordinary visitors no longer reach PHP. Then look in the access log for bots requesting hundreds of pages a minute and block them. Fix or replace the slow plugin. Only after all that, consider a bigger plan.

Memory

A plugin that does a lot in one request (product imports, PDFs, page builders) can go over memory_limit. Usually you see "Allowed memory size exhausted" in the error log and a 500 error. If the system kills the process, the visitor may get a 503 instead. At AYT, the error log is in the panel, you change memory_limit in the site's PHP settings, and monitoring emails you when the account runs out of memory.

A broken plugin or theme

If the 503 appeared right after you installed or updated a plugin, rename its folder in wp-content/plugins, for example by adding -off to the end. WordPress deactivates it, and if the site comes back, you've found the cause.

522: the usual causes

The server's firewall blocks Cloudflare

When a site is behind Cloudflare, every request reaches the server from Cloudflare's IP addresses. A firewall that blocks one of them, say for sending too many requests, cuts the site off for every visitor routed through it. The server has to know Cloudflare's ranges and read the visitor's real address from the header Cloudflare sends. On managed hosting, ask support.

The DNS record points at the old server

You moved the site, but the A record in Cloudflare still has the old provider's address. Cloudflare keeps trying to connect to a server that may no longer exist. Open DNS in the Cloudflare dashboard and check the address in the A record.

The server is overloaded or down

A server that no longer accepts new connections produces a 522 through Cloudflare and "connection timed out" without it. Check your host's status page. For AYT's servers, the status page shows problems and scheduled maintenance in real time.

The order of checks

  1. Read the exact code on the page: 503 or 522.
  2. For a 522, switch the cloud to grey (DNS only) for a few minutes. If the site works without Cloudflare, the problem is between Cloudflare and the server: the firewall or DNS. If it still doesn't work, the problem is on the server.
  3. Check your host's status page.
  4. Open the error log in the panel and read the last few minutes.
  5. If the problem started after a change, undo it: deactivate the plugin, go back to the previous version, or restore last night's backup.

If you've gone through the list and the site still doesn't work, open a ticket with the exact code and the time it started. At AYT we handle server incidents whenever they happen, and other problems Monday to Friday, 9:00 to 18:00 Romanian time.

More articles

All articles