I’m going to start this blog post by making one thing clear. My intent in writing this post is light-hearted – I had some spare time on my hands over a lunch break and I wondered what I could do with it. The result was this blog post :).

Ever since Microsoft announced their G Series Virtual Machines for Azure I’ve been looking for a good reason to fire one up and kick the tyres. Today while I was skimming through my Twitter feed I came across a tweet showing the time it took to calculate the trillionth prime number on a 16 vCPU Linux instance running on GCP.

As any good propeller head knows, the first rule of having access to massive raw compute is to put it to use solving mathematical challenges. This may take the form of a pure maths challenge like finding the n-th digit of Pi or an altogether more financially rewarding endeavour such as Bitcoin mining.

I’d tell you the second rule but it’s covered under an NDA.

The 16 vCPU VM used for this run produced the match in 31 minutes and 49 seconds – impressive!

So I thought to myself – I’m interested to see what an Azure G5 Virtual Machine can do with this challenge.

As Microsoft has publicised this machine is a beast and is currently the biggest VM you can get your hands on in any public cloud. The G5 clocks in at 32 vCPUs, 448GB RAM with about 6.5TB of SSD-based temporary disk. All for $8.69 (USD / West US) per hour.

Let me type that again: $8.69 per *hour*.

If you’d have suggested even as recently as five years ago that this compute power would be available to anyone with a credit card for that hourly rate, those around you may well have suggested you needed a holiday.

The Setup

Firstly let me just point out – you will need a lot of cores in your Azure Subscription if want to run a batch of these VMs. Check to make sure you have a minimum of 32 cores free. If not, you will need to put in a support request.

Let’s create one of these VMs then. I’m going with a vanilla Ubuntu 14.10 distribution and I am firing it up in West US.

G5 Create VM Dialog

The VM provisioning took ~ 15 minutes, after which I was able to SSH into this host and run some stats checks (you know, just to make sure I actually had *all* of that power available!)

A quick visual check in the Portal shows me I have what I expected.

G5 Portal Stats

Then I ran stats on CPU, memory and disk.

less /proc/cpuinfo

Gives me 32 CPUs (last one shown below – we start at base 0 here).

G5 CPU Stats

less /proc/meminfo

Woah Nelly!

G5 Mem Stats

and finally

df -h

Shouldn’t run out of disk here then!

G5 Disk Stats

Now let’s get our prime number generator and start our test. While logged in at a shell prompt we can download the primesieve x64 Linux binaries using wget thus:

wget http://dl.bintray.com/kimwalisch/primesieve/primesieve-5.4-linux-x64-console.tar.gz

and then unpack the tar file:

tar xvf primesieve-5.4-linux-x64-console.tar.gz

which will dump everything into a subfolder called ‘primesieve’ at our current location.

I had to pull down a few extra libraries from Ubuntu to get the generator to work – if you’re serious about trying this out I’m sure you know all about using apt-get install :).

Right. Moment of truth. Copying the command from the tweet I run it. And wait.

As it turns out, not that long.

10 minutes and 22 seconds to be precise.

Prime Sieve Output

Now, this isn’t a direct fruit comparison obviously – I had twice the vCPUs so I would have been surprised to have not been faster. I might have hit Amdahl’s law at some point, but it certainly doesn’t look like it :). The result here is a smidgen under one third the time of the 16 vCPU machine (622 vs 1,909 seconds)!

All this took me less than an hour to execute. If I hadn’t stopped to snapshot some screens I’d probably have shaved a few more minutes off too. As it stands this calculation cost me less than $8 and as I deleted the VM when I was done I have no ongoing cost (and if I need to do it again, I can just create the VM again!)

So there we have it… and I still can’t believe I can create and use a VM this size for less than the cost of three (Sydney) coffees per hour :).

Update: The day after I wrote this post Google launched a 32 vCPU VM in their GCP offering. They re-ran the test and the outcome landed at 17 minutes and 50 seconds. Close, but not quite :).

Category:
Azure Infrastructure, Azure Platform
Tags:
, , , ,

Join the conversation! 3 Comments

  1. Everybody knows your ssh user is azureuser@primesieve heh. 🙂 No point of censoring that.

Comments are closed.