I get intermittent but regular 503 errors ("Service Unavailable: Back-end server at capacity") from a site consisting of 2 t2.medium instances per ELB. None of them are under especially heavy load, and all observations seem normal.
AWS documents here: http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/ts-elb-error-message.html let's say that the potential reason is the wrong timeout settings between ELB and EC2: "set time- keep-alive out equal to or equal to the idle timeout settings of your load balancer "
Apache conf on EC2s has:
- Keepalive on
- MaxKeepAliveRequests 100
- KeepAliveTimeout 5
The wait timeout on the load balancer is 60 seconds.
It would seem that this was the reason, but I am not sure about the correction. Increasing Apache's KeepAliveTimeout is not - I understand - usually recommended, and I'm equally not sure that reducing latency on ELB will have website performance.
What is the recommended approach? How can I get an idea of what ideal settings for my settings and the type of traffic (currently about 30-50 requests / min) it is dealing with?
amazon-web-services amazon-ec2 amazon-elb
Wintermute
source share