gpt4 book ai didi

amazon-web-services - 如何使用可突发家族类实例计算 EC2 定价

转载 作者:行者123 更新时间:2023-12-05 01:58:15 24 4
gpt4 key购买 nike

我为我们的 k8s 集群使用 T3 类,我们想知道如何计算可突发系列类实例的费用。

例如,我有一个使用 t3.large 实例类型的 2 个节点的 k8s 集群,如 official document来自 aws 说:

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.

如果获得的积分大于花费的积分,则差额称为累积积分,稍后可以使用它来突破基线 CPU 利用率。没关系,我知道 aws 会按照 aws 在 official pricing 中所说的按需价格向这种情况收费。

另一种情况:如果花费的积分多于获得的积分,则实例行为取决于积分配置模式——标准模式或无限制模式。目前我们有 2 个案例:

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.

如果只是使用Standard mode就很简单,但是如果使用Unlimited mode,我们如何计算的费用每 vCPU 小时的固定附加费率 是否显示在上面引用自 aws 文档?

我在上面有关可突发 T 类的官方文档和 EC2 定价页面中也找不到我要找的东西。

如果可以,请给我公式,我想计算每 vCPU 小时的固定附加费率 的费用,以向我的老板展示我们应该或不应该使用 T3 类的原因。

最佳答案

我想你已经找到了你想要的文件,但你不知道。 Unlimited 模式 的定价在定价页面的中间 T2/T3/T4g Unlimited Mode Pricing

我想你想知道的公式在另一份文件中提到了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

在您的情况下,无限制模式下 T 舱的价格是:

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

当您使用 EC2 时,AWS 使用一个单位向您收费,即 CPU credit - vCPU-time 的一个单位。

Examples:

  • 1 CPU credit = 1 vCPU * 100% utilization * 1 minute.
  • 1 CPU credit = 1 vCPU * 50% utilization * 2 minutes

CPU 积分的公式:

CPU credit = (number vCPU) * (additional CPU %) * (number of minute or the time additional CPU % is used)

对于每 vCPU 小时的统一附加费率,您需要找到 %CPU 利用率高于 % CPU 基线(或额外 CPU %)和使用额外 CPU % 的时间,将其转换为 CPU credit 按照上面的公式,然后将结果乘以 的价格无限模式下的 T3 实例,仅此而已。

(Unlimited Mode CPU Credits) * $0.05

t3.large 类型定价实例的公式(按需无限制模式):

Charge = (On Demand Linux t3.large Instance Hour) * $0.0832 + (Unlimited Mode CPU Credits) * $0.05

在关于Unlimited mode concepts的文档解释中,AWS有一个例子让你了解如何计算EC2的定价on-demandunlimited mode

==========>注意:您很难找到额外的 CPU % 并且使用额外 CPU % 的时间,幸运的是,AWS 已经为您测量了 Unlimited Mode CPU Credits:

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.

您可以使用 AWS CloudWatch 获取 Unlimited Mode CPU Credits 并向您的老板展示公式,无需任何计算操作。

关于amazon-web-services - 如何使用可突发家族类实例计算 EC2 定价,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68668527/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com