Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
use tokio threadpool and thread local metrics for readpool #4486
What have you changed? (mandatory)
What are the type of the changes? (mandatory)
Improvement (change which is an improvement to an existing feature).
How has this PR been tested? (mandatory)
Unit tests, integration tests, and partial manual tests.
Does this PR affect documentation (docs) update? (mandatory)
Does this PR affect tidb-ansible update? (mandatory)
Refer to a related PR or issue link (optional)
Benchmark result if necessary (optional)
Add a few positive/negative examples (optional)
after this, I even think we can remove another threadpool, we can use future::lazy to wrap the task and so we can unify the thread pool.
But we should also do the benchmark, IMO, tokio thread pool has a better performance than our thread pool @breeswish
Another thing is to support dynamically changing thread number in the pool, but we must be careful about this, because now we will collect thread metrics and use thread ID as a label value. Dynamic thread means we may send too many label values to Prometheus. So maybe for the thread pool, we can use thread name instead of thread ID. /cc @overvenus