I thought it would be fun to benchmark the performance of S3 providers on “cheap” VMs. It’s a given that S3 to an EC2 machine performs fairly well as long as you’re in the same region. But what happens when you’re looking to save some money and avoid AWS altogether? How much performance are you giving up?
Let’s find out!
The S3 Providers
| Provider | Storage $/TB/mo |
Egress $/TB/mo |
Notes |
|---|---|---|---|
| Backblaze B2 | $6.95 | $10 | Bandwidth is free up to 3x storage usage |
| Cloudflare R2 | $15 | Free | Fine details on the free egress, but most usage falls within it |
| DigitalOcean Spaces | $20 | $10 | Minimum price is $5. Includes 250GB of storage and 1TB of egress |
| Amazon S3 | $23 | $90 | This is the king. Long live the king. |
All providers offer free ingress (data into S3). This is how they lock you into the platform!
First observation is that Backblaze stands out as a great deal both in terms of storage and egress.
In general, the biggest difference in pricing from Amazon is egress (data out of S3). The egress pricing for Amazon is bananas. You have to commit to sending your data to Amazon because it costs so much to get the data out.
I considered these other providers but I had some issues:
| Provider | Storage | Egress | Why I didn’t test it |
|---|---|---|---|
| Contabo Object Storage | $11.96 | Free | Max advertised throughput is only 10 megabytes / s |
| Wasabi | $7.99 | Free | Minimum of $7.99/mo. I used to have an account. I won’t create a new one just for this test |
| Vultr Object Storage | $20 | $10 | I was able to create a bucket in the panel but it wasn’t accessible via the API |
There’s many other providers but I don’t have infinite time. Reach out to me if you’d like to see a follow up with another provider.
The benchmark details
I setup two buckets in each of the S3 providers: one in the US east region and one in the US west region.
I then spun up one VM host for each hosting provider in the US east region. This allows us to test if a higher RTT affects throughput.
For each of the VM hosts, I upload and then download files of different sizes:
- 100 kilobytes
- 1 mebabytes
- 10 megabytes
- 100 megabytes
For each upload/download operation I take 10 samples so I can measure the standard deviation.
For each operation I also attempt different levels of concurrency. For uploads I do multipart uploads of the files. For the smaller files we cannot test more than one level of concurrency since there’s a minimum size for each part in a multipart upload.
For downloads I do multiple HTTP range requests for the file. For example, when downloading the 100 kilobyte file with a concurrency of 2 we would execute two simultaneous requests: one for the first 50 kilobytes and the other for the last 50 kilobytes.
I stand up each VM host as close as possible to AWS’s us-east-1. I’m assuming that the other providers are geographically close.
Finally before each operation, I do a HeadBucket request to measure the Round Trip Time (RTT). Why this instead of just a plain old ICMP ping? Because some providers blocked the poings 🤷.
Hypotheses
I have a couple of hunches.
1. Cheaper S3 hosts will have less consistent throughput
Because of the way S3 is designed, it’s more stable at larger scales. There’s a neat phenomenon where each tenant’s different bursty usage patterns smooth out into the average (see AWS re:Invent 2024 - Dive deep on Amazon S3 @ 13:16).
I’m assuming that Amazon is by far the biggest provider even including GCP and Azure. Amazon should have the most stable throughput given all the “extra” capacity they have at their scale.
2. Throughput is dependent on distance to the S3 provider
The closer you are to the service the more throughput. S3 works over HTTP which works over TCP.
TCP has a simple formula for maximum throughput:
Window Size / Round Trip Time (RTT)
Where window size is smaller of the advertised receive window and sender congestion window (in bytes). Roundtrip time negatively affects the throughput. Linux hosts usually have a window size of 8 megabytes according to https://www.openpcap.com/tcp/tcp-window-scaling.
So if we compare 50 ms vs 500ms:
8 megabyte / .5 s = 128 megabits / s
8 megabyte / .05 s = 1280 megabits / s
3. Throughput is dependent on the size of the object
Another assumption is that the bigger the file the higher the throughput.
When a TCP connection is established the sender sends packets and gradually increases the number of packets until it reaches a threshold. This mechanism works by the sender detecting missing ACKs for packets. ACKs are affected by RTT. The ramp up time is therefore affected by RTT.
If the file is smaller and the S3 service is far away (high RTT) then the TCP connection might not have enough time to reach full-throughput.
Summary
For context, here is the latency table for each host and each S3 provider. Each value is the mean RTT from the host to the S3 bucket.
As an example, I’ve marked first column, third row in red below.
This cell says: “From AWS EC2 it takes 4.5 ms to get a response from B2 East”
VM hosts
S3 providers
| AWS EC2 | Contabo | Digital Ocean | Hetzner | |
|---|---|---|---|---|
| AWS East | 4.7 ms | 14.4 ms | 11.4 ms | 5.7 ms |
| AWS West | 75.7 ms | 82.3 ms | 74.9 ms | 66.5 ms |
| B2 East | 4.5 ms | 12.1 ms | 32.6 ms | 3.2 ms |
| B2 West | 75.1 ms | 74.8 ms | 78.1 ms | 76.9 ms |
| DO Spaces East | 16.9 ms | 12.9 ms | 10.8 ms | 18.0 ms |
| DO Spaces West | 78.7 ms | 77.6 ms | 88.9 ms | 74.2 ms |
| R2 East | 62.7 ms | 64.1 ms | 48.2 ms | 52.1 ms |
| R2 West | 76.1 ms | 90.4 ms | 81.9 ms | 71.5 ms |
The only one that’s strange is R2 East. It’s almost the same RTT as the west region!
East <–> East
The results were NOT what I had expected.
First of all, the Contabo host has it’s bandwidth capped at 200 Mbits / s. Poor chap.
My first impression is that my first hypotheses was correct. S3 is way more consistent than the other providers. Look at that tiny standard deviation!
My second assumption also seems correct. R2 East has the worst latency of the east buckets and has the worst throughput. The digital ocean facilty seems to be the closest (mean RTT of 48.2 ms) and this one ends up being the fastest with R2 East!
Lastly, I never would have bet that Backblaze and DigitalOcean can beat S3 in throughput IN THEIR OWN DATACENTERS. As far as I know, they both have their own data centers and don’t colocate within Amazon. Maybe they do? They at least must have dedicated fiber connections to AWS to achieve this performance. So interesting.
This makes these S3 alternatives way more appealing. Specially DigitalOcean! They have really consistent performance.
East <–> West
Measuring throughput to the West regions gives a way more level playing field.
Here interstingly enough Cloudflare performs really well. It performed horribly in the East«-»East benchmark so they have a weird specialization in cross-region throughput?
The results per VM
Generally, I tried to keep all the VM instance sizing the same (2 vCPU and 4 GB RAM, attached drives). Except for the Contabo VPS which has way more CPU and RAM than it should at that price.
This took quite a while to measure and compile. Please enjoy the colorful graphs.
AWS ($55.84 / mo + $1.60 / mo storage)
The AWS EC2 machine I chose is c6a.large. It features
- 2 vCPU
- 4 GB RAM
- 20 GB Elastic Block Storage (EBS)
- “Up to 5 Gbps”
I chose this one over the similar t3a.medium instance since the t instances have bursty CPUs and I was worried the burstiness might affect the benchmark timings. Also it seems like a fairer comparison to other VMs, even if those other VMs offer “shared” vCPUs instead of dedicated vCPUs. This is yet another variable that’s hard to control since it’s unclear how much of vCPU you are provisioned in ANY cloud/provider.
RTT to AWS East measured a mean of 4.7 ms ± 3.5 ms over 190 samples
RTT to AWS West measured a mean of 75.7 ms ± 12.1 ms over 190 samples
RTT to B2 East measured a mean of 4.5 ms ± 7.5 ms over 190 samples
RTT to B2 West measured a mean of 75.1 ms ± 17.7 ms over 190 samples
RTT to DO Spaces East measured a mean of 16.9 ms ± 6.1 ms over 190 samples
RTT to DO Spaces West measured a mean of 78.7 ms ± 18.6 ms over 190 samples
RTT to R2 East measured a mean of 62.7 ms ± 60.2 ms over 190 samples
RTT to R2 West measured a mean of 76.1 ms ± 22.9 ms over 190 samples
Contabo ($7.51 / mo)
The cheapest and (unsurprisingly) worst performer! The price displayed is after a 12 month commitment.
This is a Cloud VPS 4 Core server. It features
- 4 vCPU (shared)
- 8 GB RAM
- 100 GB SSD (?)
- 200 Mbps
It seemed like a bonkers deal and I slighty regret it because the disk is not an NVMe and may not even be an SSD. The drive performance is palpable. It adds quite a bit of wait to every operation. Go compilation no longer feels instant :(
The biggest limitation is the 200 Mbps. It’s less than what I get at home!
RTT to AWS East measured a mean of 14.4 ms ± 7.5 ms over 190 samples
RTT to AWS West measured a mean of 82.3 ms ± 19.2 ms over 190 samples
RTT to B2 East measured a mean of 12.1 ms ± 8.5 ms over 191 samples
RTT to B2 West measured a mean of 74.8 ms ± 18.2 ms over 190 samples
RTT to DO Spaces East measured a mean of 12.9 ms ± 4.7 ms over 190 samples
RTT to DO Spaces West measured a mean of 77.6 ms ± 19.5 ms over 190 samples
RTT to R2 East measured a mean of 64.1 ms ± 26.5 ms over 190 samples
RTT to R2 West measured a mean of 90.4 ms ± 33.8 ms over 190 samples
DigitalOcean ($24 / mo)
The Digital Ocean Droplet used the NYC3 region to give it the best home field advantage with the NYC3 Spaces storage. It has…
- 2 vCPU (shared)
- 4 GB RAM
- 80 GB SSD
- 1 Gbps
Notably this one offer 1 Gbps. This machine feels way snappier than the Contabo VPS.
RTT to AWS East measured a mean of 11.4 ms ± 4.8 ms over 190 samples
RTT to AWS West measured a mean of 74.9 ms ± 11.6 ms over 190 samples
RTT to B2 East measured a mean of 32.6 ms ± 28.6 ms over 190 samples
RTT to B2 West measured a mean of 78.1 ms ± 30.4 ms over 191 samples
RTT to DO Spaces East measured a mean of 10.8 ms ± 5.7 ms over 190 samples
RTT to DO Spaces West measured a mean of 88.9 ms ± 19.7 ms over 190 samples
RTT to R2 East measured a mean of 48.2 ms ± 17.7 ms over 190 samples
RTT to R2 West measured a mean of 81.9 ms ± 25.6 ms over 190 samples
Hetzner (€17.49 | ~$19.28 / mo)
The Hetzner VM used the ash-1 region. I thought this would be really close to the AWS S3 east region and it was! Mean RTT was 5.7 ms! The specs:
- 2 vCPU (shared)
- 4 GB RAM
- 80 GB SSD
- 1 Gbps
This feels a little snappier than the Digital Ocean Droplet. I’ve used Hetzner for a long time up until they hit me with 2 price increases in 6 months. Up until that moment, I was very satisfied with the CPU and disk performance.
RTT to AWS East measured a mean of 5.7 ms ± 3.8 ms over 190 samples
RTT to AWS West measured a mean of 66.5 ms ± 12.4 ms over 190 samples
RTT to B2 East measured a mean of 3.2 ms ± 6.0 ms over 191 samples
RTT to B2 West measured a mean of 76.9 ms ± 22.0 ms over 190 samples
RTT to DO Spaces East measured a mean of 18.0 ms ± 9.5 ms over 190 samples
RTT to DO Spaces West measured a mean of 74.2 ms ± 17.5 ms over 190 samples
RTT to R2 East measured a mean of 52.1 ms ± 40.2 ms over 190 samples
RTT to R2 West measured a mean of 71.5 ms ± 23.4 ms over 190 samples
Closing thoughts
You can download the benchmark database in case you’re curious. Some quick info about it:
$ gunzip reporting_clean.db.gz
$ sqlite3 reporting_clean.db
reporting_clean.db-> .schema
CREATE TABLE metrics (
metric_name TEXT NOT NULL,
labels TEXT NOT NULL CHECK (json_valid(labels) AND json_type(labels) = 'object'),
value
);
reporting_clean.db-> SELECT
COUNT(*), json_extract(labels, '$.host') as host
FROM metrics
GROUP BY host;
╭──────────┬────────────────────╮
│ COUNT(*) │ host │
╞══════════╪════════════════════╡
│ 5520 │ aws-us-east-1 │
│ 5522 │ contabo │
│ 5522 │ digital-ocean-nyc3 │
│ 5522 │ hetzner-ash-1 │
╰──────────┴────────────────────╯
reporting_clean.db-> SELECT
DISTINCT metric_name
FROM metrics
ORDER BY metric_name;
╭─────────────────────────────╮
│ metric_name │
╞═════════════════════════════╡
│ download_attempts_count │
│ download_rtt_ms │
│ download_throughput_bytes_s │
│ download_ttfb_ms │
│ upload_attempts_count │
│ upload_failures_count │
│ upload_rtt_ms │
│ upload_throughput_bytes_s │
╰─────────────────────────────╯
When I started this benchmarking pursuit, I didn’t expect to get these wacky results. I swear everytime I profile performance I’m surprised in one way or another.
This took a lot of time to organize, compile the data, and more importantly demonstrate in a digestible format. I’m out of words haha.
I’m happy to discuss this in hackernews, bluesky, reddit, oldreddit.