How to you optimize management of 500+ AWS servers? In this presentation I share my experiences using Amazon Web Servers covering techniques for webscale. Learn how to optimized your cost, handle security, automate and be prepared for handling failure.
2. SCOPE
Consulting experiences with AWS
Several different clients
Largest - 500+ servers
Some 40-50+ servers
Some 2-5 servers
LAMP/RoR/RDS/Windows
EffectiveMySQL.com - Performance, Scalability & Business Continuity
3. ABOUT MySELF
Ronald BRADFORD
Enterprise Data Architecture
24 years with RDBMS - 13 years with MySQL
Using AWS 4+ years
Published author - 4 books
Accomplished presenter - 8 years
Work at Independent MySQL Consultant
EffectiveMySQL.com - Performance, Scalability & Business Continuity
6. ABOUT AWS
AMAZON WEB SERVICES
30+
Many, many products and
features
EC2, S3, EBS, ELB, RDS,
EMR,VPC, CDN, SWF,
SQS, SES, SNS, IAM, ...
Mechanical Turk
Flexible Payments Service (FPS)
EffectiveMySQL.com - Performance, Scalability & Business Continuity
7. AWS CONSOLE
May 2013
Aug 2012
EffectiveMySQL.com - Performance, Scalability & Business Continuity
9. Announcements
Product Announcements
Examples in presentation
http://aws.amazon.com/about-aws/newsletters/
Pricing Changes
New instance types
New features (e.g. IOPS)
New Products (e.g. Redshift/ OpsWorks)
EffectiveMySQL.com - Performance, Scalability & Business Continuity
11. Product growth
When I started
No RDS, In-memory Cache,
DynamoDB, Glacier
No Elastic Beanstalk, OpsWorks
No management console
EffectiveMySQL.com - Performance, Scalability & Business Continuity
19. $
Instance Prices
Large Instance (m1.large)
On Demand
$0.24
Reserved
$0.136 *
+ Annual contract ( +$ 0.043)
Spot
$0.03+ *
Can be terminated (budget)
Per hour investment
EffectiveMySQL.com - Performance, Scalability & Business Continuity
20. $
Instance Prices
Large Instance (m1.large)
On Demand
$0.24
Reserved
$0.136 *
+ Annual contract ( +$ 0.043)
Spot
$0.03+ *
Can be terminated (budget)
Per hour investment
EffectiveMySQL.com - Performance, Scalability & Business Continuity
21. $
Instance Prices
Large Instance (m1.large)
On Demand
$0.24
Reserved
$0.136 *
+ Annual contract ( +$ 0.043)
Spot
$0.03+ *
Can be terminated (budget)
Per hour investment
EffectiveMySQL.com - Performance, Scalability & Business Continuity
22. $
Instance Prices
Large Instance (m1.large)
Was $0.32 til 11/19/2012
Was $0.26 til 1/16/2013
On Demand
$0.24
Reserved
$0.136 *
+ Annual contract ( +$ 0.043)
Spot
$0.03+ *
Can be terminated (budget)
Light/Medium/Heavy utilization
Per hour investment
40% saving
up to 80+% saving
EffectiveMySQL.com - Performance, Scalability & Business Continuity
23. SPOT EXAMPLE
One hour (24 cents)
1 x Large - Reserved
7.5G, 4 CPUs, 850G
8 x Large - Spot
or
1 x Eight Extra Large - Spot (cc2.8xlarge)
60G, 88 CPUs, 3.4T,10Gb NIC
EffectiveMySQL.com - Performance, Scalability & Business Continuity
24. SPOT EXAMPLE
One hour (24 cents)
1 x Large - Reserved
7.5G, 4 CPUs, 850G
8 x Large - Spot
price has changed 3 times
in 8 months
or
1 x Eight Extra Large - Spot (cc2.8xlarge)
60G, 88 CPUs, 3.4T,10Gb NIC
EffectiveMySQL.com - Performance, Scalability & Business Continuity
27. Using SPOTS
Is your volume predicable?
Splitting on-demand/spot instances
Can work be done asynchronously?
i.e. can be queued
Is work restartable?
EffectiveMySQL.com - Performance, Scalability & Business Continuity
28. Using SPOTS
Is your volume predicable?
Splitting on-demand/spot instances
Can work be done asynchronously?
i.e. can be queued
Is work restartable?
WARNING: Not for
general workloads
EffectiveMySQL.com - Performance, Scalability & Business Continuity
29. Instance sizes
Evaluating the right instance size
What is your bottleneck?
EffectiveMySQL.com - Performance, Scalability & Business Continuity
30. Instance sizes
Evaluating the right instance size
What is your bottleneck?
Developing a tool to
recommend savings
EffectiveMySQL.com - Performance, Scalability & Business Continuity
31. TRUSTED ADVISOR
AWS now offers Trusted Advisor
Recommendations to save money
Improve performance
Close security problems
http://aws.amazon.com/premiumsupport/trustedadvisor/
EffectiveMySQL.com - Performance, Scalability & Business Continuity
33. OTHER COST SAvings
CDN - Cloudfront
Bandwidth
http://aws.amazon.com/cloudfront/
Reduce response size (e.g. 10%)
Storage
old EBS snapshots
Remove unused instances
NEW: Announced 1/9/2103
CloudWatch Alarm Actions
EffectiveMySQL.com - Performance, Scalability & Business Continuity
34. 3
Web Scale
(hint: no humans)
EffectiveMySQL.com - Performance, Scalability & Business Continuity
35. ABOUT WEB SCALE
GUI = #FAIL
CLI is necessary
Manual CLI use is slow
Automation in crucial
Parallel
EffectiveMySQL.com - Performance, Scalability & Business Continuity
36. AWS CLI’s
Different for EC2, ELB, RDS etc
Updated frequently (i.e. monthly)
$ git clone https://github.com/ronaldbradford/aws.git
$ cd aws/scripts
$ ./aws_cli_configure.sh
EffectiveMySQL.com - Performance, Scalability & Business Continuity
37. AWS CLI’s
Different for EC2, ELB, RDS etc
Updated frequently (i.e. monthly)
Simple helper
$ git clone https://github.com/ronaldbradford/aws.git
$ cd aws/scripts
$ ./aws_cli_configure.sh
EffectiveMySQL.com - Performance, Scalability & Business Continuity
39. Identifiers
Access Key ID
Private Access Key
X.509 Certificates (2 of)
Private
(*)
& Public
AWS Account ID
Canonical User ID
https://portal.aws.amazon.com/gp/aws/securityCredentials
EffectiveMySQL.com - Performance, Scalability & Business Continuity
40. CLI Examples
Launch Script
Demand/Spot or switch between
Verify SSH
Verify MySQL
Verify replication in sync
Add to ELB
EffectiveMySQL.com - Performance, Scalability & Business Continuity
44. SECURITY
Do not give away the front door keys
Do not open all the windows
EffectiveMySQL.com - Performance, Scalability & Business Continuity
45. SECURITY OPTIONS
Keypairs
Learn the different benefits
Security groups
Virtual Private Cloud (VPC)
Identity and Access Management (IAM)
Multi-factor authentication
http://aws.amazon.com/mfa/
EffectiveMySQL.com - Performance, Scalability & Business Continuity
46. SECURITY TIPS
Restrict open access to port 80/443
Jump box
Restrict IP Access
Additional authentication
Per user SSH authentication
Do not use keypair
EffectiveMySQL.com - Performance, Scalability & Business Continuity
47. products
Many Others (AWS Summit 2013)
Cloudaware
Dome9
Enstratius
SafeNet
AlertLogic
EffectiveMySQL.com - Performance, Scalability & Business Continuity
52. Instrumentation
What is important to you?
All server stats
Sampling issues
EffectiveMySQL.com - Performance, Scalability & Business Continuity
53. Instrumentation
What is important to you?
All server stats
Sampling issues
Deceiving averages (frequency)
EffectiveMySQL.com - Performance, Scalability & Business Continuity
54. REQUESTS PER SEC
5 second averages, not 1 minute sample
https://github.com/ronaldbradford/reqstat
EffectiveMySQL.com - Performance, Scalability & Business Continuity
55. REQUESTS PER SEC
5 second averages, not 1 minute sample
https://github.com/ronaldbradford/reqstat
EffectiveMySQL.com - Performance, Scalability & Business Continuity
56. REQUESTS PER SEC
-1,500 RPS
5 second averages, not 1 minute sample
https://github.com/ronaldbradford/reqstat
EffectiveMySQL.com - Performance, Scalability & Business Continuity
70. CONCLUSION
Cost Management (saving money)
CLI automation
Instrumentation (inc business metrics)
EffectiveMySQL.com - Performance, Scalability & Business Continuity
71. CONCLUSION
Cost Management (saving money)
CLI automation
Instrumentation (inc business metrics)
Distribute your application & data
EffectiveMySQL.com - Performance, Scalability & Business Continuity
72. CONCLUSION
Cost Management (saving money)
CLI automation
Instrumentation (inc business metrics)
Distribute your application & data
Disaster is inevitable
EffectiveMySQL.com - Performance, Scalability & Business Continuity
73. AWS for FREE
http://aws.amazon.com/free/
Free EC2 t1.micro for a year
Free RDS t1.micro for a year
S3, DynamoDB, SimpleDB, +++
EffectiveMySQL.com - Performance, Scalability & Business Continuity