ABCDEFGHIJKLMNOPQRSTUVWXY
1
Scenario 1
Let’s compare m7i-flex.large and t4g.large with Unlimited mode enabled while CPU usage fluctuates over five days. Note that t4g.large can earn 36 CPU credits per hour, and the maximum earned credits that can be accrued is 864.

The instance is initialized and for the first 6-hour period remains idle, so CPU utilization is 0%. In that time, 216 credits are earned.
The CPU usage for the next 3 hours increases to 60%. That uses half of your CPU credits, leaving you with a balance of 108 credits.
For the next 6 hours, CPU utilization stays at 25%. 36 credits are earned. The balance is 144.
Next, CPU utilization stays at 40% for 18 hours, using 216 credits. The credit balance is -72.
For 12 hours, CPU utilization is at 30%. You neither gain nor lose credits.
The CPU usage for the next 18 hours increases to 80%. That uses 1080 credits putting the balance to -1152.
For the next 6 hours, CPU utilization stays at 25%. 36 credits are earned. The balance is now -1116.
CPU usage goes back up to 55% for 24 hours. 720 credits are used. The balance is -1836.
For 15 hours, CPU use is 75%. 630 credits are used and the balance is -2466.
Finally, for 12 hours before the instance is stopped, the CPU uses 60%. 432 credits are used for a total of -2898 credits.
The CPU surplus credits charged is 2898, which corresponds to 48.3 vCPU-hours. From there, we can calculate the total cost:

48.3 vCPU-hours * $0.04 * 2 CPUs = $3.86

The charge for the 120 hours of the On-Demand hourly rate is:

$0.0672 * 120 hours = $8.07

So the total cost is $11.928 for t4g.large.

m7i-flex.large is much simpler to calculate:

$0.09576 * 120 hours = $11.49

m7i-flex.large provides a 4% savings in this case.
2
3
HourCPU UtilisationEarnedSpentCredit BalanceT4g.largeNumber of vCPUBaseline performanceT4 additional chargem7i-flex.large
4
103600.0672230%0.040.09576
5
20360
6
30360Spent7,398.00
7
40360Earn4,320.00
8
50360Surplus CPU credits vCPU-min3,078.00
9
60360216Surplus CPU credits vCPU-hour51.30
10
760%3672Additional charge (1)2.05
11
860%3672T4g.large in 120h - OD price (2)8.06
12
960%3672108Total charge (1+2)10.12
13
1025%3630
14
1125%3630m7i-flex.large in 120h11.49
15
1225%3630
16
1325%3630Using T4g charge is cheaper than m7i-flex11.97%
17
1425%3630
18
1525%3630144
19
1640%3648
20
1740%3648
21
1840%3648
22
1940%3648
23
2040%3648
24
2140%3648
25
2240%3648
26
2340%3648
27
2440%3648
28
2540%3648
29
2640%3648
30
2740%3648
31
2840%3648
32
2940%3648
33
3040%3648
34
3140%3648
35
3240%3648
36
3340%3648-72
37
3430%3636
38
3530%3636
39
3630%3636
40
3730%3636
41
3830%3636
42
3930%3636
43
4030%3636
44
4130%3636
45
4230%3636
46
4330%3636
47
4430%3636
48
4530%3636-72
49
4680%3696
50
4780%3696
51
4880%3696
52
4980%3696
53
5080%3696
54
5180%3696
55
5280%3696
56
5380%3696
57
5480%3696
58
5580%3696
59
5680%3696
60
5780%3696
61
5880%3696
62
5980%3696
63
6080%3696
64
6180%3696
65
6280%3696
66
6380%3696-1,152
67
6425%3630
68
6525%3630
69
6625%3630
70
6725%3630
71
6825%3630
72
6925%3630-1,116
73
7055%3666
74
7155%3666
75
7255%3666
76
7355%3666
77
7455%3666
78
7555%3666
79
7655%3666
80
7755%3666
81
7855%3666
82
7955%3666
83
8055%3666
84
8155%3666
85
8255%3666
86
8355%3666
87
8455%3666
88
8555%3666
89
8655%3666
90
8755%3666
91
8855%3666
92
8955%3666
93
9055%3666
94
9155%3666
95
9255%3666
96
9355%3666-1,836
97
9475%3690
98
9575%3690
99
9675%3690
100
9775%3690