DEV Community

Cover image for DB Mysql/Postgres on AWS vs Hetzner
Devops Makeit-run
Devops Makeit-run

Posted on • Originally published at make-it.run

DB Mysql/Postgres on AWS vs Hetzner

MySQL Performance on Hetzner vs AWS: Storage Considerations

MySQL performance frequently hinges on disk I/O capabilities, particularly regarding small random reads/writes and low latency. Choosing the right storage can significantly impact throughput and response times for OLTP workloads.

Hetzner Storage Options

Cloud Volumes (Network-Attached Storage)

Hetzner Cloud offers Cloud Volumes, which are network-attached block storage replicated triply across servers for durability. However, these volumes are limited by network overhead and replication processes. Official documentation caps them at up to 5,000 sustained IOPS (7,500 burst) and 200 MB/s sustained throughput (300 MB/s burst).

In practice, real-world random-write IOPS are often much lower. For example, a fio test on a 4 GB Hetzner volume measured about ~325 IOPS (1.3 MB/s) for 4K random writes.

Local NVMe SSDs

The high-performance alternative is Hetzner’s local NVMe SSDs, available on dedicated servers and selected cloud instances. NVMe operates over PCIe with bandwidths up to 32 Gbps and supports extensive parallelism, ideal for heavy I/O workloads.

Benchmarks reflect this advantage: a community test showed around ~33,000 4K read IOPS on Hetzner NVMe storage — more than 10× faster than typical cloud volumes and vastly outperforming AWS EBS general-purpose volumes. Sequential throughput is similarly higher, topping at about 1,100 MB/s compared to roughly 125 MB/s on AWS EBS gp3 volumes.

Hetzner vs AWS IOPS Benchmark

AWS Storage Options

AWS offers a wide range of Elastic Block Store (EBS) volumes suitable for diverse MySQL workloads:

  • gp3 volumes: Default 3,000 IOPS and 125 MB/s throughput, configurable up to 16,000 IOPS
  • io2 and io2 Block Express: High-end storage with tens of thousands of IOPS and consistent sub-millisecond latencies suitable for mission-critical databases

While AWS can match or exceed Hetzner’s local NVMe performance with the right storage choice, these come at a higher cost — often $20+ extra per volume per month to reach parity with basic Hetzner volumes. Amazon’s managed database services, such as RDS and Aurora, also simplify scaling and tuning by optimizing IO under the hood, though again at additional expense.

Implications for MySQL Deployments

MySQL workloads, especially those heavy on OLTP and random I/O, benefit greatly from fast, low-latency storage.

Key takeaways include:

  • Deployment on Hetzner Cloud volumes offers modest IOPS that may suffice for small to medium traffic sites but can be a bottleneck under heavy load.
  • Using Hetzner’s local NVMe SSDs can deliver high throughput, often outperforming similarly priced AWS VM instances in CPU and disk benchmarks, at a fraction of the cost.
  • AWS provides more options for ultra-high IO performance and managed scaling (io2 volumes, Aurora) with sub-millisecond latencies, ideal for mission-critical, high-scale databases.
  • Cost-performance trade-offs favor Hetzner for moderate loads and budgets; AWS is attractive for those needing top-tier performance and simplified managed services.

Benchmarking with your specific MySQL workload is recommended to guide the best choice.

Summary

Feature Hetzner Cloud Volumes Hetzner NVMe SSD AWS gp3 EBS AWS io2 (or io2 Block Express)
Max Random IOPS ~325 IOPS (realistic) ~33,000 IOPS 3,000 IOPS (default) Up to 64,000+ IOPS
Max Sequential Throughput ~200-300 MB/s (burst) ~1,100 MB/s ~125 MB/s Up to multiple GB/s
Latency Single-digit milliseconds Low (PCIe speed) Single-digit milliseconds Sub-millisecond
Cost Low Moderate Moderate High
Managed DB Options None (self-managed) None (self-managed) RDS available Aurora available

References

Top comments (0)