Web Technician Online

504 Gateway Timeout: find the slow dependency

Note which action times out and how long it waits.

What does this mean?

A gateway waited for an upstream response and reached its time limit. This is different from proving that your internet connection is slow. The delay may be inside the application, a database query or an external service used while generating the page.

What should I check first?

Note which action times out and how long it waits. Compare a static page, a normal dynamic page and the failing operation. Avoid repeatedly clicking checkout or submit: an operation may complete upstream even though your browser receives a timeout. Check the transaction status before trying again.

How can I diagnose the cause?

Match proxy timestamps to application logs and slow-query records. Check whether a scheduled job, large export or plugin integration began at the same time. If the application calls a remote API, review that provider’s status and the application’s own timeout handling.

How do I fix it safely?

Fix the slow task or failed dependency first. Move large work into a documented background process where the application supports it, reduce unnecessarily expensive queries or restore the last working integration. Extending a gateway timeout alone can keep workers occupied longer and make a busy site less reliable.

Verify the fix and know when to contact your provider

Back up before changing database queries or application code. Retest with a small safe example and check logs for completed work as well as errors. Ask the hosting provider for upstream timing evidence if you lack access; include the exact path, duration, timestamp and request identifier, with tokens removed.

Work through these checks in order

  1. Use the browser Network panel to note which request waits and its elapsed time. If it is a payment or order request, verify its final application status before trying again.
  2. Compare the request timestamp with slow application or database logs. Ask whether an external API call was waiting when the proxy reached its timeout; that dependency can fail independently of your host.
  3. Retest with a small nonfinancial operation after the specific slow task is corrected. Confirm that abandoned requests are not leaving background work or database locks behind.

Which tool can help?

Uptime & downtime calculator

DNS tools show one resolver’s public answers. Record explainers do not authenticate a message, and calculators do not monitor a server. Use the evidence alongside your provider’s logs.

Reference

Official technical documentation