A 504 means the gateway's waiting period ended, not necessarily that the underlying operation stopped. A report, payment or import may continue after the client receives the error. Identify the slow dependency and whether side effects occurred. Longer timeouts can hide the symptom while leaving workers occupied and visitors waiting, so inspect the work itself before changing limits.
504 Gateway Timeout
A gateway waited too long for the upstream response needed to complete the request.
All HTTP status codes
What does HTTP 504 mean?
An investigation example
Illustrative export-timeout investigation
Response: 504 Gateway Timeout after 60 seconds
Export job completes at 84 seconds.
User retries and starts another copy.
Action: make the export asynchronous or reduce its work.
Verify: submission returns promptly and one completed export is available through a progress flow.Common causes
- An application request waits on a slow database query, lock or external API.
- All backend workers are busy and new requests wait too long for a worker.
- Network loss or a stalled upstream connection prevents a timely exchange.
- A legitimate export or report is being performed synchronously beyond the proxy's time budget.
Diagnose the response
Trace the slow upstream operation and compare timeout budgets across layers before increasing any one limit.
- Record the elapsed time and compare it with proxy, application and dependency timeouts. A consistent duration helps identify which layer stopped waiting first.
- Trace the slow request into database queries, lock waits and outbound calls. Optimise the work or restore the failing dependency before extending timeouts across the stack.
- Move long-running jobs behind an asynchronous workflow where appropriate, returning a job identifier that the client can check. Do not keep expensive work tied to an open browser request unnecessarily.
- For a timed-out write, check its final state before retrying. The upstream may have completed after the gateway returned 504, so careless retries can duplicate a charge or record.
What it means for website monitoring
Correlate timeout durations with application and dependency traces. Before repeating a write after a Sitepulse or browser failure, establish whether the original operation completed.