We had to set up a Spark cluster for a Memory Intensive Application that is not Network Bandwidth intensive. We had the option of either setting up a Spark cluster in a 42U Rack in our Data Center using PowerEdge R730xd Rack Servers ( already available with our IT) or using AWS. Although bandwidth usage, i.e how data flows in and out of the cluster plays a very important role in deciding cloud vs on-premise solution, we did not have to worry about this aspect. Before making a final decision, I wanted to compare Total Cost of Ownership(TCO) for an on-premise cluster for 5 years (average age of server/hardware) versus monthly AWS cost over a 5 year period.
Although our application will not use more than 750 GB of Memory in the cluster at any given time, we wanted to build some extra capacity (1TB) to ensure that we are never running at more than 75% memory utilization.
For on-premise cluster, TCO included not only one time upfront setup cost but also monthly maintenance cost (electricity, labor/management, UPS, cooling, generator, fire control etc). To build the cluster, we had to use PowerEdge R730xd Rack Servers with Intel® Xeon® E5-2603/6 cores, 32 GB RAM (already procured by our IT at around $4900 per server). For a cluster with 1TB memory, we needed 34 such PowerEdge servers. For calculation purpose, I decided to use information provided by one of our infrastructure engineers regarding average cost associated with building/maintaining a 42U rack in a co-located facility:
|
Description |
Upfront Cost |
Monthly Cost |
|
Hardware/Software for servers |
$197,200(5800*34) |
$0 |
|
Fixed Monthly cost before maintenance(Building space, UPS, cooling, generator, fire) |
$0 |
$800 * |
|
Ongoing maintenance and running(electricity cost, UPS, generator,cooling) |
$0 |
$425 * |
|
Monthly labor/management cost |
$0 |
$875 * |
*Please note that these are approximate numbers and will change based on various factors
Based on the above numbers, TCO for on-premise cluster with 1 TB memory over a 5 year period is approximately US $323,200.
To build a Spark cluster in AWS with 1TB capacity, we can use 17 r3.2xlarge machines (8 CPUs, 61 GB of RAM with 160 GB of SSD storage). To bring down the monthly cost, we decided to use reserved instances (with 1 year or 3 year upfront commitment) instead of on-demand instances (which require no contract). Cost of provisioning the proposed cluster with 17 r3.2xlarge machines is described below:
|
Purchasing Option |
Upfront Cost |
Monthly Cost |
Average 5 Year Cost |
|
On Demand (No Contract) |
$0 |
$9102 |
|
|
1 yr Partial Upfront Reserved |
$37162 |
$1706 |
$288,170 |
|
3 yr Partial Upfront Reserved |
$71658 |
$1351 |
$200,490 |
Looking at the numbers above, it is clear that cloud provided a cheaper solution as compared to on-premise solution for our requirement.