Rate This Document
Findability
Accuracy
Completeness
Readability

THREAD_POOL_GROUPS Table

THREAD_POOL_GROUPS provides information about a thread group.

Table 1 THREAD_POOL_GROUPS

Field

Description

GROUP_ID

Thread group ID

CONNECTIONS

Number of connections in a thread group. The value increases by 1 when a connection is set up.

THREADS

Number of threads in a thread group, including active, waiting, and idle threads.

ACTIVE_THREADS

Number of active threads in a thread group.

The value:

  • Increases by 1 after a thread is created and its initial status is active.
  • Increases by 1 when a listener thread changes to a worker thread or a worker thread changes from the idle or waiting state to the active state.
  • Decreases by 1 when a worker thread changes to a listener thread or enters the idle/waiting state.

STANDBY_THREADS

Number of waiting threads in a thread group.

  • When a thread enters the waiting state due to events such as I/O, lock, condition variable, and sleep, the number of waiting threads in the group increases by 1.
  • When a thread ends the waiting state, the value decreases by 1.

QUEUE_LENGTH

Total length of the priority queue and common queue in a thread group, that is, the number of tasks waiting to be processed in the thread group. The value:

  • Increases by 1 when a connection is set up and a login request is put into a common queue.
  • Increases by 1 when the thread group receives a network event of user connection and places the task in the common queue or priority queue.
  • Decreases by 1 when a network event task is pulled out from the priority queue or common queue.

HAS_LISTENER

Whether a listener thread exists in a thread group.

Possible cases:

  • When a worker thread does not obtain any task, the worker thread determines that there is no listener in the thread group before entering the idle state. In this case, the worker thread changes to a listener.
  • When a thread group is closed, the listener thread exits.
  • After a listener thread polls a network event by calling epoll_wait, if there is no task in the priority and common queues, the listener thread changes to a worker thread to process the first network event polled, and the listener thread no longer exists.

IS_STALLED

Whether a thread group is stalled. If neither the common queue nor the priority queue is empty, and no new task is put into the queues or no task is pulled out for processing in a period of time, the thread group is stalled.

Possible cases:

  • A thread group that is being initialized is not in the stalled state.
  • When executing check_stall, the timer thread checks whether any task in the thread group has been pulled from the queue since the last check_stall and whether the common and priority queues are empty. If no task has been pulled from the queue and the queues are not empty, the thread group is stalled.
  • When a worker thread pulls a task from the waiting queue, the task is about to be executed and the thread group is not stalled.