Show HN: PostgreSQL performance and cost across 23 EC2 instance types

63 points - today at 12:40 PM


Hey! I'm Andrei.

I got frustrated by how people tend to build overcomplicated backend systems, being "motivated" by big tech case studies and popular books.

So, I started exploring lean architecture, and building my digital garden of ideas, approaches and data that align with this direction.

Here I want to present one of the tools – Sizing tool for PostgreSQL. I've benchmarked PostgreSQL on different EC2 instances and disks, with different initial data sets to see performance that these instances can give you. And I've built a tool to visualize this data, which I welcome you to explore.

So, you can put your usual input parameters, like needed RPS and disk size as input, and find out which instance will be the most cost-efficient for your needs.

You can read about the methodology here: https://postgres.saneengineer.com/about

I've tested one workload – mixed 90/10 read/write, and only selected configurations. But it is extensible, and I (and you – benchmark is open source: https://github.com/anivaniuk/sanebench) can run more configurations to have more data represented.

Does it look interesting? What workload should I benchmark next?

Source

Comments

nijave today at 5:13 PM
Would be interesting to see huge pages and io2 impact.

I did a smaller version on Azure and disk latency had a massive impact much more so than max IOPs (although their crappy storage offering needed like 64-128 iodepth to get advertised iops).

Results seem mostly in line with expectations. Iirc vcpu is threads so on arm64 you get 4 smt1 cores vs Intel/AMD you get 2 smt2 cores.

mattlong today at 5:28 PM
I'd be very curious to see you add the Optimized Reads instance types, e.g. r8gd or m8gd, to your benchmark. They add a local NVMe-based SSD block storage that serves as a cache in front of the network-based disks among other use cases. They have been a huge win for us for a read-heavy workload where the dataset is significantly larger than memory.

Edit: Apologies, on a closer read, I realize you were not testing RDS but managing Postgres on EC2 directly.

ballislife30 today at 4:11 PM
Would love to see a comparison between Aurora PostgreSQL and self-host PostgreSQL on the same EC2 instance type.
crudgen today at 5:14 PM
Interesting, is there something like this for azure
rnagulapalle today at 3:51 PM
[flagged]
deleted today at 1:07 PM