PostgresBench: A Reproducible Benchmark for Postgres Services
62 points
4 hours ago
| 8 comments
| clickhouse.com
| HN
ahachete
20 minutes ago
[-]
My 2 cents:

> Each run lasts 10 minutes, long enough to move past warmup and capture stable throughput

But short enough not to show the effect of checkpoints (which is quite noticeable). It's not representing a realistic workload. I'd use at the very least 30mins with checkpoint_timeout=5mins so you get at least 6 checkpoint cycles.

> We report average TPS, average latency, P95 latency, and P99 latency

Unless I'm mistaken, only average TPS is reported, but not TPS over time. Again, it varies a lot (especially due to checkpoints!) and you need variation over time to understand patterns and determine SLAs.

> We tested two scale factors: 6849 (~100 GB) and 34247 (~500 GB).

I'd set them an order of magnitude apart (100GB and 1TB). 1TB+ is nowadays not unseen and therefore represents a step into the scale path that I believe should also be compared.

> While all services offer high availability, the underlying architectures differ. Some use standby replication, others use shared or distributed storage layers. Since we are focused on single-node compute and storage performance, we tested without HA enabled to isolate that.

So again, it's not realistic. The impact of HA in production is quite measurable in performance, especially if semi-sync is used.

But more importantly, you are comparing systems that are already redundant and highly available (e.g. Aurora, writing six copies of the data) with a single-instance one writing (if I'm not mistaken) to an ephemeral local NVMe. This is watermelons to grapes comparison (I assume HA CH clusters talk over the network for each confirmed transaction; but here they only go to local NVMe).

> Default Postgres configuration

I believe this is a mistake. Postgres must be tuned (at least to a reasonable degree) and try to homogenize the configuration across the tested systems. Otherwise you are not benchmarking Postgres, but rather the conservationism in the decisions of the default configurations of the managed services.

> We did not compare pricing.

So you leave the fun part out?

> Systems included

I miss a self-managed EC2 cluster (with local NVMe) for comparison.

reply
saisrirampur
5 minutes ago
[-]
Ack on most points i.e. duration, scale factor (data size) and pricing. We will try incorporating these in the next iterations.

In regards to HA, partly agreed. We are working on adding HA setup as we speak, should be released soon. However note that the local NVMe setup does have backups and WAL-archival to S3, which provides data-durability with RPO of 10s of seconds. Even with HA setup I expect performance difference to be similar across systems (may be slightly lesser), as round-trip to secondary is common across most other services except Neon, whose reliability/availability story hasn’t been a strong area in general.

In regards to default configs, that was intentional as default tuning is a differentiation across services and that needs to be measured. However we plan to add more configurability on postgres tuning in the future.

Appreciate your feedback, super helpful!

reply
karlmush
5 minutes ago
[-]
It’s a nice project, but it doesn’t seem like the open-source community has really picked it up yet. It’s been live since May, but there aren’t many GitHub stars so far and contributors.
reply
cuu508
1 hour ago
[-]
It would be interesting to see vanilla postgres on a VPS and vanilla postgres on a bare metal server included too. I understand it's apples and oranges, but would it be slower, would it be faster, by how much?
reply
nwhnwh
1 hour ago
[-]
It doesn't matter if it is apples and oranges, as long as it is an option customers care about. So, I hope that would be included too.
reply
saisrirampur
5 minutes ago
[-]
Good feedback, we will aim to include them in the future.
reply
whitepoplar
3 hours ago
[-]
I'm curious to know how PlanetScale Postgres would fare.
reply
karlmush
12 minutes ago
[-]
Me too! Were they left out on purpose?
reply
saisrirampur
1 minute ago
[-]
It wasn’t left out on purpose, it was just prioritization, we chose 5 that most commonly came up. Please feel free to submit a PR, it should be pretty straightforward.
reply
aurareturn
2 hours ago
[-]
I was just looking for something like this. I think there is a lack of benchmarks between Postgres cloud instances across different clouds. They all offer the same features mostly and cost about the same, but we don't know how they perform.
reply
datadrivenangel
2 hours ago
[-]
If I had ~$10,000k to burn, I would give Claude Code an AWS account and this benchmark and have it generate parameter spaces and optimize the configuration for transaction processing by just changing the configuration.
reply
paulddraper
12 minutes ago
[-]
You could do an enormous number of things for $10,000k.
reply
schultzer
2 hours ago
[-]
While it’s important to focus on the backend itself, why don’t anyone focus on the clients which talk to the databases, it is there most of an applications problem starts also in regards to performance.
reply
__s
2 hours ago
[-]
Lack of protocol compression is painful with postgres
reply
jelder
14 minutes ago
[-]
Untrue since the introduction of zstd support in PostgreSQL 15.
reply
psc007
2 hours ago
[-]
Tldr? Can I use this to benchmark my own CNPG on k8s to see if there is improvement to be made on the deployment?
reply
saisrirampur
2 hours ago
[-]
Yes, you absolutely can. It takes 15 mins to run the benchmark amd get results.
reply