[MDEV-19167] Add stall-related status variables to thread pool Created: 2019-04-04  Updated: 2019-05-21  Resolved: 2019-05-10

Status: Closed
Project: MariaDB Server
Component/s: Variables
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Vladislav Vaintroub
Resolution: Won't Do Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-19313 Threadpool : provide information sche... Closed

 Description   

It might make sense to add some stall-related status variables to the Unix implementation of the thread pool.

Maybe like:

  • Threadpool_stalled_thread_groups

This could get incremented if the timer thread detects a stall. Around here:

https://github.com/MariaDB/server/blob/3503fbbebf90cb0fe63993a66dad9bf97fb74c0a/sql/threadpool_generic.cc#L735

  • Threadpool_throttled_thread_creations

This could get incremented if the timer thread does not create a new worker thread when a stall is detected because the thread group was still within the throttling interval. Around here:

https://github.com/MariaDB/server/blob/3503fbbebf90cb0fe63993a66dad9bf97fb74c0a/sql/threadpool_generic.cc#L1025

  • Threadpool_oversubscribed_thread_groups

This could get incremented every time a thread has to go to sleep because the thread group already has thread_pool_oversubscribe active threads. Around here:

https://github.com/MariaDB/server/blob/3503fbbebf90cb0fe63993a66dad9bf97fb74c0a/sql/threadpool_generic.cc#L1218



 Comments   
Comment by Vladislav Vaintroub [ 2019-04-08 ]

Throttles, or thread creations, or wakeups, do not always happen because of stall.
There are 3 reasons for wakeups or thread creations -

  • "wait" (thd_wait_begin). This notification helps to keep the number of active threads in the group > 0 (usually 1)
  • "stall" detected by timer thread. This helps to reduce queue time of queries, if one query takes "long time".
  • the need to processed queued events if no thread in the group is currently active. This is detected by listener thread
Comment by Vladislav Vaintroub [ 2019-05-10 ]

GeoffMontee , can we maybe close it in favor of more solid MDEV-19313 ?

Comment by Geoff Montee (Inactive) [ 2019-05-10 ]

Sure, the idea in MDEV-19313 sounds great.

Generated at Thu Feb 08 08:49:33 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.