Optimizing Your Cloud Applications in RightScale
-
Upload
rightscale -
Category
Technology
-
view
1.041 -
download
3
description
Transcript of Optimizing Your Cloud Applications in RightScale
![Page 1: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/1.jpg)
1
Optimizing Your Cloud Applications in RightScale
Rafael H. Saavedra
VP of Engineering, RightScale
Watch the video of this presentation
![Page 2: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/2.jpg)
2
Real Cloud Experience. Shared.
# 2
Agenda• Introduction• 3-tier application architecture• Vertical & horizontal scaling• RightScale monitoring and cluster graphs• New Relic RPM• Support for optimizing DB performance• Load testing
![Page 3: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/3.jpg)
3
Real Cloud Experience. Shared.
# 3
• Multi-tenancy• Shared resource pooling• Geo-distribution and ubiquitous network access• Service oriented• Dynamic resource provisioning• Self-organizing• Utility based pricing
Cloud computing characteristics
![Page 4: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/4.jpg)
4
Real Cloud Experience. Shared.
# 4
• No upfront investment• Lowering operating costs• Highly scalable• Easy access• Reduces business risk and maintenance costs• Enables process automation
Cloud computing advantages
![Page 5: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/5.jpg)
5
Real Cloud Experience. Shared.
# 5
3-tier application architecture• Load balancers• An array of application servers• Master-slave
![Page 6: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/6.jpg)
6
Optimizing Your Cloud Applications in RightScale
Vertical & Horizontal Scaling
![Page 7: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/7.jpg)
7
Real Cloud Experience. Shared.
# 7
• Instance size (vertical scaling)
• Instance autoscaling (horizontal scaling)• Server arrays
• RightScale support for performance optimization• ServerTemplates are configured to capture performance data• Collectd RightScripts
• Hardware & OS monitoring data• Specialized plugins – MySQL, HAProxy, Apache, NgInx, IIS, etc
• Monitoring graphs: individual, cluster, stacked, heat maps• Alerts & escalations
• New Relic RPM
Cloud performance optimization
![Page 8: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/8.jpg)
8
Real Cloud Experience. Shared.
# 8
• Compute units vs memory
Scaling up – spectrum of instance sizes
0.0 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.00.5
5.0
50.0
500.0
t1.micro
m1.small
m1.large m1.xlarge
m2.xlarge
m2.2xlarge
m2.4xlarge
c1.medium
c1.xlarge
cc1/cg1.4xlarge
Compute Units
Mem
ory
(G
B)
High Performance Computing
Test & Dev
Scalable Applications
![Page 9: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/9.jpg)
9
Real Cloud Experience. Shared.
# 9
Server arrays provide horizontal scaling
![Page 10: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/10.jpg)
10
Real Cloud Experience. Shared.
# 10
• The array scales up or down based on performance votes• Tags allow scaling on an arbitrary decision set• Decision threshold controls reaction time• Sleep time allows new resources to have an impact• Scaling can be time dependent• Detailed setup instructions: http://bit.ly/c1oLr2
• Fast response to changes in load conditions using alerts
• Allocation of servers to availability zones based on weights
• Deployment-based so configuration is consistent
• Arrays can be pre-scaled to support anticipated demand
Server arrays provide horizontal scaling
![Page 11: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/11.jpg)
11
Optimizing Your Cloud Applications in RightScale
Monitoring & Cluster Graphswith RightScale
![Page 12: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/12.jpg)
12
Real Cloud Experience. Shared.
# 12
Server monitoring graphs
![Page 13: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/13.jpg)
13
Real Cloud Experience. Shared.
# 13
Cluster monitoring• Individual graphs
• Good for a dozen servers• Displays all standard graphs with full detail
• Stacked graphs• Displays the contribution of many servers to a total• Great to see the sum and variability of activity in a cluster• Difficult to make out individual servers• Examples: requests/sec, cpu busy cycles, I/O bytes/sec
• Heat maps• Displays a bar for each server• Great to see uneven distribution across servers• Great to quickly spot performance problems across many servers• Difficult to read absolute values or see the total cluster activity
![Page 14: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/14.jpg)
14
Real Cloud Experience. Shared.
# 14
Cluster monitoring architecture• Architecture
• Monitoring front-end serverspull data from storage servers
• Up to 100 servers on one graph(to be increased)
your servers
monitoringstorageservers
monitoringfront-endservers
![Page 15: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/15.jpg)
15
Real Cloud Experience. Shared.
# 15
Cluster monitoring• Current cluster monitoring: one graph per server
![Page 16: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/16.jpg)
16
Real Cloud Experience. Shared.
# 16
Stacked graphs• Each color band shows contribution of one server• Servers are stacked on top of one another
![Page 17: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/17.jpg)
17
Real Cloud Experience. Shared.
# 17
Heat maps• Each horizontal strip shows one server• The color shows how “hot” the server is running
![Page 18: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/18.jpg)
18
Real Cloud Experience. Shared.
# 18
Heat map with 100 servers
![Page 19: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/19.jpg)
19
Real Cloud Experience. Shared.
# 19
Stacked graph of the same 100 servers
![Page 20: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/20.jpg)
20
Optimizing Your Cloud Applications in RightScale
Application Performance Analytics with New Relic
![Page 21: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/21.jpg)
21
Real Cloud Experience. Shared.
# 21
• Real-Time App Performance Analytics
• Supports Ruby, PHP, Java & .Net
• SQL & NoSQL performance
• Web transaction tracing
• Performance notifications
• Availability monitoring
• Scalability analysis
New Relic RPM
![Page 22: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/22.jpg)
22
Real Cloud Experience. Shared.
# 22
New Relic RPM• Direct access from RightScale dashboard
![Page 23: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/23.jpg)
23
Real Cloud Experience. Shared.
# 23
New Relic RPM• Historical statistics over a period of time
![Page 24: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/24.jpg)
24
Real Cloud Experience. Shared.
# 24
New Relic RPM• Distribution of the most time consuming requests
![Page 25: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/25.jpg)
25
Real Cloud Experience. Shared.
# 25
New Relic RPM• Statistics about response times from different countries
![Page 26: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/26.jpg)
26
Real Cloud Experience. Shared.
# 26
New Relic RPM• Detailed response times by browser
![Page 27: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/27.jpg)
27
Real Cloud Experience. Shared.
# 27
• An expensive query
• The N+1 query problem
New Relic RPM – 2 Examples
![Page 28: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/28.jpg)
28
Optimizing Your Cloud Applications in RightScale
Optimizing Database Performance
![Page 29: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/29.jpg)
29
Real Cloud Experience. Shared.
# 29
Optimizing DB performance• RightScale MySQL ServerTemplates
• Configuration files tailored to instance size• innodb_buffer_pool_size• key_buffer_size• thread_size• sort_buffer_size
• The never ending task of identifying current bottlenecks• Disk seeks• Performance of disk operations• Scale up when working set cannot fit in memory – avoid active swapping• Constant monitoring of performance graphs, logs and query
• Schema considerations
![Page 30: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/30.jpg)
30
Real Cloud Experience. Shared.
# 30
Schema considerations• Lookups need to be indexed
• Sorting requires an index
• Joins need to be done on indices• Become slower as tables grow
• Compounded indices should be used consistently
• Do not abuse indices• Each index requires a disk write
• Compact tables if they become fragmented• Deleted rows do not remove the corresponding index entries
![Page 31: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/31.jpg)
31
Real Cloud Experience. Shared.
# 31
Monitoring DB performance• Standard collectd statistics
• User vs wait time (disk operations)• Performance of disk operations• Scale up when working set cannot fit in memory
• MySQL collectd plugin• Monitor INSERT, SELECT, UPDATE operations• The breakdown of read operations can indicate missing indices
• Monitoring /var/log/mysqlslow.log file• Identify slow queries
• Use MySQL EXPLAIN command to identify query plan
![Page 32: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/32.jpg)
32
Real Cloud Experience. Shared.
# 32
MySQL Collectd Plugin• Uses MySQL SHOW STATUS command to collect statistics• A large set of counters that are divided into 10 categories
• Connections• IO Requests• Select Rates• Read Rates• Key Rates• Commands Rates• Query Cache• Tables• Memory• Misc.
![Page 33: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/33.jpg)
33
Real Cloud Experience. Shared.
# 33
MySQL Collectd Plugin• Uses MySQL SHOW STATUS command to collect statistics
![Page 34: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/34.jpg)
34
Real Cloud Experience. Shared.
# 34
Mysqlslow.log & explain command
![Page 35: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/35.jpg)
35
Real Cloud Experience. Shared.
# 35
MySQL performance depends on locality• Wait time should be minimum when working set fits in memory• Performance degrades once wait time is significant
user time dominates
wait time insignificant
![Page 36: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/36.jpg)
36
Real Cloud Experience. Shared.
# 36
MySQL reads graphs• Read-random-next represents a table scan• Read-next represents an index scan
![Page 37: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/37.jpg)
37
Optimizing Your Cloud Applications in RightScale
Load Testing
![Page 38: Optimizing Your Cloud Applications in RightScale](https://reader035.fdocuments.net/reader035/viewer/2022062513/5577c6bad8b42ae0418b45ab/html5/thumbnails/38.jpg)
38
Real Cloud Experience. Shared.
# 38
Load testing using httperf• RightScale provides ServerTemplates in the marketplace
• https://my.rightscale.com/library/server_templates/Httperf-Load-Tester/24714
• Tutorial on httperf setup and configuration• http://support.rightscale.com/03-Tutorials/02-AWS/E2E_Examples/E2E_Gaming_Deployment/Adding_Httperf_Load_Tester