Skip to main content

Command Palette

Search for a command to run...

AWS ELB & ASG Service

Published
β€’3 min read
AWS ELB & ASG Service
K
πŸ‘‹ Hi, I'm Khushi Dubey, a passionate final year BCA student diving deep into the world of Cloud & DevOps. My journey is focused on the intersection of cloud technologies and cutting-edge DevOps methodologies to drive innovation and transformation. 🌍 Here’s a snapshot of who I am: πŸš€ Aspiring Cloud/DevOps Professional: Passionate about streamlining processes, automating workflows, and optimizing cloud infrastructures. πŸ’» Tech Enthusiast: Constantly exploring new tools, trends, and techniques in cloud computing and DevOps engineering. 🎯 Problem-Solver: Dedicated to finding practical and scalable solutions to real-world challenges. ✍️ Lifelong Learner: Continuously improving my skill set to keep pace with evolving technologies and industry demands. 🌐 Collaborator: Believer in the power of teamwork and open knowledge sharing to build a thriving tech community. πŸ“š Follow my journey as I share insights, tutorials, and hands-on experiences from my Cloud and DevOps

1. What is an Elastic Load Balancer (ELB)?

Imagine you have a restaurant with a lot of customers. If there is only one waiter, the service will be slow. But if multiple waiters share the work, customers get faster service. Similarly, an Elastic Load Balancer (ELB) distributes traffic across multiple servers to ensure no single server gets overloaded.

How ELB Works:

  • Receives incoming requests from users.

  • Distributes the requests evenly to multiple servers.

  • Ensures traffic is sent to healthy (working) servers.

  • Improves application availability and performance.

Types of Load Balancers

AWS provides three types of Load Balancers:

  1. Application Load Balancer (ALB) – Best for websites and applications running on HTTP/HTTPS.

  2. Network Load** Balancer (NLB)** – Best for applications needing high performance and low latencad

  3. Classic Load Balancer (CLB) – Older version, mainly for applications using EC2 instances.


2. What is an Auto Scaling Group (ASG)?

Now imagine your restaurant gets busier during weekends. You hire extra staff when needed and reduce staff on quieter days. Auto Scaling Group (ASG) does the same for your servers.

How ASG Works:

  • Monitors traffic and server load.

  • Automatically adds more servers when demand increases.

  • Removes extra servers when demand decreases.

  • Ensures there is always a minimum number of servers running.

Key Benefits of ASG:

  • Cost-Efficient: You only pay for the resources you use.

  • Improved Performance: Your application stays fast even during high traffic.

  • Fault Tolerance: If a server fails, ASG replaces it with a new one.


3. How ELB and ASG Work Together

  1. A user visits your website.

  2. The ELB receives the request and forwards it to one of the available servers.

  3. ASG ensures there are enough servers to handle the traffic.

  4. If traffic increases, ASG adds more servers.

  5. If traffic decreases, ASG removes extra servers.

  6. ELB continues to distribute traffic to healthy servers.


4. Step-by-Step Guide to Setting Up ELB and ASG

Step 1: Create an ELB

  1. Go to the AWS Management Console.

  2. Open the EC2 service and select Load Balancers.

  3. Click Create Load Balancer.

  4. Choose the type of load balancer (Application, Network, or Classic).

  5. Configure settings like name, security group, and target group.

  6. Register instances (servers) and review the settings.

  7. Click Create to finish.

Step 2: Create an Auto Scaling Group

  1. Go to the EC2 service and select Auto Scaling Groups.

  2. Click Create Auto Scaling Group.

  3. Select a Launch Template or create one.

  4. Define the desired, minimum, and maximum number of instances.

  5. Attach the Auto Scaling Group to the Load Balancer.

  6. Set up scaling policies (increase or decrease instances based on demand).

  7. Review and click Create.

Step 3: Test Your Setup

  • Visit your website and check if the traffic is balanced.

  • Simulate high traffic and see if ASG adds new servers.

  • Shut down a server and ensure ASG replaces it automatically.


5. Conclusion

AWS Elastic Load Balancer (ELB) and Auto Scaling Group (ASG) work together to improve application performance, ensure high availability, and reduce costs. ELB distributes traffic, while ASG automatically adjusts the number of servers based on demand.

With this setup, your application will always be fast, reliable, and cost-efficient. πŸš€


Linkedin: https://www.linkedin.com/in/khushi-dubey-6036a2305

Thank You!