---
# System prepended metadata

title: Query 25

---

The default Max Connection Duration time in AWS Application Load Balancer (ALB) is 4000 seconds. This is Connection idle timeout setting on ALB, which by default is 60 seconds, can be increased to 4000 seconds.
This means that if a connection is idle for more than 4000 seconds, the ALB will automatically close the connection.
ALBs in AWS are designed to automatically manage connections and handle incoming traffic. They provide features like connection draining and idle timeout, but there isn't a direct concept of "Max Connection Duration" that you can configure.

You can modify the Max Connection Duration time for your ALB using the AWS Management Console or the AWS CLI. To do this, follow these steps:
1. Log in to the AWS Management Console and navigate to the Application Load Balancers page.
2. Select the ALB that you want to modify.
3. Click on the "Configuration" tab.
4. Scroll down to the "Advanced" section.
5. Under "Connection settings", click on the ""Edit"" button next to ""Max connection duration"".
6. Enter the desired value for the Max Connection Duration time in seconds. You can enter a value between 1 and 31536000 (10 years).
7. Click "Save" to save your changes.

Alternatively, you can use the AWS CLI to modify the Max Connection Duration time. You can use the following command:
```
aws alb update-load-balancer --load-balancer-arn <arn:aws:elasticloadbalancer:region:account-id:load-balancer-name> --connection-settings ConnectionSettings=<max-connection-duration-seconds>
```
Replace `<arn:aws:elasticloadbalancer:region:account-id:load-balancer-name>` with the ARN of your ALB, and `<max-connection-duration-seconds>` with the desired value for the Max Connection Duration time in seconds.

For example:
```
aws alb update-load-balancer --load-balancer-arn arn:aws:elasticloadbalancer:us-west-2:123456789012:my-alb --connection-settings ConnectionSettings=7200
```
This command will set the Max Connection Duration time for the specified ALB to 7200 seconds (2 hour).