Evaluate your SIEM
Get the guideOperational Visibility From AWS
Machine data holds hidden secrets that deliver true insights about the operational health of your AWS infrastructure. Learn more about operational visibility from AWS today!
October 5, 2017
When building a new application or microservice on AWS, there are several options for handling load balancing in front of the application. In this article, I’ll explain and compare two of the most common and robust options: The built-in AWS Elastic Load Balancer (ELB) or more commonly known as AWS ELB and NGINX’s load balancer.
Machine data holds hidden secrets that deliver true insights about the operational health of your AWS infrastructure. Learn more about operational visibility from AWS today!
When it comes to choices, choosing your load balancing option may not seem like an important choice, or even be that exciting to some. And it’s true that in most cases, either ELB or NGINX will work.
But there are important differences between them, and the decision you make for handling load balancing will set the tone for other infrastructure decisions going forward. It shapes the architecture of your apps and your deployment patterns. That’s why it’s worth taking time to evaluate both options before committing to one.
AWS defines ELB as follows:
“Elastic Load Balancing automatically distributes your incoming application traffic across multiple targets, such as EC2 instances. It monitors the health of registered targets and routes traffic only to the healthy targets. Elastic Load Balancing supports two types of load balancers: Application Load Balancers and Classic Load Balancers.”
source: AWS What is a Classic Load Balancer.
AWS ELB Benefits
These are the minimum costs associated with ELB in a highly available configuration that handles one connection per minute with two kilobytes of data transfer on AWS.
Application Load Balancer would cost $22.88 USD per month
Classic Load Balancer would cost $18.77 USD
The NGINX project describes NGINX as follows:
“NGINX [engine x] is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP proxy server, originally written by Igor Sysoev. For a long time, it has been running on many heavily loaded Russian sites, including Yandex, Mail.Ru, VK, and Rambler. According to Netcraft, NGINX served or proxied 29.10% of the busiest sites in June 2017.”
source: nginx Tech Blog.
These are the minimum costs associated with NGINX in a highly available configuration that handles one connection per minute with two kilobytes of data transfer on AWS.
The software is free, unless you chose to buy NGINX Plus, which starts at $2,500 USD per instance, but it handles high availability deployments seamlessly in addition to commercial support with service level agreements.
Two t1.micro instances sharing an Elastic IP ($0.012 per hour each) plus the data transfer (as much as $0.09 per GB) would cost $18.11 USD per month.
It’s worth noting that although this article compares the two products, in reality, they are often used together. For example, in many stacks, ELB handles public-facing IPs and SSL termination, and balances traffic between multiple NGINX nodes across availability zones, while the NGINX servers handle caching and passing traffic to the actual application/service layer via fpm or as a reverse proxy—so you don’t necessarily need to think of ELB and NGINX as an either-or choice. You may best be served by using both.
Features | ELB | NGINX Load Balancer |
---|---|---|
Commercial Support Available | Yes | Yes |
Cost | $0.025 per ELB-hour + $0.008 per GB data | Free |
Enforces High Availability by default? | Yes | No (Unless you use NGINX Plus) |
Traffic Protocol | TCP | TCP |
When singling one out, either ELB or NGINX are reasonable options, and the costs of each are similar when starting out. The main differentiator comes down to selecting whether you want to control the full stack, right down to the operating system, and take advantage of extra features like caching without adding more layers to the application. In that case, NGINX will be a better choice. Alternatively, if you want to simplify how much infrastructure you need to build and maintain by leveraging features that are built into AWS, ELB is your solution.
Reduce downtime and move from reactive to proactive monitoring.
Build, run, and secure modern applications and cloud infrastructures.
Start free trial