ALB: What will happen if I have too many connections that have to wait for idle timeout elapsed to close?

0
  1. I think that if I set the idle timeout of the ALB to be higher, it means that the time of 1 connection if there is nothing sent or received, the connection time will be longer. And the next connections will have to wait for the previous connections to be closed before they can reach to the target. And in this case, there will be impacts on query performance.

  2. Because ALB is used as a load balancer, Since the required LCU is automatically assigned in terms of the number of connections, etc., ALB itself may change the billing amount, but it is extremely unlikely that performance will deteriorate.

=> Question:

  1. In the above 2, which statement is right?
  2. And in the case that I have too many connections that have to wait for idle timeout elapsed to close, is there any impacts on the performance of the webserver?

Sorry for trouble you, but thank you!

asked 2 years ago347 views
2 Answers
2

Hi Yen Trinh,

I understand on your notes that you would like to set the idle timeout on your ALB to be higher and what impact it will have on the performance, will it affect billing and will the performance deteriorate.Please correct me if my understanding is wrong.

Firstly the load balancer by default set the idle timeout value to 60 seconds, that applies to its connections. If no data has been sent or received by the time that the idle timeout period elapses, the load balance closes the connection.

In recommendation you can configure the idle timeout of your application to larger than the idle timeout configured for the load balancer considering that the application closes the TCP connection to the load balancer ungracefully the load balancer might send a request to the application before it receives the packet indicating that the connection is closed.In that case the server refuses the request from the load balancer and then the load balancer sends an HTTP 502 Bad Gateway error to the application. You can use the link below for steps to set different timeout value using your console[1] or cli[2].

[1] https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html

[2]https://docs.aws.amazon.com/cli/latest/reference/elbv2/modify-load-balancer-attributes.html

I hope you find this information useful.

Winnie
answered 2 years ago
1
Accepted Answer

Hello, thanks for reaching out!

In addition to what Winnie clarified about configuring the idle time out, I wanted to address your questions. There is actually some truth to both of your original statements.

I think that if I set the idle timeout of the ALB to be higher, it means that the time of 1 connection if there is nothing sent or received, the connection time will be longer. And the next connections will have to wait for the previous connections to be closed before they can reach to the target. And in this case, there will be impacts on query performance.

If HTTP keep-alives are enabled in your application in order to maintain connections between the ALB and the targets, the ALB can actually re-use existing backend connections for new incoming requests without needing to wait for a previous connection to close after a completed request. If all existing backend connections are in use, the ALB will attempt to make a new connection for other new incoming requests.

Because ALB is used as a load balancer, Since the required LCU is automatically assigned in terms of the number of connections, etc., ALB itself may change the billing amount, but it is extremely unlikely that performance will deteriorate.

This is true, the billing amount you see will be dependent on charged LCUs, which are based on new connections, active connections, processed bytes, and rule evaluations. Performance will be dependent on the ALB's decisions to scale up or down based on the number of incoming requests, as well as your targets' ability to handle the amount of requests. You can see a previous answer here which provides some further detail on the ALBs ability to scale in response to incoming traffic.

AWS
SUPPORT ENGINEER
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions