HeadlinesBriefing favicon HeadlinesBriefing.com

PostgreSQL Benchmark: Hostim vs. AWS RDS vs. Hetzner

Hacker News •
×

A benchmark comparing PostgreSQL 16 performance across Hostim, AWS RDS, and self-hosted Hetzner at identical specifications (2 vCPU/4GB RAM) reveals significant performance disparities. Hostim demonstrated the highest write throughput, achieving approximately 2.5x that of AWS RDS db.t4g.medium and 2.1x a default self-hosted Hetzner setup. Reads, however, favored the self-hosted Hetzner instance due to its raw per-core CPU speed, with RDS lagging on both metrics.

The benchmark utilized pgbench with a scale factor of 50, ensuring the dataset fit into RAM to measure CPU and commit path performance. Critical differences in write performance were attributed to storage fsync latency on the commit path, particularly impacting network-attached block storage used by RDS and self-hosted options. The default configurations were tested: Hostim's managed tuning, AWS's default parameter group, and a stock PostgreSQL installation on Hetzner.

Beyond raw performance, the total cost of ownership presents a stark contrast. AWS RDS's listed price significantly underrepresents the true cost, which escalates with storage, provisioned IOPS, backups, and data transfer. High availability requirements further inflate RDS costs, necessitating Multi-AZ configurations that double instance and storage expenses and slow writes. Hostim includes replication by default at its €50 price point, while achieving similar resilience on Hetzner requires adding a second VPS and managing replication and failover infrastructure manually.