Reputation: 110
I use T3 class for our k8s clusters, we want to know how to calculate the charge for burstable family class instance.
For example, I have an k8s cluster with 2 nodes using t3.large instance type, as the official document from aws said:
Each burstable performance instance continuously earns credit when it stays below the CPU baseline, and continuously spends credits when it bursts above the baseline. The amount of credits earned or spent depends on the CPU utilization of the instance:
- If the CPU utilization is below baseline, then credits earned are greater than credits spent.
- If the CPU utilization is equal to baseline, then credits earned are equal to credits spent.
- If the CPU utilization is higher than baseline, then credits spent are higher than credits earned.
If the credits earned are greater than credits spent, then the difference is called accrued credits, which can be used later to burst above baseline CPU utilization. That 's ok I know aws will charge this case with the price on-demand aws has said in official pricing
And another case: If the credits spent are more than credits earned, then the instance behavior depends on the credit configuration mode—Standard mode or Unlimited mode. For now we have 2 cases:
In Standard mode, when credits spent are more than credits earned, the instance uses the accrued credits to burst above baseline CPU utilization. If there are no accrued credits remaining, then the instance gradually comes down to baseline CPU utilization and cannot burst above baseline until it accrues more credits.
In Unlimited mode, if the instance bursts above baseline CPU utilization, then the instance first uses the accrued credits to burst. If there are no accrued credits remaining, then the instance spends surplus credits to burst. When its CPU utilization falls below the baseline, it uses the CPU credits that it earns to pay down the surplus credits that it spent earlier. The ability to earn CPU credits to pay down surplus credits enables Amazon EC2 to average the CPU utilization of an instance over a 24-hour period. If the average CPU usage over a 24-hour period exceeds the baseline, the instance is billed for the additional usage at a flat additional rate per vCPU-hour.
It 's easy for you if just use the the Standard mode
, but if the Unlimited mode
is used, how can we calculate the charge for the flat additional rate per vCPU-hour
is shown in above quote from aws document?
I dont find what I'm looking for in above official document about burstable T class and in the EC2 pricing page too.
And please give me the formula if you can, I want to calculate the charge for the flat additional rate per vCPU-hour
to show to my boss why we should or should not use T3 class.
Upvotes: 5
Views: 2074
Reputation: 1425
I think you have found the document you want but you do not aware of. The pricing for the Unlimited mode
is in middle of the pricing page T2/T3/T4g Unlimited Mode Pricing
And I think the formula you want to know is mention in another document Unlimited mode concepts
However, if CPU utilization stays above the baseline, the instance cannot earn enough credits to pay down the surplus credits that it has spent. The surplus credits that are not paid down are charged at a flat additional rate per vCPU-hour. For information about the rate, see T2/T3/T4g Unlimited Mode Pricing
In your case, the price for T class in unlimited mode is:
For T2 and T3 instances in Unlimited mode, CPU Credits are charged at:
- $0.05 per vCPU-Hour for Linux, RHEL and SLES, and
- $0.096 per vCPU-Hour for Windows and Windows with SQL Web
AWS use an unit for charging you when using EC2 is CPU credit - A unit of vCPU-time.
Examples:
- 1 CPU credit = 1 vCPU * 100% utilization * 1 minute.
- 1 CPU credit = 1 vCPU * 50% utilization * 2 minutes
Formula for CPU credit
:
CPU credit = (number vCPU) * (additional CPU %) * (number of minute or the time additional CPU % is used)
For the flat additional rate per vCPU-hour, you need to find the %
CPU utilization above % CPU baseline ( or additional CPU %) and the time of additional CPU % is used, convert it into CPU credit
follow above formula and then, multiple the result to the price for T3 instances in Unlimited mode, that 's it.
(Unlimited Mode CPU Credits) * $0.05
Formula for instance of t3.large type pricing (both on-demand
and unlimited mode
) :
Charge = (On Demand Linux t3.large Instance Hour) * $0.0832 + (Unlimited Mode CPU Credits) * $0.05
In document explain about Unlimited mode concepts
, AWS has an example for you to understand how to calculate the pricing for EC2 both on-demand
and unlimited mode
.
==========>Note:
It 's hard for you to find additional CPU % and the time of additional CPU % is used and fortunately, AWS already measure the Unlimited Mode CPU Credits
for you:
Spent surplus credits are tracked by the CloudWatch metric CPUSurplusCreditBalance. Surplus credits that are charged are tracked by the CloudWatch metric CPUSurplusCreditsCharged. For more information, see Additional CloudWatch metrics for burstable performance instances.
You can use AWS CloudWatch
to get the Unlimited Mode CPU Credits
and show the formula for your boss without any calculate operation.
Upvotes: 5