Execution
Environments for Distributed
Computing
Scalability Study of web apps in AWS
EEDC
34330Master in Computer Architecture, Networks and Systems - CANS
Sergio Mendoza
2
Outline
Introduction
Common web application architectures
Going Large-Scale on AWS
Scalability Study
Conclusions3
Outline
Introduction– Scalability Context – Motivation
Common web application architectures
Going Large-Scale on AWS
Scalability Study
Conclusions4
Introduction
Scalability Context
1. You have an idea
2. You implement that idea
3. You want to share/sell that idea
5
Introduction
Scalability Context
1. You have an idea
2. You implement that idea
3. You want to share/sell that idea
6
Introduction
Scalability Context
1. You have an idea
2. You implement that idea
3. You want to share/sell that idea
• Will the project succeed?
• How many persons will use it?
• How many hardware will I need?
7
Introduction
Scalability Context
1. You have an idea
2. You implement that idea
3. You want to share/sell that idea
• Will the project succeed?
• How many persons will use it?
• How much hardware will I need?
• …
8
Introduction
Motivation
– Avoid financial risks
How will you avoid financial risks?
– With Cloud’s help
– Just paying for what I use
9
Outline
Introduction
Common web application architectures– Running on a Single Server
– Running a Separate DB & Media Server
– Implementing Load Balancing & Redundancy – Going Large-Scale
Going Large-Scale on AWS
Scalability Study
Conclusions10
Common web application architectures
Running on a Single ServerWeb application implemented in Django
11
Common web application architectures
Running a Separate DB & Media Server12
Common web application architectures
Implementing Load Balancing and Redundancy13
Common web application architectures
Going Large-Scale14
Outline
Introduction
Common web application architectures
Going Large-Scale on AWS– Think Large-Scale from the beginning – Principles of Elastic Cloud Architecture – AWS Large-Scale design
Scalability Study
Conclusions15
Going Large-Scale on AWS
Thinking Large-Scale
– Users can scale exponentially any time
– Your system must be prepared to handle it
16
Going Large-Scale on AWS
Thinking Large-Scale
– Users can scale exponentially any time
– Your system must be prepared to handle it
Why don’t think Large-Scale from the beginning?
(IAAS provider manage resources on-demand!!)
17
Principles of Elastic Cloud Architecture
The Web Application has to be…
– Resistant to reboot and re-launch
– Stateless– Installable into an AMI (Amazon Machine Images)
Web Server
18
Principles of Elastic Cloud Architecture
The Web Application has to be…
– Resistant to reboot and re-launch – Stateless
– Installable into an AMI (Amazon Machine Images)
Web Server User
19
Principles of Elastic Cloud Architecture
The Web Application has to be…
– Resistant to reboot and re-launch – Stateless
– Installable into an AMI (
Amazon Machine Images)• Other Linux (400)
• Ubuntu (262)
• Windows (78)
• Red Hat (36)
• Cent OS (33)
• OpenSolaris (19)
• Fedora (18)
• Amazon Linux (9)
• OpenSUSE (7)
• Debian (6)
• Gentoo (5)
Web Application
20
AWS Large-Scale design
Objective– Design scalable architecture in Amazon
21
AWS Large-Scale design
Rules to follow:1. Put as much as possible in AWS managed services 2. Put the rest in your own EC2 instances
AWS will take care of
scaling and availability!!!
22
AWS Large-Scale design
Rules to follow:1. Put as much as possible in AWS managed services 2. Put the rest in your own EC2 instances
AWS YOU will take care of
scaling and availability!!!
23
AWS Large-Scale design
Choosing the services…– Compute
• Amazon Elastic Compute Cloud (EC2)
• Amazon Elastic MapReduce
• Auto Scaling
• Elastic Load Balancing – Content Delivery
• Amazon CloudFront – Database
• Amazon Relational Database Service (RDS)
• Amazon DynamoDB
• Amazon SimpleDB
• Amazon ElastiCache – Deployment & Management
• AWS Identity and Access Management (IAM)
• Amazon CloudWatch
• AWS Elastic Beanstalk
• AWS CloudFormation
• Application Services
– Amazon CloudSearch
• Amazon Simple Workflow Service (SWF)
• Amazon Simple Queue Service (SQS)
• Amazon Simple Notification Service (SNS)
• Amazon Simple Email Service (SES) – Networking
• Amazon Route 53
• Amazon Virtual Private Cloud (VPC)
• AWS Direct Connect – Storage
• Amazon Simple Storage Service (S3)
• Amazon Elastic Block Store (EBS)
• AWS Import/Export
• AWS Storage Gateway
24
AWS Large-Scale design
AWS Elastic Compute Cloud (EC2):– Virtual Machine Instances
– Different instances can run the same image – Elastic capacity
– Reliable environment
25
AWS Large-Scale design
AWS Auto-Scaling:– Switches ON/OFF EC2 VM instances
– Configurable mininum/maximum number of instances – Scales Up&down
EC2 Instances EC2 Instances
26
AWS Large-Scale design
AWS Elastic Load Balancing – Setup the EC2 instances:• Manual attaching of EC2 instances
• Automatic attaching with Auto-Scaling
27
AWS Large-Scale design
AWS CloudWatch:– Monitores AWS (EC2, RDS, EBS,…) – Configurable
• Frequencies (every 1 min, 5 mins, …)
• Metrics (%CPU, DiskReadBytes, DiskWriteBytes…) – Statistics
– Configurable Alarms
28
AWS Large-Scale design
AWS Simple Storage Service (S3):– Scalable storage – Redundant storage – Download files by:
• HTTP/HTTPS
• Web Service (REST & SOAP)
• BitTorrent
– Serving static files from S3 is cheaper&faster than from EC2
29
AWS Large-Scale design
Large-Scale system on AWSAmazon EC2 Auto Scaling
Elastic Load Balancing Amazon RDS
Amazon CloudWatch Amazon S3
30
Outline
Introduction
Common web application architectures
Going Large-Scale on AWS
Scalability Study
Conclusions31
Studying Scalability
Testing the web application…
1. Load & performance tests with JMeter
• Web (HTTP, HTTPS)
• SOAP
• Database
2. Verify JMeter results
3. Verify CloudWatch statistics
4. Conclude how well Web Application scales
32
Studying Scalability
Suggestion: Don’t stress servers infinitely…
– Amazon resources are “infinite”!
– Your cash probably not!
33
Outline
Introduction
Common web application architectures
Going Large-Scale on AWS
Scalability Study
Conclusions34
Conclusions
The Cloud is for scalable Web Applications
Each Web Applications has a specific architecture
Adequate architecture pattern can save a lot of money
Storing/moving data could be more expensive than running EC2 instances
Be careful with AWS! Everything has a price!Execution
Environments for Distributed
Computing
Scalability Study of web apps in AWS
EEDC
34330Master in Computer Architecture, Networks and Systems - CANS
Sergio Mendoza