AWS ALB · HTTP 504

AWS ALB 504: Target Response Timed Out

Trace ALB 504 to target connection or response delay. Inspect target response time, application queues, dependency latency, and idle-timeout settings.

Origin / Application

Decode a CDN or gateway error

Paste a captured HTTP response or enter a status and headers. Only the status and response headers are sent; common credential headers are filtered first.

Supports raw headers, full HTTP responses, JSON with status/statusCode and headers, cURL -v/-i response output, and HAR exports. HAR selects a server error first. cURL commands are never executed; request headers, response bodies, and common credential headers are excluded.

Diagnostic report

Error code / name

AWS_ALB_504_TARGET_TIMEOUT

Fault domain

Origin / Application

Why it happened

The load balancer did not receive a target response before its connection or idle timeout. A saturated worker pool, slow dependency, or network delay can keep the request open without returning bytes.

Actionable fixes

  1. Compare ALB target-response-time metrics with application traces and target connection logs.
  2. Find blocked workers, slow database calls, or downstream retries that hold the response open.
  3. Change the ALB idle timeout only after confirming the workload should take longer and clients support it.

Why this error happened

The load balancer did not receive a target response before its connection or idle timeout. A saturated worker pool, slow dependency, or network delay can keep the request open without returning bytes.

Actionable fixes

  1. Compare ALB target-response-time metrics with application traces and target connection logs.
  2. Find blocked workers, slow database calls, or downstream retries that hold the response open.
  3. Change the ALB idle timeout only after confirming the workload should take longer and clients support it.

Network failure point

Client -> ALB -> target receives request -> no response before idle timeout -> X 504

Verify origin directly via CLI

curl -sS -I -w 'connect=%{time_connect} starttransfer=%{time_starttransfer} total=%{time_total}\n' --max-time 120 https://app.example.com/health

Configuration fix

alb.tfhcl
resource "aws_lb" "app" {
  name                       = "app"
  load_balancer_type         = "application"
  idle_timeout               = 120
  enable_deletion_protection = true
}

Catch this failure before it becomes an outage

SteadyNode measures response latency from independent regions and alerts on rising target times, giving teams a lead before ALB idle timeouts turn into 504 errors.

No credit card required.

Start for free

Frequently asked questions

Is an ALB 504 always an application timeout?

No. Target connection problems and network delays can also prevent a response before the load balancer timeout.

Should I set a very long ALB idle timeout?

Use a value that matches expected requests and client limits. A longer timeout can tie up connections without fixing a slow dependency.

Cloudflare

Vercel and Netlify

AWS CloudFront and ALB

Fastly

Heroku and Render

Nginx and Envoy