Monday, September 11, 2023

Checking jemalloc versions for RSS regressions with MyRocks and the Insert Benchmark

I previously shared a blog post with results for jemalloc, tcmalloc and glibc malloc vs MyRocks and the Insert Benchmark. The summary was to use jemalloc or tcmalloc with MyRocks, or anything that uses RocksDB, because they are much better than glibc malloc at reducing the peak RSS.

Today I share results for the same benchmark using jemalloc versions from 4.0.4 to 5.3.0.

tl;dr

  1. There was a big regression WRT peak RSS in jemalloc 4.4.0 and 4.5.0
  2. It was mostly fixed in 5.0.1 and 5.1.0
  3. It was fixed more in 5.2.0
  4. It was fully fixed in 5.3.0

Benchmarks

My previous post explains the benchmark and HW. New details here is that I compiled many versions of jemalloc from source -- 4.0.4, 4.1.1, 4.2.1, 4.3.1, 4.4.0, 4.5.0, 5.0.1, 5.1.0, 5.2.0, 5.3.0 -- and repeated the benchmark for each. This was done twice using different sizes for the RocksDB block cache: 40G and 60G. And then I also repeated things twice -- once using the (older) LRU block cache, once using the (newer) Hyper Clock cache.

I made no attempt to tune or configure jemalloc. Perhaps I will learn whether that was a big deal but I already have more than enough tuning to manage in the DBMS and I prefer to not tune the allocator.

Results

All numbers are here - see lines 16 to 67.

The summary is:

  1. There was a big regression WRT peak RSS in jemalloc 4.4.0 and 4.5.0
  2. It was mostly fixed in 5.0.1 and 5.1.0
  3. It was fixed more in 5.2.0
  4. It was fully fixed in 5.3.0


Wednesday, September 6, 2023

Chasing a performance regression in MyRocks vs the Insert Benchmark

I found a few performance regressions with the Insert Benchmark and MyRocks on a large server and this explain the start of my search to for the root causes. The regressions are described in an earlier blog post (see the summaries here and here).

Update - the builds I used were bad so the results here are bogus. I fixed the builds, repeated the tests and share results here. There are no regressions and the initial load of the benchmark is ~10% faster in modern MyRocks.

The mystery

Note that l.i1, q100, q500, q1000 are benchmark steps explained here.

With MyRocks from FB MySQL 5.6.35

  1. Throughput drops by ~5% for l.i1 and ~5% for q100, q500, q1000 between fbmy5635_202203072101 and fbmy5635_202205192101. The former release is from 2022/03/07 with RocksDB 6.28.2 and the latter is from 2022/05/19 with RocksDB 7.2.2.
  2. After fbmy5635_202205192101.cy9c5_u the throughput for the read-write benchmark steps (q100, q500, q1000) gradually declines by another ~5%
  3. Throughput drops by ~5% for l.i1 between fbmy5635_202210112144 and fbmy5635_202302162102. The former release is from 2022/10/11 with RocksDB 7.3.1 and the latter is from 2023/02/16 with RocksDB 7.10.0
I will start with problem 3 -- the l.i1 regression between fbmy5635_202210112144 and fbmy5635_202210112144. 

This is an interesting problem

  • I assume the problem is more likely from changes to RocksDB than from changes to MyRocks 5.6.35 because RocksDB source gets more changes.
  • The pure-RocksDB benchmarks might not detect these regressions, but I will revisit that.
  • Running the Insert Benchmark on a small and medium server does not detect this regression. I have only seen it this bad on a large server and the large server not only has more cores but has 2 sockets.
Builds

First there is the base build:

  • fbmy5635_rel_202210112144 - from 20221011 at git hash (c691c7160 MySQL, 8e0f4952 RocksDB), RocksDB 7.3.1
Then there are variants that use the same MyRocks source as the base but with a more recent version of RocksDB:
  • fbmy5635_20221011_732 - base with RocksDB 7.3.2
  • fbmy5635_20221011_743 - base with RocksDB 7.4.3
  • fbmy5635_20221011_745 - base with RocksDB 7.4.5
  • fbmy5635_20221011_750 - base with RocksDB 7.5.0
  • fbmy5635_20221011_751 - base with RocksDB 7.5.1
  • fbmy5635_20221011_752 - base with RocksDB 7.5.2
  • fbmy5635_20221011_753 - base with RocksDB 7.5.3
  • fbmy5635_20221011_754 - base with RocksDB 7.5.4
  • fbmy5635_20221011_760 - base with RocksDB 7.6.0
  • fbmy5635_20221011_778 - base with RocksDB 7.7.8
  • fbmy5635_20221011_783 - base with RocksDB 7.8.3
  • fbmy5635_20221011_793 - base with RocksDB 7.9.3
  • fbmy5635_20221011_7102 - base with RocksDB 7.10.2

Benchmark

The insert benchmark was run in one setup -- cached by RocksDB and all tables fit in the RocksDB block cache. The server has 80 HW threads, 40 cores, 256G of RAM and fast NVMe storage with XFS. The configuration files (my.cnf) are here: base and c5. The difference between them is that c5 adds rocksdb_max_subcompactions=4.

The benchmark is run with 24 clients, 24 tables and a client per table. The benchmark is a sequence of steps.

  • l.i0
    • insert X million rows across all tables without secondary indexes where X is 20 for cached and 500 for IO-bound
  • l.x
    • create 3 secondary indexes. I usually ignore performance from this step.
  • l.i1
    • insert and delete another 50 million rows per table with secondary index maintenance. The number of rows/table at the end of the benchmark step matches the number at the start with inserts done to the table head and the deletes done from the tail.
  • q100, q500, q1000
    • do queries as fast as possible with 100, 500 and 1000 inserts/s/client and the same rate for deletes/s done in the background. Run for 7200 seconds.
Results

Performance reports are here for Cached by RocksDB (base config and c5 config). The regressions are easy to see in the second table in the Summary section (for base config and c5 config).

For l.i1 the regressions occur at:
  • From RocksDB 7.4.5 to 7.5.0 (fbmy5635_20221011_745 to fbmy5635_20221011_750) the relative throughput drops from 1.00 to 0.93 for the base config and from 1.00 to 0.94 for the c5 config.
  • There is a transient drop from 7.5.0 to 7.5.4 for the base config. I ignore that for now.
  • From RocksDB 7.8.3 to 7.9.3 (fbmy5635_20221011_783 to fbmy5635_20221011_793) the relative throughput drops from 0.93 to 0.90 for the base config and 0.95 to 0.90 for the c5 config.
What comes next?
  • For the regression between 7.4.5 and 7.5.0 I will look at the diffs added to 7.5.0. There are no releases in between them. I might do a custom build that gets some of the 7.5.0 diffs. I checked the RocksDB LOG and confirmed the RocksDB 7.5.0 build is at git hash 7506c1a4ca. I will use a build from b283f041f58de in the 7.5.fb branch which has a change that is also in 7.4.5 and then do move forward to test more diffs in 7.5.fb.
  • For the regression between 7.8.3 and 7.9.3 I will repeat tests for 7.9.0, 7.9.1 and 7.9.2
  • Eventually I will look at flamegraphs. Perhaps differential flamegraphs will be useful if the code hasn't changed too much.
  • Struggle to remember whether I previously reported this as a perf issue and then forgot


Saturday, September 2, 2023

Postgres 16, sysbench and a small server

This post has results for Postgres 15 and 16 versus sysbench on a small server. I am searching for performance regressions. All tests use 1 database connection as my focus here is on CPU regressions. I will repeat this on larger hardware with more concurrency to search for problems with mutexes and RW-locks.

tl;dr

  • I did not find any significant CPU regressions. Throughput in PG 16rc1 is similar to 15.2. There might be small regressions (1% or 2%) but I won't claim my current setup is able to detect them.
  • From past work I know that Postgres has been great at avoiding regressions over time.

Builds

I compiled Postgres 15.2, 15.3, 15.4, 16 beta1, 16 beta2, 16 beta3 and 16 rc1 from source. The builds are named o3_native_lto which is shorthand for using: -O3 -march=native -mtune=native -flto.

Benchmark

I used sysbench and my usage is explained here. Postgres was configured to cache all tables.

This benchmark used the Beelink server explained here that has 8 cores, 16G RAM and 1TB of NVMe SSD with XFS and Ubuntu 22.04. 

The benchmark is run with 1 client and 1 table with 20M rows. The read-only tests ran for 600 seconds each and the other tests ran for 1200 seconds each. The command line for my wrapper scripts is:

bash r.sh 1 20000000 600 1200 nvme0n1 1 1 1

The benchmark was repeated using the a1 and a2 configs. They differ in the value for wal_compression: a1 uses lz4 and a2 uses off.

Results

The results below use relative throughput which is: (QPS for $version / QPS for version 15.2). A value larger than 1.0 means that $version gets more QPS than 15.2. I will wave my hands and claim a result greater than 1.05 or less than 0.95 is significant. There are few such numbers in the results below.

Results with the a1 config

Relative to: pg152_o3_native_lto.x9a1_bee
col-1 : pg153_o3_native_lto.x9a1_bee
col-2 : pg154_o3_native_lto.x9a1_bee
col-3 : pg16beta1_o3_native_lto.x9a1_bee
col-4 : pg16beta2_o3_native_lto.x9a1_bee
col-5 : pg16beta3_o3_native_lto.x9a1_bee
col-6 : pg16rc1_o3_native_lto.x9a1_bee

col-1   col-2   col-3   col-4   col-5   col-6
0.99    1.04    1.00    1.00    1.03    1.02    hot-points_range=100
0.95    0.85    0.95    0.98    0.86    1.00    point-query.pre_range=100
1.17    1.10    1.01    1.10    1.00    1.09    point-query_range=100
0.99    1.00    1.00    1.01    1.01    1.02    points-covered-pk.pre_range=100
1.00    1.00    1.00    1.01    1.01    1.01    points-covered-pk_range=100
0.99    1.00    1.00    1.01    1.00    1.01    points-covered-si.pre_range=100
1.00    1.00    1.00    1.02    1.01    1.02    points-covered-si_range=100
0.99    1.00    1.00    1.01    1.00    1.01    points-notcovered-pk.pre_range=100
0.99    1.00    1.01    1.01    1.01    1.01    points-notcovered-pk_range=100
0.99    0.99    1.00    1.01    1.00    1.01    points-notcovered-si.pre_range=100
0.99    1.00    1.01    1.01    1.01    1.01    points-notcovered-si_range=100
0.99    1.00    1.01    0.99    1.01    1.01    random-points.pre_range=1000
1.00    1.00    0.99    0.99    1.01    1.01    random-points.pre_range=100
0.99    1.00    1.01    1.00    0.99    1.00    random-points.pre_range=10
0.99    1.00    1.01    1.00    1.01    1.00    random-points_range=1000
0.99    1.00    1.00    1.00    1.00    1.00    random-points_range=100
0.99    1.00    1.01    1.00    0.99    1.00    random-points_range=10
1.00    1.00    0.98    0.98    0.95    0.99    range-covered-pk.pre_range=100
1.02    1.01    0.99    1.00    0.97    0.99    range-covered-pk_range=100
1.01    1.00    0.99    1.00    0.97    0.98    range-covered-si.pre_range=100
1.01    1.00    0.99    1.00    0.96    0.98    range-covered-si_range=100
1.01    1.00    0.98    0.99    0.97    0.99    range-notcovered-pk.pre_range=100
1.01    1.00    0.99    1.00    0.99    1.00    range-notcovered-pk_range=100
1.00    0.99    0.98    0.98    0.97    0.98    range-notcovered-si.pre_range=100
1.00    0.99    0.99    0.99    0.98    0.99    range-notcovered-si_range=100
1.00    1.07    1.56    1.09    1.07    1.05    read-only.pre_range=10000
1.00    1.02    1.02    1.03    1.02    1.01    read-only.pre_range=100
1.04    1.00    1.01    1.06    0.98    1.05    read-only.pre_range=10
1.01    1.06    1.43    1.08    1.07    1.06    read-only_range=10000
1.00    1.02    1.02    1.03    1.02    1.01    read-only_range=100
0.97    0.99    0.99    0.96    0.97    0.95    read-only_range=10
0.98    0.97    0.95    0.96    0.97    0.97    scan_range=100
0.95    0.95    1.00    0.95    0.97    0.99    delete_range=100
1.02    1.01    1.00    1.00    0.97    1.01    insert_range=100
1.00    1.01    1.01    1.02    1.02    1.01    read-write_range=100
0.98    0.99    0.99    1.00    0.98    0.97    read-write_range=10
0.99    0.99    0.98    1.00    0.98    0.99    update-index_range=100
0.99    0.99    1.00    1.00    1.00    1.00    update-inlist_range=100
0.99    0.99    0.99    1.01    1.00    0.99    update-nonindex_range=100
1.00    1.00    0.97    1.00    0.99    0.98    update-one_range=100
0.98    0.99    0.99    1.00    0.98    0.99    update-zipf_range=100
1.01    1.03    1.00    1.03    0.97    0.97    write-only_range=10000

Results with the a2 config

Relative to: pg152_o3_native_lto.x9a2_bee
col-1 : pg153_o3_native_lto.x9a2_bee
col-2 : pg154_o3_native_lto.x9a2_bee
col-3 : pg16beta1_o3_native_lto.x9a2_bee
col-4 : pg16beta2_o3_native_lto.x9a2_bee
col-5 : pg16beta3_o3_native_lto.x9a2_bee
col-6 : pg16rc1_o3_native_lto.x9a2_bee

col-1   col-2   col-3   col-4   col-5   col-6
0.97    0.96    0.96    0.96    1.00    0.96    hot-points_range=100
1.06    1.04    0.94    1.18    1.05    1.08    point-query.pre_range=100
1.00    1.13    1.05    1.13    1.04    1.07    point-query_range=100
1.00    0.99    1.01    1.01    1.01    1.01    points-covered-pk.pre_range=100
1.00    1.00    1.01    1.00    1.00    1.01    points-covered-pk_range=100
1.00    1.00    1.00    1.00    1.01    1.01    points-covered-si.pre_range=100
1.00    0.99    1.01    1.00    1.00    1.01    points-covered-si_range=100
1.00    1.00    1.00    1.00    1.00    1.00    points-notcovered-pk.pre_range=100
0.99    0.99    1.00    1.00    1.00    1.00    points-notcovered-pk_range=100
0.98    0.99    1.00    1.01    1.00    1.00    points-notcovered-si.pre_range=100
0.98    0.99    1.00    1.00    1.00    1.00    points-notcovered-si_range=100
1.01    0.99    1.01    1.01    1.01    1.01    random-points.pre_range=1000
1.00    1.00    0.99    0.99    1.01    1.01    random-points.pre_range=100
0.98    0.99    1.00    1.00    0.99    1.00    random-points.pre_range=10
1.00    1.01    1.01    1.01    1.01    1.01    random-points_range=1000
1.00    1.00    1.00    1.00    1.01    1.00    random-points_range=100
0.98    1.00    1.01    1.00    0.99    1.00    random-points_range=10
0.99    1.00    0.99    0.97    0.97    0.99    range-covered-pk.pre_range=100
0.99    1.00    0.98    0.98    0.97    0.98    range-covered-pk_range=100
1.00    1.00    0.99    0.99    0.98    0.99    range-covered-si.pre_range=100
1.01    1.01    1.00    1.00    0.98    0.99    range-covered-si_range=100
0.99    1.00    0.98    0.98    0.96    0.98    range-notcovered-pk.pre_range=100
0.99    0.98    0.98    0.99    0.98    0.98    range-notcovered-pk_range=100
0.99    0.99    0.98    0.99    0.98    0.98    range-notcovered-si.pre_range=100
0.99    0.99    0.99    0.99    0.98    0.99    range-notcovered-si_range=100
1.01    1.06    1.59    1.08    1.08    1.06    read-only.pre_range=10000
1.00    1.02    1.02    1.03    1.03    1.02    read-only.pre_range=100
1.00    1.05    1.01    0.99    1.01    1.08    read-only.pre_range=10
1.01    1.04    1.44    1.08    1.07    1.05    read-only_range=10000
1.01    1.01    1.02    1.04    1.02    1.02    read-only_range=100
0.97    1.00    0.98    0.96    0.97    1.03    read-only_range=10
0.96    0.96    0.96    0.97    0.96    0.97    scan_range=100
1.01    1.04    1.00    1.03    1.04    1.05    delete_range=100
1.05    1.02    1.01    1.00    1.00    1.00    insert_range=100
1.01    1.02    1.02    1.03    1.02    1.02    read-write_range=100
1.00    1.01    0.99    1.00    1.02    1.00    read-write_range=10
1.00    1.00    0.99    1.01    1.01    1.00    update-index_range=100
1.00    1.00    1.00    1.00    1.00    1.00    update-inlist_range=100
1.00    1.00    0.99    1.01    1.01    0.98    update-nonindex_range=100
1.00    0.99    1.01    1.02    1.00    1.00    update-one_range=100
0.99    1.00    1.00    1.01    1.01    0.99    update-zipf_range=100
1.00    1.06    1.05    1.02    1.04    1.08    write-only_range=10000

Sunday, August 27, 2023

RocksDB and glibc malloc don't play nice together

Pineapple and ham work great together on pizza. RocksDB and glibc malloc don't work great together. The primary problem is that for RocksDB processes the RSS with glibc malloc is much larger than with jemalloc or tcmalloc. I have written about this before -- see here and here. RocksDB is a stress test for an allocator.

tl;dr

  • For a process using RocksDB the RSS with glibc malloc is much larger than with jemalloc or tcmalloc. There will be more crashes from the OOM killer with glibc malloc.

Benchmark

The benchmark is explained in a previous post. 

The insert benchmark was run in the IO-bound setup and the database is larger than memory.

The benchmark used a c2-standard-30 server from GCP with Ubuntu 22.04, 15 cores, hyperthreads disabled, 120G of RAM and 1.5T of storage from RAID 0 over 4 local NVMe devices with XFS.

The benchmark is run with 8 clients and 8 tables (client per table). The benchmark is a sequence of steps.

  • l.i0
    • insert 500 million rows per table
  • l.x
    • create 3 secondary indexes. I usually ignore performance from this step.
  • l.i1
    • insert and delete another 100 million rows per table with secondary index maintenance. The number of rows/table at the end of the benchmark step matches the number at the start with inserts done to the table head and the deletes done from the tail. 
  • q100, q500, q1000
    • do queries as fast as possible with 100, 500 and 1000 inserts/s/client and the same rate for deletes/s done in the background. Run for 1800 seconds.

Configurations

The benchmark was run with 2 my.cnf files: c5 and c7 edited to use a 40G RocksDB block cache. The difference between them is that c5 uses the LRU block cache (older code) while c7 uses the Hyper Clock cache.

Malloc

The test was repeated with 4 malloc implementations:

  • je-5.2.1 - jemalloc 5.2.1, the version provided by Ubuntu 22.04
  • je-5.3.0 - jemalloc 5.3.0, the current jemalloc release, built from source
  • tc-2.9.1 - tcmalloc 2.9.1, the version provided by Ubuntu 22.04
  • glibc 2.3.5 - this is the version provided by Ubuntu 22.04

Results

I measured the peak RSS during each benchmark step.

The benchmark completed for all malloc implementations using the c5 config, but had some benchmark steps run for more time there would have been OOM with glibc. All of the configs used a 40G RocksDB block cache.

The benchmark completed for jemalloc and tcmalloc using the c7 config and fails with OOM with glibc on the q1000 step. Had the l.i1, q100 and q500 steps run for more time then the OOM would have happened sooner.



Saturday, August 26, 2023

Postgres 16 beta3 and the Insert Benchmark on a small server

This post has results for Postgres 16 beta vs the Insert Benchmark on a small server. I am searching for performance regressions. A previous post using a medium server is here. The tests here used Postgres versions 15.3, 15.4, 16 beta1, 16 beta2 and 16 beta3.

tl;dr

  • I don't see regressions in Postgres 16 beta3 for the workload that is cached by Postgres
  • Results for the IO-bound workloads have too much variance. I don't know whether the issue is Postgres or my HW. It is summer time and the temperature in my home datacenter (aka upstairs) can vary.
  • I am repeating the tests using the o3_native_lto build
Builds

I compiled Postgres 15.3, 15.4, 16 beta1, 16 beta2 and 16 beta3 from source. The builds are named o2_nofp which is shorthand for using: -O2 -no-omit-frame-pointer.

Benchmark

The insert benchmark was run in two setups.

  • cached by Postgres - all tables are cached by Postgres
  • IO-bound - the database is larger than memory

This benchmark used the Beelink server explained here that has 8 cores, 16G RAM and 1TB of NVMe SSD with XFS and Ubuntu 22.04. 

The benchmark is run with 1 client and 1 table. The benchmark is a sequence of steps.

  • l.i0
    • insert X million rows per table where X is 20 for cached and 800 for IO-bound
  • l.x
    • create 3 secondary indexes. I usually ignore performance from this step.
  • l.i1
    • insert and delete another X million rows per table with secondary index maintenance where X is 200 for Cached and 20 for IO-bound. The number of rows/table at the end of the benchmark step matches the number at the start with inserts done to the table head and the deletes done from the tail. This step took ~20,000 seconds.
  • q100, q500, q1000
    • do queries as fast as possible with 100, 500 and 1000 inserts/s/client and the same rate for deletes/s done in the background. Run for 3600 seconds.
Configurations

I used the a1 and a2 configurations. The difference between them is that a1 has wal_compression set to lz4 while a2 has it set to off.

Results

Reports are here for Cached (a1 config, a2 config) and IO-bound (a1 config, a2 config).

The results for average throughput are interesting and confusing. The tables linked below use absolute and relative throughput where relative throughput is (QPS for my version / QPS for base version) and the base version is Postgres 15.3.
  • Cached, a1 config (see here)
    • Postgres 16 beta2 and beta3 always get more throughput. Relative throughput is between 1.01 and 1.07 for them on every benchmark step.
    • From the metrics for the write-only benchmark steps (l.i0, l.x, l.i1) the CPU overhead (cpupq column) and write IO overhead (wkbpi column) are similar from 15.3 to 16 beta3
    • From the metrics for the read+write benchmark steps (q100, q500, q1000) there might be a slight reduction in CPU overhead (cpupq column)
  • Cached, a2 config (see here)
    • Postgres 16 beta2 and beta3 were faster than 15.3 on the write-only benchmark steps (l.i0, l.x, l.i1) where relative QPS was between 1.00 and 1.03 but almost always slower on the read-write benchmark steps (q100, q500, q1000) where relative QPS was between 0.91 and 1.03. In the read+write steps 16 beta2 had a relative QPS of 1.03 on q1000, otherwise these versions were slower than 15.3.
    • From the metrics for the write-only benchmark steps (l.i0, l.x, l.i1) the CPU overhead (cpupq column) and write overhead (wkbpi column) are similar from 15.3 to 16 beta3
    • From the metrics for the read+write benchmark steps (q100, q500, q1000) the CPU overhead (cpupq column) is frequently larger in 16 beta versions and this might explain the reduction in QPS.
  • IO-bound, a1 config (see here)
    • I am reluctant to characterize these because there is too much variance
  • IO-bound, a2 config (see here)
    • I am reluctant to characterize these because there is too much variance

Friday, August 25, 2023

Checking MyRocks 5.6 for regressions with the Insert Benchmark and a large server

This documents how performance changes from old to new releases of MyRocks using the Insert Benchmark and a large server. I use MyRocks 5.6 rather than 8.0 because the 5.6 release go back further in time. This post uses a large server. Previous posts are here for a small server and medium server.

Update - the builds I used were bad so the results here are bogus. I fixed the builds, repeated the tests and share results here. There are no regressions and the initial load of the benchmark is ~10% faster in modern MyRocks.

Comparing old MyRocks with modern MyRocks where old means fbmy5635_202203072101 with RocksDB 6.28.2 and modern means fbmy5635_rel_20230529_850 with RocksDB 8.5.0:

  • Write throughput drops by ~15%. Most of the regressions are confined to a few releases between fbmy5635_rel_202210112144 and fbmy5635_202302162102.
  • Read throughput drops by ~10%. The regressions occur in many releases.
  • In both cases, new CPU overhead explains the performance regression.
Builds

The builds are explained in a previous post but the oldest build used here is fbmy5635_202203072101 which has source as of 2022/03/07 while the other posts have builds going back to 2021/04/07.

The configuration files (my.cnf) are here: base and c5. The difference between them is that c5 adds rocksdb_max_subcompactions=4.

Benchmark

The insert benchmark was run in two setups:

  • cached by RocksDB - all tables fit in the RocksDB block cache
  • IO-bound - the database is larger than memory
The server has 80 HW threads, 40 cores, 256G of RAM and fast NVMe storage with XFS.

The benchmark is run with 24 clients, 24 tables and a client per table. The benchmark is a sequence of steps.

  • l.i0
    • insert X million rows across all tables without secondary indexes where X is 20 for cached and 500 for IO-bound
  • l.x
    • create 3 secondary indexes. I usually ignore performance from this step.
  • l.i1
    • insert and delete another 50 million rows per table with secondary index maintenance. The number of rows/table at the end of the benchmark step matches the number at the start with inserts done to the table head and the deletes done from the tail.
  • q100, q500, q1000
    • do queries as fast as possible with 100, 500 and 1000 inserts/s/client and the same rate for deletes/s done in the background. Run for 7200 seconds.
Results

Performance reports are here for Cached by RocksDB (base config and c5 config) and IO-bound (base config and c5 config).

Results: average throughput

This section explains the average throughput tables in the Summary section. I use relative throughput to save on typing where relative throughput is (throughput for some version  / throughput for base case). When relative throughput is > 1 then some version is faster than the base case. The base case is fbmy5635_202203072101 with source from 2022/03/07 and it uses RocksDB 6.28.2.

Comparing old MyRocks with modern MyRocks where old means fbmy5635_202203072101 with RocksDB 6.28.2 and modern means fbmy5635_rel_20230529_850 with RocksDB 8.5.0:
  • Write throughput drops by ~15%. Most of the regressions are confined to a few releases between fbmy5635_rel_202210112144 and fbmy5635_202302162102. The issue appears to be new CPU overhead -- see the cpupq (CPU/operation) column here.
  • Read throughput drops by ~10%. The regressions occur in many releases.
  • The issue appears to be new CPU overhead -- see the cpupq (CPU/operation column) here for writes and here for reads.
Cached by RocksDB, base config (see here)
  • For fbmy5635_202205192101 with RocksDB 7.2.2
    • Relative throughput is (0.96, 0.98, 0.95) for (l.i0, l.x, l.i1)  so write throughput dropped by ~5% vs the base case
    • Relative throughput is (0.98, 0.95, 0.95) for (q100, q500, q1000) so read throughput dropped by ~5% vs the base case
  • For fbmy5635_202302162102 with RocksDB 7.10.0
    • Relative throughput is (0.98, 0.99, 0.83) for (l.i0, l.x, l.i1). The result for l.i1 is much worse than it was on the next earlier build (fbmy5635_rel_202210112144 with RocksDB 7.3.1) and I am tracking that down.
  • For fbmy5635_rel_20230529_850 with RocksDB 8.5.0
    • Relative throughput is (0.94, 0.97, 0.83) for (l.i0, l.x, l.i1) so the regression to write perf for l.i1 hasn't gotten worse compared to fbmy5635_202302162102
    • Relative throughput is (0.91, 0.87, 0.89) for (q100, q500, q1000) and query performance has small regressions in every release tested
Cached by RocksDB, c5 config (see here)
  • Results are similar to Cached by RocksDB with the base config
IO-bound, base config (see here)
  • Results are similar to Cached by RocksDB with the base config
IO-bound, c5 config (see here)
  • Results are similar to Cached by RocksDB with the base config














Wednesday, August 23, 2023

Checking MyRocks 5.6 for regressions with sysbench and a small server, part 2

This post has results from sysbench and many MyRocks versions (old and new) in my search for performance regressions. It uses a small server and my previous post on that is here, which has results for the Insert Benchmark with the same server and same MyRocks versions. I also have results here for sysbench on a medium server.

The tests (microbenchmarks) are split into 5 groups -- 2 for point queries, 2 for range queries, 1 for writes. Using data from the Summary statistics section at the end of the post and the median of the relative throughput values per group to compare modern MyRocks with classic where modern uses source from 2023/05/29 with RocksDB 8.5.0 and classic uses source from 2021/04/07 with RocksDB 6.19. Finally, relative throughput is (QPS for modern / QPS for classic).
  • QPS for point queries is 1.01x and 1.07x larger in modern MyRocks vs classic
  • QPS for range queries is 1.02x and 1.12x larger in modern MyRocks vs classic
  • QPS for writes is similar between modern MyRocks and classic.
Builds

The builds tested are described in a previous post. MyRocks was compiled from source. All tests used the y10a5_bee config.

Benchmark

I used sysbench and my usage is explained here. RocksDB was configured to cached all tables.

This benchmark used the Beelink server explained here that has 8 cores, 16G RAM and 1TB of NVMe SSD with XFS and Ubuntu 22.04. 

The benchmark is run with 1 client and 1 table with 20M rows. The read-only tests ran for 600 seconds each and the other tests ran for 1200 seconds each.

Results

All of the results are here and each chart below is there too (and easier to read there). For the charts below I split the results into two groups of point query tests, two groups of range query tests and one group for read-write/write-only tests. 

The charts use relative QPS which is: (QPS for a given version / QPS for the base case) and the base case is the 20210407 build that has a much longer name, fbmy5635_rel_202104072149, in my previous post. The names used below are the date for which builds were done, YYYMMDD, and then for the last three the three digits at the end (832, 843, 850) are the RocksDB version when I used a more recent version of RocksDB than the build would otherwise use.

Note 

  • the y-axis for all charts starts at 0.8 rather than 0.0 to improve readability
  • the test names under the x-axis are truncated in the images here but readable here

Point query, group 1

Point query, group 2

Range query, group 1

Range query, group 1

Writes

Summary statistics

Point-120230529_850
Average1.19
Median1.07
Min0.94
Max2.06
Stddev0.353
Point-220230529_850
Average1.01
Median1.01
Min0.95
Max1.06
Stddev0.051
Range-120230529_850
Average1.10
Median1.02
Min0.80
Max1.50
Stddev0.260
Range-220230529_850
Average1.13
Median1.12
Min0.85
Max1.62
Stddev0.265
Writes20230529_850
Average1.01
Median1.00
Min0.90
Max1.14
Stddev0.075




CPU-bound sysbench on a large server: Postgres 12 to 19 beta1

This has results from sysbench on a small server with Postgres versions 12 through 19 beta1. Sysbench is run with high concurrency (40 conne...