How many xs can you find in:
Q: What is the advantage of having ELB infront of your NGINX servers? Ive looked into a lot of back end setups on Amazon Web Services, especially that of Instagrams. On their Instgram Engineering Blog they mentioned how they have an Elastic Load Balancer in front of their three NGINX servers which is front of their app servers which run django/Gunicorn, why is that (is it for buffering? caching?)
If that is the case, how can one connect those NGINX servers to the django/gunicorn app servers?

A: Glancing at the Instagram post, I dont believe theyre using Nginx for buffering or caching (although I could be wrong).  I use something similar but with HAProxy instead of Nginx.
Some of the reasons why we took this approach:


*

*Nginx and HAProxy operate at layer 7, whereas ELB is later 4.  If you need layer 7 services, ELB cant provide it

*Graceful connection termination when health checks fail.  The ELB can continue passing traffic to HAProxy/Nginx while traffic is bled off of the out-of-service instance.  See https://forums.aws.amazon.com/message.jspa?messageID=231571

*You can scale out the load balancing layer live if necessary

*Better metrics about traffic and performance of each instance behind the HAProxy/Nginx layer

*ELB can detect when an HAProxy instance has failed and stop sending traffic to it


A: A few points I can think of:


*

*It distributes requests and monitors health of the servers, so if one of your nginx servers crashes the site continues working flawlessly.

*Amazon does some denial-of-service mitigation on their end. If you handle load balancing yourself, youre going to pay for all of the traffic hitting them. If Amazon blocks some attacks pointed at your ELB, youre not paying for that part.

*Allows you to lock the nginx servers security groups to just the ELB, making them more secure than having them open to the public Internet.


user
I counted fifteen "x"s in that text.
assistant