← All status codes
504

Gateway Timeout

The gateway server didn't get a response from the upstream server in time. Your app is too slow or has hung. If you're seeing this in monitoring, the problem is usually in your application, not the gateway.

COMMON CAUSES

Application hung or deadlocked
Slow database query blocking the response
Upstream service timeout
Network issues between proxy and application
DNS resolution timeout

HOW TO FIX IT

Check for slow queries or external API calls in your application
Increase timeout settings on the proxy (but fix the root cause first)
Check if the application is deadlocked
Verify network connectivity between the proxy and upstream

What this means for monitoring

504 means your app is alive but too slow. Look at response time trends in your monitoring — 504s are usually preceded by gradually increasing latency.

Related status codes

5xx Server Error

Get alerted when your endpoints return unexpected status codes.

Larm checks your HTTP endpoints from multiple global locations and alerts you when they return status codes outside your expected range.