Learning AWS(Second Edition)
上QQ阅读APP看书,第一时间看更新

Estimating your cloud computing costs

Costs are central to designing for the cloud. Selecting the most appropriate options from a wide variety of tunable parameters available for each of the services can make this a challenging task. Typically, if you understand the costing for your compute nodes and database services well, then you would have largely accounted for a big chunk of your expected bill. Using an 80:20 principle can help you get to ballpark cost estimates, quickly. Typically, if you understand the costing for your compute nodes and database services well, then you would have largely accounted for a big chunk of your expected bill.

Most cloud service providers make online calculators available to arrive at the ballpark figures for your infrastructure. The following is a sample screenshot for provisioning AWS EC2 instances (compute nodes) in a calculator provided by Amazon. The left margin contains links to costing the various AWS services that you plan to provision for your application:

The following figure is a sample screenshot of the AWS calculator’s monthly bill tab. This tab presents the total costs you can expect on a monthly basis. These calculators are typically very easy to use, and there is a lot of guidance and help available to select the appropriate options for each of the services:

The calculations and the totals obtained from these calculators is a good estimate, however it is a snapshot-in-time or a static estimate. You will need to create several of these to accurately reflect your costs through the product development life cycle. For example, you will provision development, QA/test, staging, and production environments at different times, and with different sizing and parameter values. In addition, you may choose to shutdown all development and QA/test environments at the end of each work day, or bring up the Staging environment only for load tests and a week prior to any production migrations.

Cloud-service providers present you with an itemized bill that includes the details of your resource usage. Compare the actual resource usage against your provisioned resources for identifying tuning opportunities. This can help lower your cloud environment costs.

It is very important to understand your cloud resource usage and the associated costs in your itemized bill. Track your bills closely for the first few months and at crucial times in your product development. These include whenever you spin up new environments, do load testing, run environments round-the-clock, provision a new service, or upgrade or increase the number of your compute instances. It is also important to give a heads up to finance or the leadership team when you expect the bills to show a spike or an uptick.