Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure keep-alive for EC2 instance

I have a Django app running on a python instance with Nginx as the webserver.

I'm getting a 60 second timeout for one of my operations. According to the docs, you want to increase the load balancer's idle timeout above the default 60 seconds (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/application-load-balancers.html)

It also says:

we recommend that you enable the HTTP keep-alive option for your EC2 instances. You can enable HTTP keep-alive in the web server settings for your EC2 instances

Well I'm not sure how to do this or where that setting is. Can anyone point me to where the keep-alive option is?

like image 893
AlxVallejo Avatar asked Jun 05 '19 17:06

AlxVallejo


People also ask

How do I keep my AWS session alive?

In the navigation pane, choose Session Manager. Choose the Preferences tab, and then choose Edit. Specify the amount of time to allow a user to be inactive before a session ends in the minutes field under Idle session timeout. Choose Save.

What is AWS ELB idle timeout?

Elastic Load Balancing (ELB) now offers support for configurable idle timeouts. This setting allows you to specify the length of time that a connection should remain open while in an idle state. Until now, ELB provided a default idle timeout of 60 seconds for all load balancers.


1 Answers

I'm running into the same issue now and have come to the conclusion that it's just a poorly worded bit of docco and as Mark B suggests in his comment, it's referring to setting the Keep-Alive header from your nginx/apache webserver config rather than on the ec2 instance itself.

like image 65
Shane Nayler Avatar answered Sep 19 '22 13:09

Shane Nayler