[MDEV-21186] Benchmark range locking - nov-dec 2019 Created: 2019-12-01 Updated: 2023-10-19 Resolved: 2023-10-19 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - RocksDB |
| Fix Version/s: | N/A |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Petrunia | Assignee: | Sergei Petrunia |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Attachments: |
|
||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||
| Description |
|
Start with re-running the benchmark from |
| Comments |
| Comment by Sergei Petrunia [ 2019-12-01 ] | ||||||||||||||||||||||||
|
Start with re-running the benchmark from | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-01 ] | ||||||||||||||||||||||||
|
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-01 ] | ||||||||||||||||||||||||
|
Re-running the same test, with datadirs on /dev/shm:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-14 ] | ||||||||||||||||||||||||
|
See also MDEV-21314. It improves range locking benchmark results by 30%: | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-14 ] | ||||||||||||||||||||||||
|
Another benchmark run: use the code with MDEV-21314 patch, also use 4 tables, and put each table_name.index_name into a separate column family (Sysbench tables have one PK and one SK): The idea is that in the current code, each column family has its own locktree. Will this "sharding" help range locking?
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2019-12-14 ] | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-01-07 ] | ||||||||||||||||||||||||
|
Re-ran the test with the current tree (fix for MDEV-21314 is now pushed)
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-01-07 ] | ||||||||||||||||||||||||
|
Results for two tables, each index in its own Column Family:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-04-04 ] | ||||||||||||||||||||||||
|
Added to benchmark script an option to drop the secondary index before doing the benchmark run. Results from AWS c5.9xlarge:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-04-06 ] | ||||||||||||||||||||||||
|
A transaction from sysbench oltp_write_only looks like this:
(note that the INSERT inserts the record with the same pk that DELETE has removed). Number of locks taken: With range locking, it acquires 8 locks:
| ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-04-06 ] | ||||||||||||||||||||||||
|
If the table doesn't have a secondary key on k: Point locking will still acquire 3 locks. Range locking will acquire 4 locks (each statement will take a lock on PK, INSERT will also acquire it, this is a difference from point locking). | ||||||||||||||||||||||||
| Comment by Sergei Petrunia [ 2020-04-06 ] | ||||||||||||||||||||||||
|
Sysbench's oltp_update_non_index.lua test does just one UPDATE... WHERE id=... per transaction. This means both point and range locking will only take one lock per transaction.
|