Pay-as-you-go (Like EC2)
Overview
AWS EC2 on-demand pricing can be found on this page. The core of EC2 on-demand pricing is a pay-as-you-go plan with a single dimension on running time. The basic structure is billing the running time by hourly price. The critical implementation behind EC2 pricing is that hour is the minimum usage increment, any usage beyond a hour will be rounded up to the entire hour.
Implement AWS EC2 On-Demand Pricing
EC2 on-demand price can be implemented in Paigo with an offering called EC2 On-Demand
with one usage dimension attached to the offering. The dimension has following configurations.
Consumption Unit: Minute
Consumption Price: $0.096
Usage Increment: 60
Rounding: Ceiling
Aggregate Interval: Hour
Aggregate Method: Sum
The idea of this configuration is that with a short time interval such as every five minutes, the usage of EC2 instance is sampled, and stored in Paigo as raw usage data. For example, the instance ran for 3 minutes in the past 5 minutes. Therefore, a usage record of 3
is saved to Paigo as the raw usage data. After an hour, Paigo billing aggregation system will kick in and calculate the sum (as specified by Aggregate Method) of all raw usage data, such as 47 minutes, divide it by 60 minutes chunk (as specified by Usage Increment), and round it up (as specified by Rounding), so that the final billable amount is 1 hour, and the amount due for this hour is $0.096. This algorithm is exactly the algorithm behind Paigo's Infrastructure-based Method to calculate customer's usage and bill automatically.
Note that there is not only one way of implementing EC2 on-demand pricing. Depending on the usage measurement technique, other alternatives including using Count as the Aggregate Method when the raw usage data measurement is from the CPU Utilization from CloudWatch per minute data. So the aggregation algorithm would count the number of minutes in an hour that the instance CPU is up and running, and finally aggregates to the billable amount, which is still 1 hour and $0.096.
Last updated