HTTP 504 Gateway Timeout
The server did not receive a timely response from an upstream server while acting as a gateway.
Gateway Timeout
The server did not receive a timely response from an upstream server while acting as a gateway.
What Causes HTTP 504?
- Upstream server took too long to respond
- Database query timeout exceeded
- Slow third-party API integration
- Serverless function cold start delay
- Network congestion between services
Code Examples
See how HTTP 504 responses look in different programming languages and tools.
curl -X GET https://api.example.com/slow-resource
# Response: 504 Gateway Timeout
# The upstream server did not respond in timeHow to Fix HTTP 504
- Increase timeout values on the proxy or load balancer
- Optimize slow database queries with proper indexes
- Implement caching for slow endpoints
- Move heavy processing to background jobs
- Use async processing for long-running operations
- Check your API response times with our API response checker
Related Status Codes
The server encountered an unexpected condition that prevented it from fulfilling the request.
The server received an invalid response from an upstream server while acting as a gateway.
The server is temporarily unable to handle the request due to maintenance or overload.
Rate limit exceeded. The client has sent too many requests in a given time period.
Test Your APIs
Frequently Asked Questions
What does HTTP 504 mean?
The server did not receive a timely response from an upstream server while acting as a gateway.
What causes HTTP 504?
Upstream server took too long to respond. Database query timeout exceeded. Slow third-party API integration. Serverless function cold start delay. Network congestion between services
How to fix HTTP 504?
Increase timeout values on the proxy or load balancer. Optimize slow database queries with proper indexes. Implement caching for slow endpoints. Move heavy processing to background jobs. Use async processing for long-running operations. Check your API response times with our API response checker