AWS documentation mentions the following:
To ensure that the load balancer is responsible for closing the connections to your instance, make sure that the value you set for the HTTP keep-alive time is greater than the idle timeout setting on your load balancer.
I am facing an issue where my ELB is firing ~40 requests (js,css,img) with each having KeepAlive enabled, it uses up all of my worker threads and blocks them for KeepAliveTimeout (which I set to be higher than ELB Timeout as suggested).
However, ELB doesn't close the connections when the page is done loading - they just sit there blocking the workers until they time out.
So here I am facing with 2 questions:
- Why ELB fires 40 different connections and doesn't just reuse the same one?
- Why doesn't ELB clean up the connections when it's done with them?