Skip to content

What's the difference?

500vs503

Both are sent by the app. Watch whether it attempts the work before it answers.

  1. 500The app tries. The request goes on to the database, something fails, and the surprise becomes a 500.
  2. 503The app is full and does not try. It answers 503 at once, and the database is never asked.

How to tell them apart in 10 seconds

What it means

500
Something unexpected broke
503
Deliberately refusing work for now

Was the work attempted?

500
Yes, and it may be partly done
503
Typically no

Expected to pass?

500
No promise. A bug fails every time
503
Yes. It can say when with Retry-After

What's in the logs

500
A stack trace in the app's error log
503
A limit, health check or maintenance message

Retry?

500
Idempotent requests, a few times
503
Yes, after Retry-After or a backoff

In short

500 vs 503: the difference

500: the server tried and broke. 503: the server chose not to try right now.

Both codes put the blame on the server side, and both are typically sent by the application itself, which sets them apart from 502 and 504. What differs is intent. A 500 Internal Server Error is an accident: the application accepted the request, started work, and hit something it had no plan for, such as a bug or an unexpected database error. A 503 Service Unavailable is a decision: the application, or a load balancer in front of it, is running but will not take the request at the moment, because it is overloaded or in maintenance. A 503 expects to recover and can say when, through the Retry-After header. A 500 makes no such promise, and if the cause is a bug it will fail the same way every time until someone fixes the code.

Your turn

Which one is this?

Which one is this? During a planned database upgrade, the site shows a “back in ten minutes” page to every visitor, with a Retry-After header.

Each code in depth

Questions

What is the difference between 500 and 503?
A 500 means the server tried to handle the request and failed unexpectedly. A 503 means the server is deliberately not handling requests for now, because of overload or maintenance.
Which is more serious, 500 or 503?
A 500 usually points to a bug that needs a code fix. A 503 is expected to clear by itself, though a 503 that never clears is an outage like any other.
What should a maintenance page return?
503, with a Retry-After header. It tells browsers, monitors and search engines the outage is temporary. Returning 200 would make them treat the holding page as real content.

Sources: RFC 9110: 500 Internal Server Error (section 15.6.1) ↗ · RFC 9110: 503 Service Unavailable (section 15.6.4) ↗ · Report a problem

Diagrams are our own simulations. All wording is original and paraphrases the linked sources.

Practise this in the DNS / HTTP track

Two-minute animated lessons, then boss fights from real outages. Free, no account needed.

Start the track