Threads statistics


Job details

Name: Threads statistics
Platform: Mysql
Category: Performance
Description: Checks the number of threads created per minute.
Long description: ‘thread’, mean either a client connection or an OS thread and there is 1-1 correspondence between threads and connections.
Version: 1.1
Default schedule: 2,7,12,17,22,27,32,37,42,47,52,57 * * *
Requires engine install: Yes
Compatibility tag: .[type=‘instance’ & is_mysql_branch=‘1′]/.[hasengine=‘YES’ & use_global_variables_performance_schema = ‘1′ ]

Parameters

Name Default value Description
warning threshold 30 The maximum value of created threads per minute (over a period of time defined by the [time threshold] parameter) before a warning is triggered.
alarm threshold 600 The maximum value of created threads per minute (over a period of time defined by the [time threshold] parameter) before an alarm is triggered.
threshold (time) 20 A period of time (in minutes) which must be passed (combined with the number of aborted clients) before an alarm or a warning is returned by the procedure.
enable warnings and alarms NO If set to “NO” (default), the alert will only collect statistics without returning status warning or alarm. Value “YES“ will activate the alert.
history threshold 7 The maximum number of day to kept statistics for in the historic tables.

Job Summary

What does it monitor

How does it work

The job uses SQL queries to pull the relevant data from the system’s performance schemas. The job runs at certain intervals, with the default schedule running every 5 minutes.

The job calculates the frequency of thread creation and compares this to set warning and alarm thresholds. If thread creation frequency surpasses these thresholds and alarms are enabled, the job will trigger either a warning or alarm status.

The job also records statistical data in history tables for further analysis and keeps these records for a period defined by the ‘history threshold’ parameter.

Report Output

The job produces a report titled ‘Aborted clients’ which gives the value of ‘thread_cache_size’ and displays graphic thread cache statistics over time. The report provides a visual representation of thread creation, caching and connection data, making it easier to track and monitor changes over time.

Metadata

The job is categorized under the ‘Performance’ category.