- Newest
- Most votes
- Most comments
You've identified an important distinction between these two settings on Application Load Balancers.
The connection idle timeout and HTTP client keepalive duration serve different purposes:
-
Connection idle timeout: This setting determines how long an inactive connection (where no data is being transferred) can remain open before the ALB closes it. The default is 60 seconds. If no data flows through an established connection for this duration, the ALB will terminate it.
-
HTTP client keepalive duration: This newer feature (released March 2024) specifies the maximum total lifetime of a persistent HTTP connection between a client and the ALB, regardless of activity. After this duration elapses, the ALB will accept one more request and then gracefully close the connection by sending either a "Connection: close" header (for HTTP 1.x) or a GOAWAY frame (for HTTP/2). The default is 3600 seconds (1 hour), and it can be set between 60 seconds and 7 days.
You're correct that if the connection idle timeout is set to 2 minutes, any connection that remains idle for that period will be closed, regardless of the HTTP client keepalive duration setting. The keepalive duration only comes into play for active connections that are regularly sending data.
The HTTP client keepalive duration is particularly useful for:
- Gracefully terminating connections during Blue/Green deployments or rollbacks
- Migrating legacy applications
- Evacuating Availability Zones using zonal shift
So while the idle timeout handles inactive connections, the keepalive duration provides an upper bound on how long even active persistent connections can remain open before being gracefully refreshed.
Sources
Edit attributes for your Application Load Balancer - Elastic Load Balancing
Application Load Balancer enables configuring HTTP client keepalive duration
Configure your Classic Load Balancer - Elastic Load Balancing
Think of this example
- Keep-alive duration = "client is willing to stay in a Zoom meeting for 2 hours."
- ALB idle timeout = "Zoom kicks you out after 2 minutes of silence."
No matter what the client wants, the server (ALB) ultimately controls the session’s lifetime.
Relevant content
- asked 4 years ago
- AWS OFFICIALUpdated 3 years ago
