Friday, January 25, 2013

AWS Insight: Reservations in EC2 — how it works


Hey! 

As we know, one of the main rules for using cloud services is the total optimization, and in particular optimization of the financial side.
Amazon Web Services has three main methods for service cost optimization:

·       Auto scaling
·       Reservation
·       Use of spot instances

Today I will tell about the reservation in EC 2, how, what and why you must do it.
Reservation — is the advance payment for server capacities, which allows you to reduce costs considerably for these very capacities. There are three Reservation types:

·       Light Utilization
·       Medium Utilization
·       Hard Utilization

You can buy Reservation once in a year or three years, that means the reservation can be:

·       annual
·       triennial

Economic justification
The basic principle for choosing the right type of Reservation: the longer your Server works, the more expensive reservation you need to buy. Let’s perform a test.  We will take one Server with M1.XLarge size and run it. Depending on the number of hours the server is going to work a day, we can calculate the total sum we need to pay for it for one year and for three years. So, as of today the prices are the following:
The model used
1 year
3 years
Advance payment
Per hour
Advance payment
Per hour
On-demand
$0.52
$0.52
Light Utilization Reservation
$552
$0.392
$850.40
$0.312
Medium Utilization Reservation
$1280
$0.248
$2000
$0.20
Hard Utilization Reservation
$1560
$0.20
$2400
$0.16

Yearlong test

The yearly cost is calculated using the following formula:

YC=H*365*
С+R, where

YC — Yearly cost
H — the number of hours the server works a day
С — hour cost
R — reservation cost

Let’s take the column “1 year” in the pricelist and draw a table in relation to the number of hours when the instance was started:
One year, $
Hours per day
On demand
Light
Medium
Hard
1
189.80
665.88
1,350.08
2,681.28
2
379.60
779.76
1,420.16
2,681.28
3
569.40
893.64
1,490.24
2,681.28
4
759.20
1,007.52
1,560.32
2,681.28
5
949.00
1,121.40
1,630.40
2,681.28
6
1,138.80
1,235.28
1,700.48
2,681.28
7
1,328.60
1,349.16
1,770.56
2,681.28
8
1,518.40
1,463.04
1,840.64
2,681.28
9
1,708.20
1,576.92
1,910.72
2,681.28
10
1,898.00
1,690.80
1,980.80
2,681.28
11
2,087.80
1,804.68
2,050.88
2,681.28
12
2,277.60
1,918.56
2,120.96
2,681.28
13
2,467.40
2,032.44
2,191.04
2,681.28
14
2,657.20
2,146.32
2,261.12
2,681.28
15
2,847.00
2,260.20
2,331.20
2,681.28
16
3,036.80
2,374.08
2,401.28
2,681.28
17
3,226.60
2,487.96
2,471.36
2,681.28
18
3,416.40
2,601.84
2,541.44
2,681.28
19
3,606.20
2,715.72
2,611.52
2,681.28
20
3,796.00
2,829.60
2,681.60
2,681.28
21
3,985.80
2,943.48
2,751.68
2,681.28
22
4,175.60
3,057.36
2,821.76
2,681.28
23
4,365.40
3,171.24
2,891.84
2,681.28
24
4,555.20
3,285.12
2,961.92
2,681.28

If we choose Heavy Utilization Reservation, we will pay for the instance even if it is not working, which means its price per year is straight.

On the basis of this table let’s make the following graph:



As we can see, On-Demand is the cheapest option with up to 7 hours inclusively per day, which requires no advanced payment. In case the Server is used for more than 8 hours, it makes sense to buy Light Utilization Reservation, then Medium Utilization Reservation, and finally Heavy Utilization Reservation.

We recommend creating a template in a table editor for every instance type you use to define the most profitable reservation strategy.

Summary

When you plan to use your server from one up to seven hours a day, you’d better not make any advanced payments. If you plan to use it from seven up to fifteen hours a day, it is reasonable to order Light Utilization Reservation, and Medium Reservation in case when you plan to use it from sixteen up to nineteen hours. If you plan to run the server for more than nineteen hours a day, it is better to buy Hard Utilization Reservation.

Triennial test

The same test, but only for triennial reservation. The costs table is provided below:
Three Years, $
Hours per day
On demand
Light
Medium
Hard
1
569.40
1,121.96
2,166.44
5,133.12
2
1,138.80
1,393.52
2,332.88
5,133.12
3
1,708.20
1,665.08
2,499.32
5,133.12
4
2,277.60
1,936.64
2,665.76
5,133.12
5
2,847.00
2,208.20
2,832.20
5,133.12
6
3,416.40
2,479.76
2,998.64
5,133.12
7
3,985.80
2,751.32
3,165.08
5,133.12
8
4,555.20
3,022.88
3,331.52
5,133.12
9
5,124.60
3,294.44
3,497.96
5,133.12
10
5,694.00
3,566.00
3,664.40
5,133.12
11
6,263.40
3,837.56
3,830.84
5,133.12
12
6,832.80
4,109.12
3,997.28
5,133.12
13
7,402.20
4,380.68
4,163.72
5,133.12
14
7,971.60
4,652.24
4,330.16
5,133.12
15
8,541.00
4,923.80
4,496.60
5,133.12
16
9,110.40
5,195.36
4,663.04
5,133.12
17
9,679.80
5,466.92
4,829.48
5,133.12
18
10,249.20
5,738.48
4,995.92
5,133.12
19
10,818.60
6,010.04
5,162.36
5,133.12
20
11,388.00
6,281.60
5,328.80
5,133.12
21
11,957.40
6,553.16
5,495.24
5,133.12
22
12,526.80
6,824.72
5,661.68
5,133.12
23
13,096.20
7,096.28
5,828.12
5,133.12
24
13,665.60
7,367.84
5,994.56
5,133.12

Below is the graph based on this table:


Summary

In a three-year period, the usage of reservation is not justified when the instance runs up to three hours a day. For three and up to ten hours, it is better to use Light Utilization Reservation, and buy Hard Utilization Reservation in case of more than ten hours a day.

Apparently, Medium Utilization Reservation in both cases is a medium variant, as it has more advantages than Light Utilization Reservation, but is cheaper than Hard Utilization Reservation at the beginning. This seems to be the only intended use of Medium Utilization Reservation.

Conclusion

So, by looking at the calculation results you can see the reason why it is simply necessary to use Reservations. According to our example, during constant use of the server for a year you can save :
($4,555.20 — $2,681.28) / $4,555.20 * 100% = 41%

For 3 years:
($13,665.60 — $5,133.12) / $13,665.60 * 100% = 62%

The figures are impressive, aren’t they?

No comments:

Post a Comment