Estimating Cost Of Running The Web Application On Windows Azure
Author: Suren Machiraju
Notable contributions by: Todd Petersen, Sidney Higa, James Podgorski, Shaun Tinline-Jones, Sanjay Mishra, Rama Ramani and Chris Kurt.
You have a great new idea for a web application and as an experienced .NET developer with an eye on the future, you immediately think of building it on Windows Azure to leverage its many virtues—elasticity and high-availability, to name two. As you start to refine your ideas and business model you need guidance in estimating the costs through the lifecycle of your application in the following areas:
-
Development.
-
Beta testing with a select few customers.
-
Production, when the application goes live.
-
Super scaled out after Oprah talks about how awesome your application is!
Estimating the cost of running your application on Windows Azure requires two things: a comprehensive understanding of the Windows Azure pricing, and a model, a template that simulates your application and its anticipated usage.
In this document we start with a baseline definition of the pricing/billing, prorating costs and evolve a generalized algorithm that can be applied to scenarios, one of them mapping to your web application. You can compute the costs of your web application using the basic Microsoft Excel spreadsheet available for download with this publication. In the near future we expect to use this general approach as the foundation for a tool that can be used to help model true costs for various, real-world scenarios by means of templates. As you will learn in this article, estimating your costs for Windows Azure can be a non-linear and slightly complex process as you need to factor in pro-rated usage, variability in consumption, and applicable discounts to your specific scenario. While you can start estimating your costs linearly using the Windows Azure Pricing Calculator, you will most likely find that the details of your scenario warrant a more comprehensive solution, and that is what we are working to deliver both conceptually in this article and in the form of a forthcoming tool.
Prices for Windows Azure Services
In this section we use December 2011 prices. These will serve as the fundamentals for the following computation.
Important |
|---|
| The prices used for calculations in this article may not correspond to the most recent prices. For the latest prices refer to Windows Azure Pricing Overview. |
Note |
|---|
| The key concept here is the pattern that can be overlaid on top of the costs for usage of each service: there is a meter that defines the measured usage, and a cost per meter unit captured by the meter. Taking Windows Azure Compute as an example, the extended cost for running a Medium instance for 24 hours is calculated as: Meter x Cost = 24 (Medium Instance) Hours x $0.24 per meter unit = $5.76. We will use this notion of a meter unit and a cost per meter unit throughout. |
The tables below show the meter costs per service. The services and costs are broken into three groups. The first group shows basic services and costs. These are the basic Windows Azure costs that you will most likely use for any Windows Azure application, and will probably make up the greatest share of your expense. Use the costs in the first group to get a first approximation of the major part of your costs.
The second group comes into play as you actively plan your application. You need some understanding of how the Service Bus relays and brokered messages work before you can leverage their features. That understanding may result in a much more efficient application, which will save you money.
The third group consists of bandwidth costs. As the application progresses, you will have a better understanding of how much bandwidth you will use. Since bandwidth only affects data egress (outbound data), you will want to have that fact in mind as you develop your application. For example, paging data logically enables you to measure it more easily (do not present query results in one, uncategorized page).
Basic Services and Costs
| Service | Description | Meter | Cost | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Compute |
Virtual machine size. Each size has default core counts, memory, and disk space. See How to Configure Virtual Machine Sizes. |
|
|
||||||||||
|
SQL Windows Azure Database |
Cloud database service built on SQL Server technology. |
|
|
||||||||||
|
Windows Azure Storage |
Secure, durable, easily accessible storage, available as blobs, tables, queues, and Windows Azure drives. |
|
|
Secondary Services and Costs
| Service | Description | Meter | Cost | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Caching |
Distributed in-memory cache for applications provides performance improvements for data access. |
|
|
||||||||||||
|
Service Bus Brokered Messaging |
Secure message queues for distributing data, or for creating subscriptions to data. |
|
|
||||||||||||
|
Service Bus Relayed MessagingAzure Storage |
Secure message relays for connecting application and services, in the cloud or on-premises. |
|
|
||||||||||||
|
Content Delivery Network (CDN) |
Allows you to cache your data in geographic centers that speed delivery to your service users. |
|
|
Secondary Services and Costs
| Meter | Cost |
|---|---|
|
Inbound |
Free |
|
Outbound in North America and Europe Regions per GB |
$0.12 |
|
Outbound in Asia Pacific Regions per GB |
$0.19 |
|
Outbound in same sub-region |
Free |
Prorating to Determine True Cost of Running the Application
In order to provide accurate estimates that are more in line with usage you need to pro-rate the aforementioned/above Windows Azure prices to the smallest/applicable time slice possible. For most services with a time-based meter in Windows Azure this can be computed hourly. The key to pro-rating generally across all Windows Azure services, is to take special measures to handle minimum charges, such as in the case when the smallest billed meter increment is daily and billing for just one or two hours of use results in being billed for the full day.
The following tables are all adjusted from the published costs to reflect hourly pro-rated charges according to the billing meter.
| Service | Notes | Meter | Cost | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Compute |
The smallest meter unit for compute is hourly. Usage of any partial hour is billed for the whole hour. |
|
|
||||||||||||
|
SQL Windows Azure Database |
Charges are accrued for the peak database size daily. Usage for only a few hours of a given day is billed at the rate for peak database size for the complete day. |
|
|
||||||||||||
|
Caching |
Charges accrue on a daily basis for the maximum cache size selected. Usage for only a few hours of a given day is billed at the rate for the complete day. |
|
|
||||||||||||
|
Service Bus, Relayed Messaging and Brokered Messaging |
After the promotional period expires, has a minimum monthly charge of 100 hours, even if only 1 hour is used. |
|
|
Special Offers That Will Take a Bite of the Costs
There are various offers available that effectively discount the use of various Windows Azure services. The following lists the offers currently available to MSDN subscribers, Microsoft Partners and Start-up Community (BizSpark), as well as those discounts made available through trial or commitment offers.
MSDN Subscribers
The current offer to MSDN subscribers provides an annual benefit valued at $3,700 which includes the quantities described the following table.
| Service | Meter | Cost | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Compute |
|
|
||||||||||||
|
Windows Azure Storage |
|
|
||||||||||||
|
SQL Windows Azure Database |
|
|
||||||||||||
|
Caching |
|
|
Microsoft Partner Network Members
Members of the Microsoft Partner Network can access the Cloud Essentials Pack, which currently offers the following benefits.
| Service | Meter | Cost | ||||
|---|---|---|---|---|---|---|
|
Compute |
|
|
||||
|
Windows Azure Storage |
|
|
||||
|
SQL Windows Azure Database |
|
|
||||
|
Caching |
|
|
||||
|
Data transfers/Bandwidth |
|
|
Bizspark Members
Currently, BizSpark Members get the same benefits as the MSDN Subscribers having a Visual Studio Ultimate with MSDN subscription.
| Service | Meter | Cost | ||||
|---|---|---|---|---|---|---|
|
Compute |
|
|
||||
|
Windows Azure Storage |
|
|
||||
|
SQL Windows Azure Database |
|
|
||||
|
Caching |
|
|
||||
|
Data transfers/Bandwidth |
|
|
3 Month Trial
A publicly available free trial offer for new subscribers.
| Service | Meter | Cost | ||||
|---|---|---|---|---|---|---|
|
Compute |
|
|
||||
|
Windows Azure Storage |
|
|
||||
|
SQL Windows Azure Database |
|
|
||||
|
Caching |
|
|
||||
|
Data transfers/Bandwidth |
|
|
Six Month Commitment Plans
Six-month commitment plans can be purchased multiple times, enabling the customer to achieve the capacity required at a discount off the retail pricing. The discounted price is found the Cost column of the following table.
| Service | Notes | Meter | Cost | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|
Compute |
This is available with the 6-Month Plan (Windows Azure). |
750 Small hours unit |
$71.99 |
||||||||
|
SQL Windows Azure Database |
This is available with the 6-Month Plan (SQL Windows Azure). |
10 GB Database unit |
$79.99 |
||||||||
|
Windows Azure Storage |
This is available with the 6-Month Plan (Storage). |
|
|
Enterprise Agreements
An enterprise agreement provides a 20% discount across all Windows Azure Services consumed. You purchase credits for consumption in advance, typically in units of $100. An initial minimum upfront purchase of $10,000 is required, after which credits can be purchased in smaller quantities. To setup an enterprise agreement, you will need to contact Microsoft Volume Licensing, whose contact information you can get here.
Creating an Algorithm for Estimating Usage and Costs
With the basics of computing costs based on usage, the next step is to help the customer to estimate the amount of consumed resources, such as:
-
Fixed or variable (elastic) resource consumption.
-
Consumption composition (what is fixed, what is variable).
In general, it is very difficult for the customer to answer these questions without having a live site collecting the desired metrics:
-
How many storage transactions will you perform in a month?
-
How many messages will you send per month across the Service Bus?
-
What size of compute instance and how many instances of each will you need?
-
How large of a cache will you need?
Defining Usage Scenarios
The solution is to provide a perspective of sorts, by providing scenarios that provide estimates of resource usage based on combination industry research and isolated benchmarking. For example, Windows Azure has three categories of users:
-
Startup
-
ISV
-
Enterprise
Each of these has a few scenarios which are most helpful, for example:
-
Single tier website
-
Two tier website
-
N-tier website
-
Simple database
-
High scale, federated database
-
Hybrid solution
-
SaaS web service
Options on these scenarios help give the right perspective by approximating the load, such as number of visitors, users, or clients. For example, 25 concurrent users or 10,000 concurrent users.
From these options we can start to pre-fill the estimated usage for each of the meters used by Windows Azure for billing purposes. For example, if research shows a typical small instance can handle 10 concurrent users and the user selects a single tier website for 25 concurrent users, the system would suggest using 3 small instances each month.
These are the types of scenarios we hope to provide reference data for in the future to assist customers with estimating their usage.
Supporting Elasticity in the Usage Estimation Model
Many scenarios go beyond just having a fixed resource consumption, month to month where multiple aspects may scale in/out or up/down. For example:
-
Scaling in/out instance count within a day or many times a month.
-
Changing the maximum size of a SQL Windows Azure DB or Cache within a month.
-
Handling spikes in the number of Service Bus relay clients.
This elasticity can be factored into the models computation by increasing or decreasing the number of role instances. To do this manually, see How to Scale Applications by Increasing or Decreasing the Number of Role Instances. For an automated way to scale, you can preview the Windows Azure Autoscaling Block.
Extensibility in the Model
As offers change and new services are added to the Windows Azure portfolio, any estimation approach needs to extend to support these “unknowns.” Defining all Windows Azure pricing in terms of a "meter" and a "cost" is a flexible structure in which to define future services.
The Estimation Algorithm
You can estimate Windows Azure costs using the following algorithm.
-
Estimate the usage for a single service.
-
Apply the estimated usage from a scenario to allocate quantities of the meter or directly specify the quantity of the meter used. Optionally, vary the usage according to elastic needs (for example, on an hourly scale).
-
Apply discounts, if any apply, from enterprise agreements, special offers, or commitment plans.
-
Repeat for each service involved in the solution.
-
Sum the Meter x Cost for each service involved in the solution:
-
Roll up hours into days, taking care to apply daily minimums where required.
-
Roll up days into a reference 30 day or 720 hour month.
-
Roll up hours into days, taking care to apply daily minimums where required.
In the coming months, we hope to take this general algorithm in combination with reference scenario data and produce a web based solution that provides interactive cost modeling for Windows Azure customers, supporting models with high degrees of flexibility and moderate complexity.
Conclusion
In this article we provided some basic understanding of the Windows Azure pricing, specifically by including details that are either not described on public price lists, are only available by calling Microsoft sales reps, or have relevant details that simply are not spelled out. In addition, we provided insights into an algorithm you can implement today to start modeling your costs. The same methodology will likely be employed by a tool in the near future.
Build Date:
Important