Keep alive timeout not being respected on Amazon ELB
Amazon's ELB (Elastic Load Balancer) has an undocumented (except on forums) 60-second timeout which will tear down the connection if no data was sent. Hacking around by sending whitespace every 55 seconds seems like it'll work until they make this configurable.
The load balancer timeout, which closes the connection, is now documented:
To configure the idle timeout setting for your load balancer
- Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
- In the navigation pane, under LOAD BALANCING, click Load Balancers.
- Select your load balancer.
- In the bottom pane, select the Description tab.
- Find Connection Settings, and then click (Edit).
- In the Configure Connection Settings dialog box, enter a value for Idle Timeout. The range for the idle timeout is 1 to 3,600 seconds.
- Click Save.
The timeout for inactive connections is mentioned in the health check troubleshooting section: http://docs.amazonwebservices.com/ElasticLoadBalancing/latest/DeveloperGuide/ts-elb-healthcheck.html