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

unify read pools with a single multi-level thread pool #5828

Closed
wants to merge 37 commits into from

Conversation

@sticnarf
Copy link
Contributor

sticnarf commented Nov 6, 2019

What have you changed?

This PR implements a thread pool running Futures and supports lowering the priority of long-running tasks. It also replaces all read pools in the existing TiKV.

The thread pool implementation is in the early stage. Any suggestions are welcome.

(But don't care about the code style at the moment, it needs polishing of course)

This is still work in progress:

  • Implement the thread pool
  • Document the thread pool implementation
  • Add metrics for each level
  • Test the thread pool
  • Replace existing read pools
  • Support configs and remove hard coded values
  • Dynamically adjust time use in each level
  • Pass task id from client
  • Upgrade futures 0.3
  • Benchmarks

What is the type of the changes?

Pick one of the following and delete the others:

  • Improvement (a change which is an improvement to an existing feature)

How is the PR tested?

Please select the tests that you ran to verify your changes:

  • Unit test
  • Integration test

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

No

Does this PR affect tidb-ansible?

No

Refer to a related PR or issue link (optional)

Benchmark result if necessary (optional)

Any examples? (optional)

sticnarf added 9 commits Nov 4, 2019
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Nov 6, 2019

/bench +sysbench +tpcc +tpch

@sre-bot

This comment has been minimized.

Copy link
Collaborator

sre-bot commented Nov 6, 2019

Benchmark Report

Run Sysbench Performance Test on VMs

@@                               Benchmark Diff                               @@
================================================================================
tidb: b295890316b0bae00ca1f262e9c87c18b68fea9c
--- tikv: 11ab8359786a68b1acf0dc41986fc62d57a1f789
+++ tikv: 0948195ca75db1547d8d196030814b4f48f0093e
pd: a256162b371ee39b4a4f65403fe95845125dcf09
================================================================================
oltp_update_non_index:
    * QPS: 4791.99 ± 0.14% (std=4.65) delta: 0.08% (p=0.594)
    * Latency p50: 26.71 ± 0.14% (std=0.03) delta: -0.08%
    * Latency p99: 42.62 ± 3.57% (std=0.93) delta: 1.35%
            
oltp_insert:
    * QPS: 4734.40 ± 0.27% (std=10.06) delta: 0.11% (p=0.522)
    * Latency p50: 27.03 ± 0.26% (std=0.06) delta: -0.11%
    * Latency p99: 45.81 ± 3.58% (std=1.16) delta: -4.08%
            
oltp_read_write:
    * QPS: 11578.43 ± 0.64% (std=52.00) delta: 1.71% (p=0.003)
    * Latency p50: 221.51 ± 0.63% (std=0.98) delta: -1.67%
    * Latency p99: 356.70 ± 0.00% (std=0.00) delta: -1.78%
            
oltp_update_index:
    * QPS: 4253.14 ± 0.38% (std=11.45) delta: 0.08% (p=0.711)
    * Latency p50: 30.09 ± 0.42% (std=0.09) delta: -0.08%
    * Latency p99: 54.83 ± 0.00% (std=0.00) delta: -0.47%
            
oltp_point_select:
    * QPS: 42541.76 ± 0.06% (std=18.54) delta: 0.64% (p=0.009)
    * Latency p50: 3.01 ± 0.00% (std=0.00) delta: -0.66%
    * Latency p99: 9.73 ± 0.00% (std=0.00) delta: 1.78%
            
@sre-bot

This comment has been minimized.

Copy link
Collaborator

sre-bot commented Nov 6, 2019

Benchmark Report

Run TPC-C Performance Test on VMs

@@                               Benchmark Diff                               @@
================================================================================
tidb: b295890316b0bae00ca1f262e9c87c18b68fea9c
--- tikv: 11ab8359786a68b1acf0dc41986fc62d57a1f789
+++ tikv: 0948195ca75db1547d8d196030814b4f48f0093e
pd: a256162b371ee39b4a4f65403fe95845125dcf09
================================================================================
Measured tpmC (NewOrders): 3800.82 ± 2.00% (std=50.17), delta: 8.69% (p=0.025)
@mahjonp

This comment has been minimized.

Copy link
Contributor

mahjonp commented Nov 7, 2019

/bench

workload:
  threads: 512
@zhangjinpeng1987

This comment has been minimized.

Copy link
Member

zhangjinpeng1987 commented Nov 7, 2019

I suggest to split this huge pr to multiple little PRs, for example, first pr only import the new thread pool.

@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Nov 7, 2019

I suggest to split this huge pr to multiple little PRs, for example, first pr only import the new thread pool.

OK. This one is just for people who are interested. :)

@sre-bot

This comment has been minimized.

Copy link
Collaborator

sre-bot commented Nov 7, 2019

Benchmark Report

Run Sysbench Performance Test on VMs

@@                               Benchmark Diff                               @@
================================================================================
tidb: 95e12c6a82c6f7e957660197e81150aa50625686
--- tikv: b779f9ceea9ec5720addb1f5bfcbc710bdd4b033
+++ tikv: 0948195ca75db1547d8d196030814b4f48f0093e
pd: a256162b371ee39b4a4f65403fe95845125dcf09
================================================================================
oltp_update_non_index:
    * QPS: 13236.96 ± 0.39% (std=35.11) delta: -0.02% (p=0.901)
    * Latency p50: 38.67 ± 0.39% (std=0.10) delta: 0.03%
    * Latency p99: 91.87 ± 1.19% (std=0.77) delta: -0.59%
            
oltp_insert:
    * QPS: 11209.47 ± 0.21% (std=16.62) delta: 0.47% (p=0.950)
    * Latency p50: 45.67 ± 0.21% (std=0.07) delta: -0.46%
    * Latency p99: 91.87 ± 1.19% (std=0.77) delta: -1.49%
            
oltp_read_write:
    * QPS: 16572.43 ± 0.49% (std=53.20) delta: 0.10% (p=0.672)
    * Latency p50: 623.03 ± 0.44% (std=1.71) delta: -0.14%
    * Latency p99: 1192.40 ± 3.62% (std=33.94) delta: 0.64%
            
oltp_update_index:
    * QPS: 8521.56 ± 1.23% (std=64.77) delta: 0.42% (p=0.537)
    * Latency p50: 59.76 ± 0.34% (std=0.14) delta: -0.17%
    * Latency p99: 124.97 ± 2.27% (std=1.88) delta: 1.37%
            
oltp_point_select:
    * QPS: 53243.74 ± 0.45% (std=175.75) delta: 1.49% (p=0.027)
    * Latency p50: 9.62 ± 0.47% (std=0.03) delta: -1.44%
    * Latency p99: 26.93 ± 0.91% (std=0.25) delta: -0.90%
            
sticnarf added 6 commits Nov 7, 2019
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@tikv tikv deleted a comment from sre-bot Nov 11, 2019
@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Nov 11, 2019

/release

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf sticnarf force-pushed the sticnarf:unified-pool branch from 9c6a209 to 7bc65b6 Nov 11, 2019
sticnarf added 19 commits Nov 11, 2019
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
do format
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Dec 4, 2019

/bench +tpch

1 similar comment
@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Dec 4, 2019

/bench +tpch

@sre-bot

This comment has been minimized.

Copy link
Collaborator

sre-bot commented Dec 4, 2019

Benchmark Report

Run TPC-H 10G Performance Test on VMs

@@                               Benchmark Diff                               @@
================================================================================
tidb: 7ccbdc12b30d8aed1ab7904a7e96a3eee2ab55ce
--- tikv: 55909d0377a147fab763cbe007a11aee276c6389
+++ tikv: c9217d60f449c5a240b96a620bed0d4f1e2f416c
pd: 895ccdb38eaf12f2421fcd03e0661f00447542e3
================================================================================
@mahjonp

This comment has been minimized.

Copy link
Contributor

mahjonp commented Dec 4, 2019

Benchmark Report

Run TPC-H 10G Performance Test on VMs

@@                               Benchmark Diff                               @@
================================================================================
tidb: 7ccbdc12b30d8aed1ab7904a7e96a3eee2ab55ce
--- tikv: 55909d0377a147fab763cbe007a11aee276c6389
+++ tikv: c9217d60f449c5a240b96a620bed0d4f1e2f416c
pd: 895ccdb38eaf12f2421fcd03e0661f00447542e3
================================================================================

Because benchmark tests on current PR were all failed, did error were introduced by this PR?

image

@sticnarf

This comment has been minimized.

Copy link
Contributor Author

sticnarf commented Dec 5, 2019

@mahjonp The PR hasn't been updated for quite a time. Maybe the latest tidb is too new for it.

@sticnarf sticnarf closed this Jan 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.