Dutch Power - 26 maart 2024 - Henk Kras - Circular Plastics
Scaling Your Web Applications with AWS Elastic Beanstalk
1. Scaling Your Web Applications
with AWS Elastic Beanstalk
Randall Hunt
Feb 2017
2. Who am I?
• NASA, Amazon, SpaceX, Amazon
• Just a regular software engineer
• Email me: randhunt@amazon.com … but seriously someone should
email me. I’m bored.
• Follow me on twitter to see lambda in action: @jrhunt
• Thanks:
• Jeff Hoffman, Adhiraj Singh, Prahlad Rao for slides!
4. Developer Challenges
• Complexity of deploying code, provisioning and managing
infrastructure
• Expertise and time needed to manage and configure servers,
databases, load balancers, firewalls, and networks
• How to automate scaling infrastructure?
• Lack of consistency across teams.
5. Why Elastic Beanstalk?
AWS Elastic Beanstalk is an easy-to-use
service for deploying, scaling, and managing
web applications and services.
6. AWS Elastic Beanstalk vs. Do It Yourself
Your code
HTTP Server
Application Server
Language Interpreter
Operating System
Host
Elastic Beanstalk configures each EC2
instance in your environment with
the components necessary to run
applications for the selected
platform.
Focus on building your application
Provided by you
Provided and managed by AWS Elastic Beanstalk (EB)
7. Benefits
• Fast & simple
• to begin
Developer
productivity/agility
• Impossible to
outgrow
• Complete
resource control
No additional charge to use Elastic Beanstalk.
You pay only for underlying AWS resources (i.e., EC2 instances, S3, etc.)
16. Deployment Options
Environment Type Deployment category Method
All at Once*
Immutable (New)
Disabled*^
Immutable (New)
All at Once
Rolling*
Rolling with additional batch
Immutable
Disabled^
Rolling based on Health*
Rolling based on Time
Immutable
Single Instance
Load Balanced/Auto-Scaled
Application
Platform/Configuration
Application
Platform/Configuration
17. Application deployment options
Method Impact of failed deployment
Deploy
Time
Zero
Downtime
No DNS
Change
Rollback
process
Code
Deployed To
All at Once Downtime X Re-deploy Existing
instances
Rolling Single batch out of service. Any
successful batches prior to failure
running new application version
♦ Re-deploy Existing
instances
Rolling with
additional batch
Minimum if first batch fails,
otherwise similar to Rolling
♦ Re-deploy New &
existing
instances
Immutable Minimal Re-deploy New
instances
Blue/Green Minimal X Swap URL New
instances
Options available for both Single Instance and Load Balanced/Auto-Scaled Environments ♦ Varies depending on instance batch size
18. Managed Platform Update
• Configure your environment to automatically upgrade to the latest
version of a platform during a scheduled maintenance window.
• Permissions
• Maintenance Window
• Minor and Patch Updates
Key benefits:
• Automated Upgrades
• No/Minimal downtime
• No/Minimal impact on capacity
• Flexibility of manual updates
• Instance replacement
20. Auto Scaling
Min/Max instances
Availability Zones
Scaling cooldown
Triggers based scaling
Trigger measurement (CPU utilization,
network traffic, disk activity, instance health)
Trigger statistic
Measurement period
Breach duration
Thresholds
Breach scale increment
Time-based scaling
Name
Min/Max instance
Occurrence (One-time, Recurrent)
Recurrence (CRON expression- 30 8 * * 3)
21. Other tips
• Logs, Metrics, & Alarms
• Enable log rotation to automatically publish logs to S3.
• Understand metrics available for your environment and what they mean.
• Set up alarms to automatically monitor critical metrics and send notifications when metrics
are outside normal operating range.
• Enable Amazon Route 53 health checks and alarms
• Tag your environments
• Makes it easy to find resources belonging to a given environment.
• Can be used to monitor costs associated with a given environment and/or application.
• AWS Elastic Beanstalk automatically tags environments with:
• Environment Name
• Environment ID
22. Other tips
• Logs, Metrics, & Alarms
• Enable log rotation to automatically publish logs to S3.
• Understand metrics available for your environment and what they mean.
• Set up alarms to automatically monitor critical metrics and send notifications when metrics
are outside normal operating range.
• Enable Amazon Route 53 health checks and alarms
• Tag your environments
• Makes it easy to find resources belonging to a given environment.
• Can be used to monitor costs associated with a given environment and/or application.
• AWS Elastic Beanstalk automatically tags environments with:
• Environment Name
• Environment ID