PS-10083-[8.4] Add more statistics for threadpool#5876
PS-10083-[8.4] Add more statistics for threadpool#5876lukin-oleksiy wants to merge 4 commits intopercona:8.4from
Conversation
…, requests waiting in queues, requests not entered queue https://perconadev.atlassian.net/browse/PS-10083 Added highly optimized class for live statistic calculation in multi-threaded environment. Added new status variables: mysql> show status like "Thread%"; +-----------------------------------------+----------------------------------------------------------------+ | Variable_name | Value | +-----------------------------------------+----------------------------------------------------------------+ | Threadpool_average_hp_queue_wait_us | avg: 0.000, min: 0.000, max: 0.000, dev: 0.000, cnt: 0 | | Threadpool_average_queue_wait_us | avg: 590.000, min: 470.000, max: 736.000, dev: 110.266, cnt: 5 | | Threadpool_idle_threads | 9 | | Threadpool_requests_not_entered_queue | 0 | | Threadpool_requests_waiting_in_hp_queue | 0 | | Threadpool_requests_waiting_in_queue | 0 | | Threadpool_threads | 10 | | Threads_cached | 0 | | Threads_connected | 1 | | Threads_created | 10 | | Threads_running | 2 | +-----------------------------------------+----------------------------------------------------------------+
d97f573 to
1d0c888
Compare
dlenev
left a comment
There was a problem hiding this comment.
Hello Oleksiy!
Here are some comments about your patch.
I think the first/most important thing for us is to agree whether we really need such a non-trivial infrastructure for gathering those aggregated stats. See below.
| } | ||
|
|
||
| /* Count requests not entered a queue yet*/ | ||
| int tp_get_requests_not_entered_queue_count() noexcept { |
There was a problem hiding this comment.
I have a problem with this value...
When there are too many busy threads each connection from the low priority queue will be counted twice,
once by tp_get_requests_waiting_in_queue_count() and then in tp_get_requests_not_entered_queue_count(). To me counting the same connection as being in queue and not entered in queue yet looks wrong.
Perhaps we need to invent some other way/status variable to make saturation situation visible? Or invent better name for this one? What do you think?
There was a problem hiding this comment.
That's the real question I do not have answer yet also.
https://perconadev.atlassian.net/browse/PS-10083 Counting without iterators
https://perconadev.atlassian.net/browse/PS-10083 Counting without iterators
https://perconadev.atlassian.net/browse/PS-10083 Counting without iterators, addressing other comments
7cc3d7c to
59af7f6
Compare
Add more statistics for threadpool: average queue wait time, requests waiting in queues, requests not entered queue
https://perconadev.atlassian.net/browse/PS-10083
Added highly optimized class for live statistic calculation in multi-threaded environment.
Added new status varables: