summaryrefslogtreecommitdiff
path: root/sql/threadpool_generic.cc
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2019-05-26 13:35:07 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2019-05-26 19:20:35 +0200
commit307ca6935669ae9621aa36239ff3803b60640622 (patch)
tree2a56e34497d2f95f6319c463588ad142aeb1690f /sql/threadpool_generic.cc
parent2fc13d04d16f878ed693ad8ba56045b79ccb9650 (diff)
downloadmariadb-git-307ca6935669ae9621aa36239ff3803b60640622.tar.gz
Add some variables to the generic threadpool, that could help to analyze
stalls etc better. - thread_pool_exact_stats - uses high precision timestamp for the time when connection was added to the queue. This timestamp helps calculating queuing time shown in I_S.THREADPOOL_QUEUES entries. - If thread_pool_dedicated_listener is on, then each group will have its own dedicated listener, that does not convert to worker. With this variable on, the queueing time in I_S.THREADPOOL_QUEUES , and actual queue size in I_S.THREADPOOOL_GROUPS will be more exact, since IO request are immediately dequeued from poll, without delay. Part of MDEV-19313.
Diffstat (limited to 'sql/threadpool_generic.cc')
-rw-r--r--sql/threadpool_generic.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/sql/threadpool_generic.cc b/sql/threadpool_generic.cc
index 3cb7be26eb7..162dad2e866 100644
--- a/sql/threadpool_generic.cc
+++ b/sql/threadpool_generic.cc
@@ -744,7 +744,7 @@ static TP_connection_generic * listener(worker_thread_t *current_thread,
more workers.
*/
- bool listener_picks_event=is_queue_empty(thread_group);
+ bool listener_picks_event=is_queue_empty(thread_group) && !threadpool_dedicated_listener;
queue_put(thread_group, ev, cnt);
if (listener_picks_event)
{
@@ -1068,7 +1068,7 @@ static void queue_put(thread_group_t *thread_group, TP_connection_generic *conne
{
DBUG_ENTER("queue_put");
- connection->dequeue_time= pool_timer.current_microtime;
+ connection->enqueue_time= threadpool_exact_stats?microsecond_interval_timer():pool_timer.current_microtime;
thread_group->queues[connection->priority].push_back(connection);
if (thread_group->active_thread_count == 0)