What Causes a 503 Error? 9 Lab-Tested Causes

Written by

in

Nine causes, each forced to happen on our lab stack first: nginx 1.26.3, PHP-FPM 8.4.27, WordPress 7.1.4. Tested 18 November 2026; all fixed and re-tested.

One measurement splits all nine causes in two: how fast did the 503 arrive?

  1. Instant 503 (under a second): a gate or a rule refused the request — rate limit, entry limit, maintenance switch, or the app itself.
  2. Slow failure (30 seconds or more): your request queued behind busy PHP workers and the wait timed out.
  3. Match your case to the timing table below, then read that cause’s log line before changing anything.

The Timing Split: Instant vs Queued

Every cause in this article was reproduced on purpose, then timed.

The timings fell into two families that never overlapped.

Refusals landed in 0.0004 to 0.009 seconds — faster than any PHP page.

Queue failures landed at 25 to 40 seconds, every single time.

Nothing in nine scenarios failed between one and twenty seconds.

That gap is the most useful diagnostic fact we measured this month.

A visitor’s stopwatch tells you which family you are in.

So does a curl run from your own machine:

curl -o /dev/null -s -w "%{http_code} %{time_total}\n" https://example.com/

One warning before the causes themselves.

The same failure wears different codes on different stacks.

Our saturated pool answered 504 through nginx, not 503.

On Apache and LiteSpeed hosting, that same wall usually answers 503.

Diagnose from the log line and the timing, never the number alone.

New to the code itself? Start with the 503 pillar guide, then come back here.

Cause 1: Maintenance Mode, Switched On

Some 503s are a decision, not a failure.

A deploy script, a teammate, or a past you turned maintenance on.

The lab switch is one empty file checked on every request:

if (-f $document_root/maintenance.on) { return 503; }

File present, a normal visitor received this, instantly:

HTTP/1.1 503 Service Temporarily Unavailable
Retry-After: 120

MAINTENANCE: this lab site is paused on purpose. Retry in about two minutes.

Our exempt address browsed the same site at 200 meanwhile.

Deleting the file restored 200 on the very next request.

No reload, no restart — the check runs per request.

WordPress ships the same idea built in.

Its .maintenance file produced a 503 with Retry-After: 600.

The page text is one sentence millions of visitors can quote:

Briefly unavailable for scheduled maintenance. Check back in a minute.

First check: look for the switch before debugging anything else.

Search configs for return 503, and docroots for maintenance files.

If the maintenance is real, this cause needs no fix at all.

Cause 2: An Update That Died Halfway

WordPress turns maintenance on during every plugin update.

It writes .maintenance, swaps the plugin files, then removes it.

Kill the process between those steps and the switch stays on.

We killed an Elementor update inside that window to prove it.

The update died; the one-line file stayed behind.

Every visitor then received the maintenance page and Retry-After: 600.

Our kill landed before file replacement, so the plugin survived intact.

Seconds later, the same kill would have torn the plugin’s files.

That timing decides your recovery — switch only, or switch plus damage.

The full recovery is written up in the after-update guide.

One more behaviour from the same lab matters here.

WordPress ignores a .maintenance file older than ten minutes.

We aged the timestamp eleven minutes and the site answered 200.

The file was still sitting there, simply too old to obey.

Start here: a .maintenance file with a fresh timestamp.

Delete it — then verify the plugin underneath before celebrating.

If its files are incomplete, reinstall it cleanly from a fresh copy.

Cause 3: The PHP Worker Pool Ran Out

Each PHP worker serves one request at a time.

Slow requests hold workers; enough of them fill the pool.

Later requests wait in a queue nobody sees.

Our pool had three workers and twelve requests needing 25 seconds.

Three finished at 25.0 seconds with a 200.

Nine died at exactly 40.0 seconds — the proxy read timeout.

Through nginx, the visitor’s code was 504, not 503.

The FPM log named the real problem in one line:

[17-Nov-2026 23:48:07] WARNING: [pool labba] server reached pm.max_children setting (3), consider raising it

Restoring ten workers passed eight parallel requests cleanly.

Your first move: grep your FPM log for pm.max_children.

That line, plus slow failures, is this cause’s fingerprint.

Pool maths and slowlog hunting live in the PHP-FPM guide.

Raise the pool only after finding what holds the workers.

Cause 4 is the usual tenant.

Cause 4: One Slow Plugin Holding Every Worker

Our lab plugin did one thing: sleep fifteen seconds per visit.

Nothing malicious — a slow report, a hung API call, same shape.

Nine parallel visits against three workers came back in waves.

Three answered 200 at about 15 seconds.

Three more answered 200 at about 30 seconds.

The last three died as 504 at the 35-second timeout.

Collateral damage mattered more than the numbers.

The login page never runs the plugin’s code at all.

It still answered 504 after 35.0 seconds of pure queueing.

An untouched page failing is the signature of a shared pool.

Deactivating the plugin returned the homepage to instant 200.

Check one thing first: deactivate the suspect; watch timings, not opinions.

A pool that recovers the second a plugin sleeps elsewhere is proven.

The WordPress-specific playbook is in the WordPress 503 guide.

Cause 5: Rate Limiting Set Below Real Traffic

Nginx rate limits refuse with 503 by default, not 429.

That default surprises teams the first time it fires.

Our test zone allowed one request per minute, burst two.

Ten quick requests: three passed, seven were refused.

Every refusal was instant — the slowest took 0.0025 seconds.

The rest of the site stayed up throughout the test.

Only the limited location answered 503.

The error log confessed on every single refusal:

limiting requests, excess: 3.000 by zone "labba_rate", client: 127.0.0.1, server: lablim.local, request: "GET /limited.php HTTP/1.1"

The tested fix raised both numbers together:

limit_req_zone $binary_remote_addr zone=labba_rate:10m rate=20r/s;
limit_req zone=labba_rate burst=20 nodelay;

Ten of ten requests then passed.

Open with this: grep the error log for limiting requests.

Then measure your real peak before touching the numbers.

Rate limits belong to the 429 site’s territory when they throttle APIs.

Here they matter only because nginx answers them with 503.

The full nginx treatment is in the nginx 503 guide.

Cause 6: Connection and Entry-Process Limits

Shared hosting counts entries, not visitors.

One slow page holds one entry until it finishes.

Our gate allowed three concurrent entries in front of ten idle workers.

Ten parallel ten-second requests hit that gate.

Three passed and completed at ten seconds.

Seven were refused instantly, in under 0.01 seconds.

During the burst, a static file answered 200 in 0.0016 seconds.

A fast PHP page outside the gate answered 200 in 0.0012 seconds.

The same fast page through the gate was refused instantly.

And the FPM log wrote zero pool-full lines during it all.

PHP had spare workers the entire time.

Refusals happened at the gate, exactly like an LVE fault.

The nginx log line mirrors the cPanel fault counter:

limiting connections by zone "labba_ep", client: 127.0.0.1, server: lablim.local, request: "GET /ep.php?s=10 HTTP/1.1"

The first test: your host’s resource-usage graph, not the PHP log.

On cPanel that means Resource Usage → Details and its fault count.

The cPanel walkthrough is in the cPanel 503 guide.

Hostinger calls the same wall PHP workers — see the Hostinger guide.

Cause 7: Cron Jobs Arriving in a Pile

Backups, imports, and sitemap builds love the same minute.

Three heavy jobs starting together are a traffic spike you scheduled.

We fired three bursts of eight requests, spaced like cron rounds.

Every round returned the identical split: three passed, five refused.

No damage, no stuck state — each round healed itself.

That is why limit 503s feel haunted.

The site breaks on schedule and recovers on schedule.

Resource-usage graphs show faults at the same time daily.

WordPress adds its own pile-up: WP-Cron fires on visits.

A quiet site stacks overdue jobs into one burst.

Begin with the schedule: list every cron job and its minute.

Stagger heavy jobs apart; move backups off-peak.

Replace WP-Cron with one real system cron you control.

Discipline here is prevention, covered in the prevention guide.

Cause 8: A Traffic Spike Past Capacity

Sometimes nothing is misconfigured at all.

More visitors arrive than the pool can hold, briefly.

Our baseline first: five parallel ten-second requests, five 200s.

Then twenty-five parallel requests needing 25 seconds each.

Ten workers meant ten 200s at 25 seconds.

Fifteen requests queued past the 40-second timeout as 504.

Recovery had a measurable tail worth knowing.

A fast page requested right after the spike took 10.28 seconds.

The workers were still draining the queue behind the timeouts.

Twenty seconds later the same page took 0.0019 seconds.

Look at the calendar: does the failure window match a traffic event?

A launch, a newsletter, a mention — spikes leave marketing fingerprints.

If spikes are your pattern, capacity planning beats debugging.

Our 503 Checker confirms what visitors saw, from outside.

It sits on our homepage, free to run any time.

Cause 9: The App Behind the Proxy Answered 503 Itself

The last cause is the one nobody believes.

Sometimes the application is healthy, fast — and choosing 503.

A maintenance flag inside the app, a deployment gate, a kill switch.

The lab app answered with its own sentence and header:

HTTP/1.1 503 Service Unavailable
Retry-After: 120

APP-OWN-503: the application itself answered 503 (maintenance flag inside the app)

The front proxy delivered that body word for word.

Its access log recorded the 503.

Its error log recorded nothing at all — zero new lines.

That silence is the fingerprint of a pass-through.

Nginx only logs what it decides, not what it delivers.

With a second backend configured, the story changed.

The proxy marked the 503 as a failure and failed over.

Visitors received the backup’s 200 while the primary still 503’d.

The primary’s own log proved it had answered first.

Final check: read the body, not just the code.

An app’s own wording means the hunt moves behind the proxy.

Compare shapes with the HTTP Status Code Explorer if unsure.

The Decision Table

Nine causes, compressed into the order we actually check them.

Cause How fast Log signature First move
Maintenance switch Instant None — a rule, not an error Find the switch file or return 503
Interrupted update Instant Fresh .maintenance file Delete file, repair the plugin
Worker pool full 25–40 s server reached pm.max_children Find what holds workers
Slow plugin 15–35 s Same pool line, one culprit Deactivate and re-time
Rate limit Instant limiting requests … by zone Raise rate and burst together
Entry limit Instant Host fault counter; PHP log silent Resource Usage graph
Cron pile-up Instant, on schedule Faults at the same minute daily Stagger the jobs
Traffic spike 25–40 s Pool line during a traffic event Capacity, caching, queueing
App’s own 503 Instant Proxy error log silent Read the body; check the app

Our standing order: timing first, log line second, changes last.

Every wrong fix we tried started by skipping step one.

What Did Not Work

Expecting the pool to answer 503. It answered 504 on nginx.

Anyone debugging by number alone misreads this layer completely.

Raising one ceiling. Gate raised from three to ten, burst passed.

The pool immediately logged its first max_children line.

One raised number relocates a wall; it never removes load.

Restarting to clear it. A restart empties limit zones and queues.

It also erases the evidence you needed for the diagnosis.

Our limit tests only became readable after a deliberate restart.

That cuts both ways, and the article counts it as a failure.

Blaming PHP for gate refusals. The FPM log stayed silent.

Requests never reached PHP, so pool tuning changed nothing.

FAQ

What is the most common cause of a 503 error?

In our lab’s nine scenarios, capacity walls produced the most failures.

Pool saturation, entry limits, cron piles, and spikes are one family.

Slow requests holding workers sit underneath all four.

Can a 503 be my own fault as a visitor?

Yes — a rule can refuse only your address or network.

We reproduced that case for the whose-fault guide.

Why did my 503 turn into a 504 in reports?

Different layers report the same failure differently.

A queued request that times out is logged as 504 by nginx.

The cause — a full pool — is identical either way.

How long should I wait before retrying a 503?

Respect the Retry-After header when one is sent.

Our maintenance answers asked for 120 and 600 seconds.

Without a header, a minute beats a refresh storm.

Does a 503 mean the server is down?

No. In six of nine causes the server was up and answering.

It was refusing, queueing, or following a rule — not down.

Sources and date: nine scenarios reproduced 18 November 2026 on nginx 1.26.3, PHP-FPM 8.4.27, WordPress 7.1.4 (Debian 13), then fixed and re-tested.

Limit and upstream behaviour follows the official nginx module documentation; the WordPress maintenance window follows WordPress core behaviour verified in the lab.

References

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *