Академический Документы
Профессиональный Документы
Культура Документы
Window Azure Cost Inspired Architecture Sujesh Kodoth Senior Consultant, MCS, Microsoft
SESSION AGENDA
Explain compute, storage and bandwidth cost considerations. Identify fundamental efficiency principles to consider. Recognize where and how to translate savings into added value and increased revenue.
Estimating Cost
Windows Azure Platform Consumption Pay as you go and grow for only what you use when you use it Prices
Predicting Cost
It can be difficult to predict and deal with cost purely in terms of the billing metrics that Windows Azure uses Easier to deal with cost when converted to units that make sense for your service, example:
Cost / Feature Cost / Business Transaction Cost / Unit of Uptime
Cost / User
Predicting Cost
Compute Per Service Hour, for VM size Storage Per GB stored & transactions Bandwidth Per GB transfer out of datacenter AppFabric Per connection/month Per transactions/month SQL Azure Per DB per Month
Predicting Cost
Migration Assessment and Planning Toolkit Windows Azure TCO Calculator
Break down the billing statement so you know what a servicespecific unit costs you Take it further by deploying scale units Each scale unit has known cost due to past profiling/measurement
Hosted Services
Storage Services
Known Workload
Scale Unit
Checkout (5%)
2 Web Roles 2 x Queue 2 x Worker Roles for order processing 300ms response time 200 concurrent users 100 orders per minute
Shared Databases
1 x Products DB 1 x Customer DB 1 x Orders DB
! Dont forget the resources used for monitoring, instrumentations etc. which may be directly related to scale unit.
Estimation Process
COMPUTE
DATA
BANDWIDTH
Optimising Cost
Fundamental Principles
Measure everything, measure everything!
Windows Azure Diagnostics Transparent ROI
Whenever possible:
Cache Compress Batch
Following these principles typically leads to a better user experience and app performance
Monitoring
Where is CPU time spent? What % of CPU is used?
Diagnostics
What URLs are getting served? What are the characteristics (caching, compression, etc)
Storage
What parts of your code are calling storage? What partitions are they hitting? Route all storage access through common code. Verify storage patterns.
Cost Savings
Batch Transactions
Data in Storage
Snapshots
CDN Service
Data Pulls
At scale, think about what granularity is appropriate: Do you really need per second CPU counters with 1K cores? Use different storage accounts for app, monitoring , and diagnostic data.
Remember that storage has per-account throttling.
At very large scales, heavy monitoring / aggressive transfers can cause storage throttling and fail to capture critical data.
Common mistake split up code into multiple roles, each not using up CPU. Balance between using up CPU vs. having free capacity in times of need. Multiple ways to use your CPU to the fullest
Exploiting Concurrency
Typically code falls into one or more of these categories:
Memory Intensive
CPU Intensive
Network Intensive
Storage IO Intensive
Scaling Appropriately
Scaling is a feature, and under your control.
Monitor your application and make Performance Cost sure youre scaled appropriately (not over-scaled) Spinning VMs up and down automatically is good at large scale, but may be cost-prohibitive for smaller scale deployments.
Remember that VMs take a few minutes to come up and cost ~$3 a day (give or take) to keep running.
Traffic Reduction
Bandwidth is major cost of any application. Reducing bandwidth leads to edge savings. Batching increases Storage efficiency. Reducing throughput increases VM capacity.
AJAX/JSON Image maps CSS Sprites Inline Images Combine scripts Combine stylesheets
All of these tips have the side benefit of improving your web apps performance and user experience
Content Compression
Gzip all output content:
All modern browsers can decompress on the fly. Compared to Compress, Gzip has much better compression and freedom from patented algorithms
Uncompressed Content
Compressed Content
Caching Techniques
Etags Expires Max-Age header Using query strings, different filenames for cache breaking
Summary
Understand the Windows Azure pricing model, and how it applies to your specific solution Use Scale Units to estimate costs under different usage scenarios Take cost into consideration when estimating features Maximize the utilization of each role instance Shut down services/instances when not needed Use caching, compression and batching to minimize resource usage and cost