Friday, January 12, 2024

Updated Insert benchmark: MyRocks 5.6 and 8.0, small(est) server, cached database, v2

This has results for the Insert Benchmark using MyRocks 5.6 and 8.0, a small server and a cached workload. I have two versions of small servers -- Beelink SER4 with 16G of RAM, Beelink SER7 with 32G of RAM. This report uses the SER4. This report replaces a January 2 report for the Beelink SER4. The difference is that I improved the benchmark scripts to reduce compaction debt prior to the read-write benchmark steps. My intention was to reduce noise in the throughput results. Alas, I have more work to do.

tl;dr

  • Enabling the perf schema reduces throughput by up to 10% for write-heavy and up to 5% for read-heavy.
  • The range query benchmark steps (qr*) have too much noise that I have yet to explain
  • Comparing latest MyRocks 8.0.32 to 5.6.35 shows
    • 8.0.32 gets 20% to 30% less throughput for write-heavy
    • 8.0.32 gets ~10% less throughput for point queries
    • There is too much noise on the range query benchmark steps

    Build + Configuration


    Benchmark

    The server is a Beelink SER4 described here with 8 cores, 16G RAM, Ubuntu 22.04 and XFS on a fast m.2 NVMe device. The benchmark is run with 1 client.

    The benchmark is a sequence of steps that are run in order:
    • l.i0
      • insert 30M 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 does inserts as fast as possible and the other does deletes at the same rate as the inserts to avoid changing the number of rows in the table. 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).
      • Wait for X seconds after the step finishes to reduce variance during the read-write benchmark steps that follow where X is max(1200, 60 + #nrows/1M). While waiting do things to reduce writeback debt where the things are:
        • MyRocks (see here) - set rocksdb_force_flush_memtable_now to flush the memtable, wait 20 seconds and then set rocksdb_compact_lzero_now to flush L0. Note that rocksdb_compact_lzero_now wasn't supported until mid-2023.
    • qr100
      • use 3 connections/client. One does range queries as fast as possible 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
    Results

    The performance reports are here for
    The summary has 3 tables. The first shows absolute throughput by DBMS tested X benchmark step. The second has throughput relative to the version on the first row of the table. The third shows the background insert rate for benchmark steps with background inserts and all systems sustained the target rates. The second table makes it easy to see how performance changes over time.

    Below I use relative QPS to explain how performance changes. It is: (QPS for $me / QPS for $base) where $me is my version and $base is the version of the base case. When relative QPS is > 1.0 then performance improved over time. When it is < 1.0 then there are regressions. The Q in relative QPS measures: 
    • 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
    Below I use colors to highlight the relative QPS values with red for <= 0.95, green for >= 1.05 and grey for values between 0.95 and 1.05.

    The range query benchmark steps suffer from too much noise that I have yet to explain.

    From the summary for 5.6
    • The base case is fbmy5635_rel_202104072149
    • The results with the builds that use clang are similar to gcc except for the l.i0 and l.ix benchmark steps. I opened a bug against LLVM for code generation related to crc32 functions.
    • Comparing throughput in fbmy5635_rel_221222 to the base case
      • Write-heavy
        • l.i0, l.x, l.i1, l.i2 - relative QPS is 0.960.980.991.00
      • Range queries
        • qr100, qr500, qr1000 - relative QPS is 0.800.86, 1.63
      • Point queries
        • qp100, qp500, qp1000 - relative QPS is 0.971.001.03
    From the summary for 8.0
    • The base case is fbmy8028_rel_20220829_752
    • The results with clang are worse than gcc. See the previous section for details.
    • Comparing throughput in fbmy8032_rel_221222 to the base case
      • Write-heavy
        • l.i0, l.x, l.i1, l.i2 - relative QPS is 0.981.021.011.03
      • Range queries
        • qr100, qr500, qr1000 - relative QPS is 1.330.950.94
      • Point queries
        • qp100, qp500, qp1000 - relative QPS is 0.97, 0.980.97
    From the summary for 5.6, 8.0 with many versions
    • The base case is fbmy5635_rel_202104072149
    • Enabling the perf schema costs up to 10% of throughput for write-heavy and up to 5% for read-heavy.
    • Comparing throughput in fbmy8032_rel_221222 to the base case
      • Write-heavy
        • l.i0, l.x, l.i1, l.i2 - relative QPS is 0.690.880.830.84
      • Range queries
        • qr100, qr500, qr1000 - relative QPS is 0.921.031.55
      • Point queries
        • qp100, qp500, qp1000 - relative QPS is 0.880.890.92
    From the summary for 5.6, 8.0 with latest versions
    • The base case is fbmy5635_rel_221222
    • Comparing throughput in fbmy8032_rel_221222 to the base case
      • Write-heavy
        • l.i0, l.x, l.i1, l.i2 - relative QPS is 0.680.880.810.79
      • Range queries
        • qr100, qr500, qr1000 - relative QPS is 1.021.300.90
      • Point queries
        • qp100, qp500, qp1000 - relative QPS is 0.900.890.89



    No comments:

    Post a Comment