Skip to content

CPU overhead for trans_commit_stmt uses almost 2X more CPU in MyRocks than InnoDB #1486

@mdcallag

Description

@mdcallag

I am looking at flamegraphs from sysbench with a cached database and 1 client. A common problem I see is that the percentage of samples that lock_tables (and its callees) accounts for is ~2X larger in MyRocks than in InnoDB with simple microbenchmarks.

The microbenchmark in this case is here.

The percentage of samples from trans_commit_stmt and its children is 21.01% for InnoDB vs 35.19% for MyRocks

Percentage of samples, from InnoDB

21.01%  trans_commit_stmt
  17.97%  MYSQL_BIN_LOG::commit
    17.00%  MYSQL_BIN_LOG::ordered_commit
       3.60%  MYSQL_BIN_LOG::flush_cache_to_file
       3.05%  MYSQL_BIN_LOG::process_commit_stage_queue
       8.57%  MYSQL_BIN_LOG::process_flush_stage_queue
   1.27%. MYSQL_BIN_LOG::prepare

And from MyRocks

35.19%  trans_commit_stmt
  27.19%  MYSQL_BIN_LOG::commit
    26.19%  MYSQL_BIN_LOG::ordered_commit
       2.56%  MYSQL_BIN_LOG::flush_cache_to_file
      10.69%  MYSQL_BIN_LOG::process_commit_stage_queue
        ... mostly RocksDB code
      10.44%  MYSQL_BIN_LOG::process_flush_stage_queue
        ... mostly RocksDB code
   3.59%  MYSQL_BIN_LOG::prepare
     3.51%  ha_prepare_low
      3.32%  myrocks::rocksdb_prepare
        ... more MyRocks and RocksDB code     
   2.20%  is_thd_db_read_only_by_name

Flamegraphs
sb perf g insert range100 pk1 all
sb perf g insert range100 pk1 all

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions