This post has results for the Insert Benchmark on a large server with an IO-bound workload. The goal is to compare new Postgres releases with older ones to determine whether get better or worse over time. The results here are from a large server (32 cores, 128G RAM). Results from the same setup with a cached workload are here.
This work was done by Small Datum LLC.
tl;dr
- There are no regressions from Postgres 16.3 to 17beta1 for this benchmark
- The patch to enforce VISITED_PAGES_LIMIT during get_actual_variable_range fixes the problem with variance from optimizer CPU overhead during DELETE statements, just as it did on a small server and also on a large server with a cached workload. And 17beta1 with the patch gets ~12X more writes/s than without the patch.
- This is my first result with ext4. I had to switch because XFS with the 6.5 kernel (HWE enabled, Ubuntu 22.04) don't play great together for me
For 17beta1 I also tried a build with a patch to enforce VISITED_PAGES_LIMIT during get_actual_variable_range and the results are great (as they were previously great in the results explained here).
The benchmark steps are:
- l.i0
- insert 300 million rows per table in PK order. The table has a PK index but no secondary indexes. There is one connection per client.
- l.x
- create 3 secondary indexes per table. There is one connection per client.
- l.i1
- use 2 connections/client. One inserts 4M rows per table and the other does deletes at the same rate as the inserts. Each transaction modifies 50 rows (big transactions). This step is run for a fixed number of inserts, so the run time varies depending on the insert rate.
- l.i2
- like l.i1 but each transaction modifies 5 rows (small transactions) and 1M rows are inserted and deleted per table.
- Wait for X seconds after the step finishes to reduce variance during the read-write benchmark steps that follow. The value of X is a function of the table size.
- qr100
- use 3 connections/client. One does range queries and performance is reported for this. The second does does 100 inserts/s and the third does 100 deletes/s. The second and third are less busy than the first. The range queries use covering secondary indexes. This step is run for 1800 seconds. If the target insert rate is not sustained then that is considered to be an SLA failure. If the target insert rate is sustained then the step does the same number of inserts for all systems tested.
- qp100
- like qr100 except uses point queries on the PK index
- qr500
- like qr100 but the insert and delete rates are increased from 100/s to 500/s
- qp500
- like qp100 but the insert and delete rates are increased from 100/s to 500/s
- qr1000
- like qr100 but the insert and delete rates are increased from 100/s to 1000/s
- qp1000
- like qp100 but the insert and delete rates are increased from 100/s to 1000/s
- insert/s for l.i0, l.i1, l.i2
- indexed rows/s for l.x
- range queries/s for qr100, qr500, qr1000
- point queries/s for qp100, qp500, qp1000
- Postgres 16.3 (pg163_def.cx9a2a_c32r128)
- Postgres 17beta1 unchanged (pg17beta1_def.cx9a2a_c32r128)
- Postgres 17beta1 with the patch to enforce VISITED_PAGES_LIMIT (pg17beta1_def_hack100.cx9a2a_c32r128)
- Postgres 16.3 and 17beta1 have similar performance
- The patch to enforce VISITED_PAGES_LIMIT is great (see impact for l.i1, l.i2)
- From the summary the write rate is ~1.1X larger in l.i1 and ~12X larger in l.i2 for 17beta1 with the patch vs without.
- From the vmstat metrics for l.i1 and l.i2 the CPU overhead with the patch is ~1/3 of what it is without the patch. See the cpupq (CPU/operation) and cpups (CPU utilization) columns.
- From the per-second charts for l.i2 there is more variance in the results for 17beta1 with the patch because it is doing ~12X more write/s (see 17beta1 without and with the patch)
- l.i0
- relative QPS is 1.19 in PG 16.3
- relative QPS is 1.24 in PG 17beta1 unchanged
- relative QPS is 1.27 in PG 17beta1 with VISITED_PAGES_LIMIT patch
- l.x - I ignore this for now
- l.i1, l.i2
- relative QPS is 1.44, 1.68 in PG 16.3
- relative QPS is 1.41, 1.56 in PG 17beta1 unchanged
- relative QPS is 1.55, 19.25 in PG 17beta1 with VISITED_PAGES_LIMIT patch
- qr100, qr500, qr1000
- relative QPS is 1.04, 1.08, 1.17 in PG 16.3
- relative QPS is 1.04, 1.07, 1.14 in PG 17beta1 unchanged
- relative QPS is 1.03, 1.09, 1.27 in PG 17beta1 with VISITED_PAGES_LIMIT patch
- qp100, qp500, qp1000
- relative QPS is 1.00, 1.02, 1.09 in PG 16.3
- relative QPS is 1.00, 1.02, 1.11 in PG 17beta1 unchanged
- relative QPS is 1.00, 1.03, 1.14 in PG 17beta1 with VISITED_PAGES_LIMIT patch