EEDC Execution Environments for Distributed Computing 34330 Master in Computer Architecture, Networks and Systems - CANS Scalability Study of web apps in AWS Sergio Mendoza sergio.mendoza@est.fib.upc.edu
Outline Introduction Common web application architectures Going Large-Scale on AWS Scalability Study Conclusions 2
Outline Introduction Scalability Context Motivation Common web application architectures Going Large-Scale on AWS Scalability Study Conclusions 3
Introduction Scalability Context 1. You have an idea 2. You implement that idea 3. You want to share/sell that idea 4
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 Will the project succeed? How many persons will use it? How many hardware will I need? 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 much hardware will I need? 7
Introduction Motivation Avoid financial risks How will you avoid financial risks? With Cloud s help Just paying for what I use 8
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 Conclusions 9
Common web application architectures Running on a Single Server Web application implemented in Django 10
Common web application architectures Running a Separate DB & Media Server 11
Common web application architectures Implementing Load Balancing and Redundancy 12
Common web application architectures Going Large-Scale 13
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 Conclusions 14
Going Large-Scale on AWS Thinking Large-Scale Users can scale exponentially any time Your system must be prepared to handle it 15
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!!) 16
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 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 User 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) Other Linux (400) Ubuntu (262) Windows (78) Red Hat (36) Cent OS (33) OpenSolaris (19) Fedora (18) Amazon Linux (9) Web Application OpenSUSE (7) Debian (6) Gentoo (5) 19
AWS Large-Scale design Objective Design scalable architecture in Amazon 20
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!!! 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 YOU will take care of scaling and availability!!! 22
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 23
AWS Large-Scale design AWS Elastic Compute Cloud (EC2): Virtual Machine Instances Different instances can run the same image Elastic capacity Reliable environment 24
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 25
AWS Large-Scale design AWS Elastic Load Balancing Setup the EC2 instances: Manual attaching of EC2 instances Automatic attaching with Auto-Scaling 26
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 27
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 28
AWS Large-Scale design Large-Scale system on AWS Amazon EC2 Auto Scaling Elastic Load Balancing Amazon RDS Amazon CloudWatch Amazon S3 29
Outline Introduction Common web application architectures Going Large-Scale on AWS Scalability Study Conclusions 30
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 31
Studying Scalability Suggestion: Don t stress servers infinitely Amazon resources are infinite! Your cash probably not! 32
Outline Introduction Common web application architectures Going Large-Scale on AWS Scalability Study Conclusions 33
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! 34
EEDC Execution Environments for Distributed Computing 34330 Master in Computer Architecture, Networks and Systems - CANS Scalability Study of web apps in AWS Sergio Mendoza sergio.mendoza@est.fib.upc.edu