Monitoring
Solutions
Resources
Free Tools
Pricing
Home / HTTP errors / 504 Gateway Timeout
HTTP error

504 Gateway Timeout

A gateway did not get a response from the server behind it in time.

What it means

A proxy, load balancer or CDN waited for an upstream server and gave up. The backend may still be working on the request, it just did not answer within the time limit.

Common causes

  • A slow database query or long-running script
  • An overloaded backend
  • A slow third-party API the application depends on
  • A proxy timeout set too low for the work being done
  • A network problem between the proxy and the backend

How to fix it

If you are a visitor

  • Reload the page after a minute
  • Try again later

If you run the site

  • Find the slow request in the application and database logs
  • Move long tasks to a background queue
  • Raise the proxy timeout only if the work really needs it
  • Track response times so you see the slowdown before the timeouts begin

Catch it before your users do

You can check the status code of any address right now. To hear about 504 errors as they happen, an HTTP(S) monitor requests the page around the clock, compares the response with the status codes you expect and alerts you when it does not match.

Related errors

Start with 10 free monitors

Any monitor type, no card required.

Create free account →