Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mdcallag opened this issue Aug 7, 2024 · 0 comments

Comments

@mdcallag
Copy link
Contributor

mdcallag commented Aug 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant