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

batch-system: add benchmark #6477

Merged
merged 9 commits into from
Feb 6, 2020
Merged

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Jan 17, 2020

What have you changed?

Add several benchmark cases to batch system. It will be used to measure the future improvement.

What is the type of the changes?

  • Engineering

How is the PR tested?

  • Unit test
  • Integration test
  • Manual test

Does this PR affect documentation (docs) or should it be mentioned in the release notes?

No.

Does this PR affect tidb-ansible?

No.

Benchmark result if necessary (optional)

Following result comes from benchmark on my desktop:

fairness                time:   [36.352 us 37.078 us 37.817 us]
imbalance               time:   [2.3132 ms 2.3597 ms 2.3929 ms]
spawn_many              time:   [4.9201 ms 4.9222 ms 4.9240 ms]
router::send            time:   [89.818 ns 89.913 ns 90.005 ns]

Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
@BusyJay BusyJay added the sig/raft Component: Raft, RaftStore, etc. label Jan 17, 2020
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
@BusyJay
Copy link
Member Author

BusyJay commented Jan 19, 2020

@overvenus @5kbpers @gengliqi PTAL

router.send(1, ()).unwrap();
c.bench_function("router::send", |b| {
b.iter(|| {
router.send(1, Message::Loop(0)).unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for OOM?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible but never happen on my 16G desktop.

@siddontang
Copy link
Contributor

PTAL @nrc

Copy link
Member

@5kbpers 5kbpers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@nrc nrc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly looks good, but I'd like to see a bit more documentation, it's hard to figure out what is going on at the moment.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
@BusyJay BusyJay added the status/can-merge Indicates a PR has been approved by a committer. label Feb 6, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Feb 6, 2020

/run-all-tests

@sre-bot sre-bot merged commit bdd97f0 into tikv:master Feb 6, 2020
@BusyJay BusyJay deleted the bench-batch-system branch February 6, 2020 11:53
BusyJay added a commit to BusyJay/tikv that referenced this pull request Feb 8, 2020
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
BusyJay added a commit to BusyJay/tikv that referenced this pull request Feb 8, 2020
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
BusyJay added a commit to BusyJay/tikv that referenced this pull request Feb 8, 2020
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
BusyJay added a commit to BusyJay/tikv that referenced this pull request Feb 8, 2020
BusyJay added a commit to BusyJay/tikv that referenced this pull request Feb 9, 2020
This reverts commit 3971a3a.

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
sre-bot pushed a commit that referenced this pull request Feb 14, 2020
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
youjiali1995 pushed a commit that referenced this pull request Feb 14, 2020
* raftstore: extract batch system (#6414)
* apply: support yield (#6487)
* batch-system: add benchmark (#6477)
* Introduce pre transfer leader (#6539)
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
solotzg added a commit to pingcap/tidb-engine-ext that referenced this pull request Feb 15, 2020
* [3.1] external_storage: add S3 support (tikv#6209) (tikv#6536)

* external_storage: add S3 support (tikv#6209)

Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: kennytm <kennytm@gmail.com>

* lock_manager: more metrics (tikv#6392) (tikv#6422) (tikv#6444)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* lock_manager: update default config (tikv#6426) (tikv#6429) (tikv#6446)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* Update rocksdb and titan. Update rust-rocksdb url (tikv#6554)

Signed-off-by: Yi Wu <yiwu@pingcap.com>

* raft_client: connect to other stores using peer_address (tikv#5569) (tikv#6491)

* *: pick threads statistics for regions (tikv#6605)

Co-authored-by: jiyingtk <1039793452@qq.com>
Co-authored-by: disksing <i@disksing.com>

* fix test_replica_read::test_read_after_cleanup_range_for_snap (tikv#6493)

Signed-off-by: 5kbpers <tangminghua@pingcap.com>

* deadlock: more solid role change observer (tikv#6415) (tikv#6431) (tikv#6445)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* raftstore: read index message count metric (tikv#6579) (tikv#6610)

Signed-off-by: 5kbpers <tangminghua@pingcap.com>

* raftstore: speed up conf change (tikv#6421) (tikv#6432)

Signed-off-by: Jay Lee <busyjaylee@gmail.com>

* raftstore: fix a panic in read index queue (tikv#6609) (tikv#6613)

Signed-off-by: qupeng <qupeng@pingcap.com>

* pick tikv#6414, tikv#6487, tikv#6477 and tikv#6539 to release-3.1 (tikv#6564)

* raftstore: extract batch system (tikv#6414)
* apply: support yield (tikv#6487)
* batch-system: add benchmark (tikv#6477)
* Introduce pre transfer leader (tikv#6539)
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>

* raftstore: set wait_merge_state to none after resuming pending state (tikv#6621)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

* raftstore: learner load merge target & fix a merge network recovery bug (tikv#6623)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

* change merge flow path (tikv#6617)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: Lei Zhao <zlwgx1023@gmail.com>
Co-authored-by: yiwu-arbug <yiwu@pingcap.com>
Co-authored-by: disksing <i@disksing.com>
Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: jiyingtk <1039793452@qq.com>
Co-authored-by: pingcap-github-bot <sre-bot@pingcap.com>
Co-authored-by: 5kbpers <20279863+5kbpers@users.noreply.github.com>
Co-authored-by: Jay <BusyJay@users.noreply.github.com>
Co-authored-by: gengliqi <gengliqiii@gmail.com>
solotzg added a commit to pingcap/tidb-engine-ext that referenced this pull request Feb 21, 2020
* [3.1] external_storage: add S3 support (tikv#6209) (tikv#6536)

* external_storage: add S3 support (tikv#6209)

Signed-off-by: Yi Wu <yiwu@pingcap.com>
Signed-off-by: kennytm <kennytm@gmail.com>

* lock_manager: more metrics (tikv#6392) (tikv#6422) (tikv#6444)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* lock_manager: update default config (tikv#6426) (tikv#6429) (tikv#6446)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* Update rocksdb and titan. Update rust-rocksdb url (tikv#6554)

Signed-off-by: Yi Wu <yiwu@pingcap.com>

* raft_client: connect to other stores using peer_address (tikv#5569) (tikv#6491)

* *: pick threads statistics for regions (tikv#6605)

Co-authored-by: jiyingtk <1039793452@qq.com>
Co-authored-by: disksing <i@disksing.com>

* fix test_replica_read::test_read_after_cleanup_range_for_snap (tikv#6493)

Signed-off-by: 5kbpers <tangminghua@pingcap.com>

* deadlock: more solid role change observer (tikv#6415) (tikv#6431) (tikv#6445)

Signed-off-by: youjiali1995 <zlwgx1023@gmail.com>

* raftstore: read index message count metric (tikv#6579) (tikv#6610)

Signed-off-by: 5kbpers <tangminghua@pingcap.com>

* raftstore: speed up conf change (tikv#6421) (tikv#6432)

Signed-off-by: Jay Lee <busyjaylee@gmail.com>

* raftstore: fix a panic in read index queue (tikv#6609) (tikv#6613)

Signed-off-by: qupeng <qupeng@pingcap.com>

* pick tikv#6414, tikv#6487, tikv#6477 and tikv#6539 to release-3.1 (tikv#6564)

* raftstore: extract batch system (tikv#6414)
* apply: support yield (tikv#6487)
* batch-system: add benchmark (tikv#6477)
* Introduce pre transfer leader (tikv#6539)
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>

* raftstore: set wait_merge_state to none after resuming pending state (tikv#6621)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

* raftstore: learner load merge target & fix a merge network recovery bug (tikv#6623)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

* change merge flow path (tikv#6617)

Signed-off-by: Liqi Geng <gengliqiii@gmail.com>

Co-authored-by: kennytm <kennytm@gmail.com>
Co-authored-by: Lei Zhao <zlwgx1023@gmail.com>
Co-authored-by: yiwu-arbug <yiwu@pingcap.com>
Co-authored-by: disksing <i@disksing.com>
Co-authored-by: ShuNing <nolouch@gmail.com>
Co-authored-by: jiyingtk <1039793452@qq.com>
Co-authored-by: pingcap-github-bot <sre-bot@pingcap.com>
Co-authored-by: 5kbpers <20279863+5kbpers@users.noreply.github.com>
Co-authored-by: Jay <BusyJay@users.noreply.github.com>
Co-authored-by: gengliqi <gengliqiii@gmail.com>
c1ay pushed a commit to c1ay/tikv that referenced this pull request May 9, 2020
Signed-off-by: Jay Lee <busyjaylee@gmail.com>
Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/raft Component: Raft, RaftStore, etc. status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants