Professional Documents
Culture Documents
Solution (Step 1): Create a Queuing App before the Booking engine Efficiently Queue the concurrent visitors
Solution (Step 2) : Moderate and move the visitors waiting in Queuing app to Booking engine
Concurrency
HTTP/AJAX/REST requests
Total : 500+ Million requests in 6 hours Average :23k+ requests/sec Peak : 80K+ requests/sec
10
Queue efficiency
Allot unique Queue Numbers for visitors
Queue Number allotment on Fair Basis (As much possible) Reduce the wait time in Queue Number allotment process Reduce overall Queue wait time for the visitor
11
Load Volatility
Compute Peak utilization during Promos Wasted Capacity
12
IP Whitelisting
Public Cloud
IP Address of the source EC2 Instances needs to be whitelisted in 3rd party Services gateway
Booking engine needs EC2 IP Whitelisting for security Consecutive IP range needed
13
Variety of OS / Softwares
RedHat OS for Load Balancer , NoSQL and Queue Layer
15
Requirements
Elastic Infrastructure
Create the Infrastructure 2 hrs before the promo Tear down infrastructure 2 hrs after the promo Elastically expand the infra during the promo
Solution Architecture
17
Solution Architecture
Option 1: Single Queue ( Initial thought)
Booking Engine
18
Solution Architecture
Option 2: Parallel Queue ( Recommended)
Concurrent visitors
Queuing Application
Booking Engine
19
Request types
Customer Visit is a HTTP request to the Queuing Application Current Visitor Queue position is a AJAX call every X seconds to the Queuing Application
More Wait ~ More Calls
20
Amazon Web Services We had 4+ years Architecture experience in AWS It satisfied many customer requirements and challenges in this use case
21
Amazon Route 53
EC2 Instances on AWS VPC Subnet 1 Availability Zone 1 Users VPC Subnet 2 Availability Zone 2
Amazon VPC with Multi-AZ subnet configurations ( HA ) Amazon Route 53 for Managed DNS DNS RR algorithm at Route53
22
Amazon Route 53
M1.large
Elastic IP
EBS Volumes
M1.large
Elastic IP
23
Amazon Route 53
EBS Volumes
C1.Xlarge
Elastic IP
Web/App 2
Web/App 3
25
Amazon Route 53
Users
Web/App 1
Web/App 2
Web/App 3
EBS Volumes
m1.large
RabbitMQ
Availability Zone 1
VPC Subnet 1
27
28
1 HA Proxy
Components of Single Sector 1. One HAProxy 2. Three Web/App 3. One RabbitMQ 4. One BG Processor Node 5. Two Redis Sector is not an AWS term , it is 8KMiles term for Logical EC2 instance groups for this use case
Web/App 1
Web/App 2
Web/App 3 3
RabbitMQ 4
5 Redis Master
29
6
Processors
Redis Slave
Processors
Booking Engine
30
Sector 1
..
..
16
Scalability
AZ-1
Sector -1
Amazon Route 53
EC2 Instances EC2 Instances Amazon Virtual Private Cloud
AZ-2
Sector -3
EC2 Instances
EC2 Instances
Sector -2
Sector -4
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
VPC Subnet 1
VPC Subnet 2
Availability Zone 1
Availability Zone 2
Scalability
New sectors containing LB, Web, Queue , NoSQL , BG stack will be created automatically depending upon the load Same AZ or multi-AZ can be specified for the creation CloudWatch Custom parameters used Automated Java Programs were used for the sector creation No Manual intervention needed
34
AZ-2
Amazon Route 53
EC2 Instances EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
VPC Subnet 1
VPC Subnet 2
Availability Zone 1
Availability Zone 2
36
AZ-2
Sector -3
Sector -2
Sector -5
EC2 Instances
EC2 Instances
Sector -6
Sector -4
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
VPC Subnet 1
VPC Subnet 2
Availability Zone 1
Availability Zone 2
38
AZ-2
Amazon Route 53
EC2 Instances EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
EC2 Instances
VPC Subnet 1
VPC Subnet 2
Availability Zone 1
Availability Zone 2
40
Log Analytics
HDFS Cluster
1
EC2 Instances S3 Bucket with logs
3
RDS MySQL
Elastic Map Reduce Jobs
Redis , Web/App , HAProxy , RBQ logs synced to S3 Elastic MapReduce Jobs to process / analyze the logs Processed result moved to RDS MySQL for reports/ Visualizations
41
Monitoring
Nagios + Puppet (combined) for Auto scaled monitoring infra and deployment
CloudWatch Custom metrics / Tomcat Valve/ Automated Java Programs for EC2
42
Backup
No backups -> only Syncs to S3 Golden AMIs snapshot to S3 Periodic Sync of data between EC2 and S3 Periodic log Sync between Web/App to S3
43
Infrastructure
Amazon Route53 Amazon VPC Public , Private subnet 150+ EC2 instances , 2 AZs , 1 Region 70+ Elastic IPs 200+ EBS S3 buckets Suite of monitoring tools 1 Puppet Server Amazon CloudWatch Amazon CloudFront
44
Infrastructure Elasticity
Entire Infra created 2 hrs before promo Tear down infra 2 hrs after promo ~30 Mins to launch the infra in AWS ~45 Mins to tear down Automated Failure detection/rectification Automated Programs for Infra creation
45
Infrastructure Cost
~10K USD per promo Not inclusive of Data charges Unthinkable Savings Visitor experience was good More Bookings per Promo
46
Q&A
8KMiles harish@8kmiles.com http://in.linkedin.com/in/harishganesan www.twitter.com/harish11g harish11g@gmail.com http://harish11g.blogspot.com
49