Quantcast
Channel: : software-engineering
Viewing all articles
Browse latest Browse all 19

An Adventure in Cloud Computing

$
0
0

I’ve recently had reason to use Amazon Elastic Cloud Compute (EC2) to set up some build agents for a software project I’m working on. We use TeamCity as our continuous integration build server. JetBrains has done a really good job with TeamCity and it makes setting up builds really easy. In recent versions they added a feature called ‘cloud integration’ where you can set up a single agent computer using Amazon EC2, create an Amazon Machine Image from it and then TeamCity will launch instances of the image on demand. It sounds like a great feature, and the build server scales up and down automatically based on demand. The attraction is that we have less hardware to manage and we don’t need to pay for a computer to be switched on the whole time, as the agents will start and stop automatically.

Amazon charges in the order of 20 cents per hour for CPU time, in hourly increments (you pay for the whole hour in which any instance was active). So my thinking was that a worst case scenario should be in the order of 20 cents per build, or less is we build more often than once per hour. If we build on average once a day for 30 days then we should be expecting costs in the order of $6 for compute time and $8 for volume storage, a total of about $14 per month. At that level, we’d be saving money on our electricity bills compared to having a dedicated computer running 24x7.

I used a C1 Medium image, which has 2 CPUs and adequate memory for running reasonably snappy builds of Visual Studio solutions. I needed to use a larger hard drive than the default 30Gb in order to fit Windows Server 2012 Standard and Visual Studio Ultimate, plus a few other bits and pieces. I eventually ended up with an 80Gb drive, which was larger than I needed but I couldn’t find a way to shrink it. No matter, I decided to live with it. Expected cost: about $0.20 (20 cents) per instance hour.

image

Above is a snapshot of our build history, you can see under the Agent column where TeamCity has created new agents (names beginning with EC2-i- followed by a random instance ID). Our build number captures the product Major and Minor version, together with the auto-incrementing build counter. So you can see here that the last build against an EC2 instance was build number 32. Another interesting point to note is that the builds are taking no more than a minute or so to complete.

The whole thing works amazingly well and it is fun to watch the agent instances starting and stopping all on their own. There’s only one thing wrong. It costs a lot more than anticipated! A few things went wrong, including using a larger volume size than I had intended, plus whenever an instance stopped it was somehow leaving a volume snapshot behind. My balance this month so far is $55. To be fair to Amazon this includes me making some mistakes and all the setting up and fiddling around, but there are no refunds for mistakes! This works out at a cost of $1.71 per build, which is not far off an order of magnitude increase on the anticipated cost of 20 cents per build. Remember, these are ‘on demand’ instances, so when they are not running we are not taking up any CPU time, just volume storage.

My conclusion: the economics don’t stack up.

I have trouble understanding why cloud computing is so expensive. Storing an 80Gb volume costs in the order of $8 per month. That kind of hard drive can be purchased outright for around $32. So in just 4 months, storage is starting to look very very expensive in the cloud. Assuming a 5 year lifetime of an 80Gb drive, I would pay $32 to purchase it outright, or $480 to store that same 80Gb in the cloud. Buy purchasing the hard drive outright, I’d probably save enough to purchase a modest computer to put it in. However, my Amazon bill is $55, for a total of less than 32 minutes of compute time! Amazon charges for a whole hour even though each build only takes a minute or so. With a burn rate of $55 a month for a single build agent with a rather modest specification, over that 5 year computer lifetime I’d have spent $3300, easily enough to buy a fairly decent server with a couple of terabytes of storage that’s adequate for running several virtual machines and probably enough left over to foot the electricity bill.

The promise of cloud computing is that we no longer have to worry about hardware costs. The economies of scale and the ability to use hardware efficiently to spread a shared workload should mean that the costs are far reduced. However, that doesn’t seem to be the case. My adventure into cloud computing has left me with a bitter aftertaste and I will be sticking to ‘on premises’ computing from now on.


Viewing all articles
Browse latest Browse all 19

Trending Articles