Saturday, March 9, 2024

What is the cheapest VPS? AWS vs GCP vs Azure

UPDATE: I got the AWS pricing wrong. You actually need to pay an additional ~$3.60 per month for the IPv4 address, even if the IP is always attached to your instance. This is a recent pricing update and completely changes the cost calculations. This means that the minimum possible AWS EC2 instance cost is now something like $5.60 a month if you include the IPv4.

UPDATE: I got the Azure pricing wrong. If you select any Linux OS image Azure will force you to get a 30GB OS disk which costs $2.40 if you're using standard SSD (more if you're using premium). This brings the Azure pricing to be more than double the AWS price for the t4g.nano ($1.90 per month for t4g.nano including the mandatory 8GB EBS, compared to $3.82 per month for b1ls including the mandatory OS disk). See below for original blog post.

UPDATE: I tested the AWS t4g.nano disk performance and measured 131MB/s write speed for my 9GB disk which uses gp3 storage (which is the default). See below for more details.

 

So I wanted a very small VPS that I can run a lightweight Linux instance on. I will only be using it for personal uptime monitoring so very little egress (I know AWS, GCP, and Azure all give 100GB free monthly egress and that should be more than enough) which means I don't have to worry about bandwidth costs. One of the great attractions of these big cloud vendors is that they offer unlimited free ingress traffic, which few VPS vendors provide.

UPDATE: If you really just want uptime monitoring, fly.io gives you 3x free 256mb "VM" with 160GB monthly egress and free ingress, which is probably enough - but note that fly.io is not a VPS unlike the other services mentioned in this post.

So I looked at AWS, GCP and Azure and found that the cheapest instances are as follows:

  • AWS: t4g.nano (ARM64) - 0.5G RAM - 2x ARM vCPU - both CPU and disk are burstable
  • Azure: b1ls  - 0.5G RAM - 1x x64 vCPU - both CPU and disk are burstable
  • GCP: e2.micro  - 1G RAM

The t4g.nano and b1ls come out to around the same price for similar configurations. AWS requires you to add a certain amount of EBS to match the snapshot image. Azure only gives you 4GB ephemeral disk for free, so if you want persistence you need to pay more. UPDATE: When trying to create a Linux b1ls instance Azure will automatically add a 30GB OS disk which costs $2.40 if you're using standard SSD.

3 year reserved b1ls: $1.42 per month
E4 SSD 32 GiB: $2.40 per month
Total cost for cheapest possible b1ls: $3.82 per month

With 8GB persistent storage you are looking at around $1.90 per month for t4g.nano in the US (and only slightly more expensive outside of the US) vs $2.02 $3.82 per month for the b1ls in West US and $2.30 $4.13 in Central US.

GCP e2.micro comes out to be more expensive at $2.75 including the smallest possible boot disk even with the 3 year committed use discount, but that's only in the cheapest US regions. In other regions it is much much more expensive e.g. in Los Angeles (us-west2) it is $3.79 / month, and outside of the US it is even more expensive. The f1.micro would have been cheaper than the e2.micro except for the fact that the f1.micro is not eligible for the committed use discount, only for the sustained use discount which is only like 30%.

It should be noted that Azure offers price matching with AWS for equivalent services. Maybe this explains why the AWS and Azure prices were so similar for the instances that I looked at. It's not even close lol, Azure is WAY more expensive than AWS: AWS only costs $1.90 per month while Azure costs $3.82 per month, it's more than twice the cost and even more than GCP even in the US.

Of course, this says nothing about how the CPU/disk performance compares for the t4g.nano vs the b1ls vs the e2.micro.

Tbh I can see why the e2.micro is more expensive than the t4g.nano since e2 micro has 1G ram compared to the half gig RAM in the t4g.nano ... but I can't see how the Azure price is even remotely justifiable. Azure says they price match AWS but with the 30GB OS disk I don't see how they would do that unless they make the OS disk free (or just fucking downgrade it to 8GB why the fuck does a Linux image require 30GB??????? AWS only requires a 8GB boot disk for Debian and GCP only requires 10GB, so it really is outrageous that Azure requires a 30GB OS disk).


EDIT:

A few years ago (in 2019) Lerdorf wrote this blog post comparing different cheap VPS providers: https://toys.lerdorf.com/low-cost-vps-testing

He obtained the follow numbers for AWS Lightsail disk performance:

Disk IO 65 MB/s write, 65 MB/s read

However, that was back in 2019. In 2020 AWS introduced gp3 disks which are newer and more performant than the old SSDs:

In December 2020, AWS announced general availability of a new Amazon EBS General Purpose SSD volume type, gp3. AWS designed gp3 to provide predictable 3,000 IOPS baseline performance and 125 MiB/s, regardless of volume size. With gp3 volumes, you can provision IOPS and throughput independently, without increasing storage size, at costs up to 20% lower per GB compared to gp2 volumes. 

Unlike gp2 where performance is tied to disk size, with gp3 you always get the same performance regardless of disk size which is really good if you want to have a really small disk with decent performance (which is exactly I want). And also gp3 is 20% cheaper than gp2.

To test this, I spun up a t4g.nano with 9GB of gp3 and ran fio and got these results:

Run status group 0 (all jobs):
 WRITE: bw=131MiB/s (137MB/s), 131MiB/s-131MiB/s (137MB/s-137MB/s), io=7996MiB (8384MB), run=61240-61240msec

Disk stats (read/write):
 nvme0n1: ios=2347/32762, merge=28/179, ticks=11093/3568868, in_queue=3579960, util=99.43%

When I saw this I was shocked. I had misread the 125MiB/s as MEGABITs per second, but actually it's MEBIBYTEs per second, which is over 8 times larger! So 125 megabits per second is only around 15.6 megaBYTES per second (which is pretty slow, even for spinning rust) but actually AWS gp3 gives 125 MEBIBYTES per second which is around 131 megaBYTES per second, which is pretty good!


There is also Oracle Cloud which gives you 200GB of Always Free storage. If you select the highest performance disk then you can get around 100MB/s throughput at around 60GB of disk storage, which I think is within the Always Free tier usage limit but I'm not sure, will have to wait and see if Oracle charges me for it.


Anyway, I didn't measure Azure disk performance.



No comments:

Post a Comment