The true cost of an ECU

How do you compare the cost of two cloud or IaaS offerings? Is Amazon EC2’s small instance (1 ECU, 1.7GB RAM, 160GB storage) cheaper or is Rackspace cloud’s 256MB server (4 cores, 256MB RAM, 10GB storage) cheaper? Unfortunately, answering this question is very difficult. One reason is that cloud vendors have been offering virtual machines with different configurations, i.e., different combinations of CPU power, memory and storage, making is difficult to perform an apple-to-apple comparison.

Towards the goal of a better apple-to-apple comparison, I will break down the cost for CPU, memory and storage individually for Amazon EC2 in this post. For those not interested in understanding the methodology, the high level conclusions are as follows. In Amazon’s N. Virginia data center, the unit costs are:

  • 1 ECU costs $0.01369/hour
  • 1 GB of RAM costs $0.0201/hour
  • 1 GB of local storage costs $0.000159/hour
  • A 10GB network interface costs $0.41/hour
  • A GPU costs $0.52/hour

Before we can break down the cost, we have to know what an instance’s (Amazon’s term for a virtual machine) cost consists of. We assume the cost includes solely the cost of its CPU, its memory, and its local storage space. This means that there is no fixed cost component, for example, to account for the hardware chassis, or to account for the static IP address. We make this assumption purely for simplicity. In practice, it makes little difference to the end result even if we assume there is a fixed cost component. We also note that the instance cost does not include the cost for the network bandwidth consumed, which is always charged separately, at least in the cloud providers we looked at.

Let us assume the instance cost is a linear function of the three components, i.e., Cost = c * CPU + m * Mem + s * Storage, where c, m and s are the unit cost of CPU, memory and local storage respectively. It is fortunate that Amazon EC2 offers several types of instances, each type of instance has a different combination of CPU, memory and storage, which offers us a clue of what each component costs. Combining the many types of instances, we can estimate the parameters c, m and s by using a least-square regression analysis. Let us first look at Amazon’s N. Virginia data center. We only use Linux instances’ hourly cost as the instance cost to avoid accounting for an OS’s licensing cost. The results from least-square regression are:

s = 0.0159 cent/GB/hour
m = 2.01 cent/GB/hour
c = 1.369  cent/ECU/hour

The linear model and the estimation actually match the real data really well. The following table shows the instances we used for regression. The last column shows the instance cost as predicted by our estimated parameters, and the second-to-last column shows the real EC2 cost. As you can see, the two costs actually match fairly well, suggesting that a linear model is a good approximation. We should note that we mark the Micro instance to have 0.35 ECU. This is an average of its ECU allocation as we have shown in our Micro instance analysis.

instance CPU(in ECU) RAM(in GB) Storage(in GB) Instance cost per hour (in cents) Fitted instance cost per hour (in cents)
m1.small 1 1.7 160 8.5 7.33
m1.large 4 7.5 850 34 34.07
m1.xlarge 8 15 1,690 68 67.97
t1.micro 0.35 0.613 0 2 1.71
m2.xlarge 6.5 17.1 420 50 49.96
m2.2xlarge 13 34.2 850 100 100.1
m2.4xlarge 26 68.4 1,690 200 200
c1.medium 5 1.7 350 17 15.83
c1.xlarge 20 7 1,690 68 68.32

It should come as no surprise that the memory is actually a significant component of the instance cost. Next time when you compare two cloud offerings, make sure to compare the RAM available.

In the estimation, we did not include EC2 cluster instances and cluster GPU instances, because they are different from other instances (both have a 10GB network interface and one has a GPU). But, now that we have a unit cost for CPU, memory and storage, we can estimate what those extra features cost.

For a cluster instance, combining the cost of CPU (33.5 ECU), memory (23GB), and storage (1690 GB) using our estimated parameters, the cost comes out to be $1.19/hour. Since Amazon charges $1.60/hour, the extra charge must be for the 10GB interface, which is the only feature that is different from other instances. Subtracting the two, the 10GB interface costs $0.41/hour.

For a cluster GPU instance, combining the cost of CPU (33.5 ECU), memory (22GB), and storage (1690 GB), the cost comes out to be $1.17/hour. Since Amazon charges $2.10/hour, the extra charge much be for the 10GB interface and the GPU. Subtracting the two costs and taking out the 10GB interface cost, we know the GPU costs $0.52/hour.

We can perform the same analysis for the other 3 Amazon data centers: N. California, Ireland and Singapore. Luckily, their cost structures are the same, so I only need to present one result. The unit costs are as follows:

s = 0.0169 cent/GB/hour
m = 2.316 cent/GB/hour
c = 1.575 cent/ECU/hour

The actual instance cost and the projected instance cost are as shown in the following table. Again, they agree very well. There are no cluster and cluster GPU instances in other data centers, so no cost for the 10GB interface and the GPU is shown.

instance CPU(in ECU) RAM(in GB) Storage(in GB) Instance cost per hour (in cents) Fitted instance cost per hour (in cents)
m1.small 1 1.7 160 9.5 8.22
m1.large 4 7.5 850 38 38.07
m1.xlarge 8 15 1,690 76 75.97
t1.micro 0.35 0.613 0 2.5 1.97
m2.xlarge 6.5 17.1 420 57 56.96
m2.2xlarge 13 34.2 850 114 114.1
m2.4xlarge 26 68.4 1,690 228 228
c1.medium 5 1.7 350 19 17.74
c1.xlarge 20 7 1,690 76 76.34

Leave a comment