Maximum connections alert
Job details
Name: |
Maximum connections alert |
Platform: |
Mariadb |
Category: |
Availability |
Description: |
Collects uptime statistics for the MariaDB instance. |
Long description: |
|
Version: |
1.21 |
Default schedule: |
10m |
Requires engine install: |
No |
Compatibility tag: |
.[type=‘instance’ & is_mariadb_branch=‘1′] |
Parameters
Name |
Default value |
Description |
used_alarm_threshold |
95 |
Connections used out off max connections percent for triggering alarm |
used_warning_threshold |
90 |
Connections used out off max connections percent for triggering warning |
Job Summary
- Purpose: The job “MariaDB max connections” is designed to monitor the usage of database connections and alert when the number of active connections approaches the configured limits.
- Why: This job is crucial for maintaining database performance and availability. If the number of active connections reaches or exceeds the maximum allowed, new connections could be denied, potentially disrupting service and affecting application performance. By monitoring connection usage, system administrators can intervene or automate processes to prevent service degradation.
- Manual checking: To manually check the connection usage in comparison to the maximum allowed connections in a MariaDB instance, you can use the following commands:
SHOW VARIABLES LIKE 'max_connections';
SHOW STATUS LIKE 'Threads_connected';
Job Details
Metric |
Details |
Name |
MariaDB max connections |
Description |
Monitoring maximum database connections and alerting based on thresholds |
Version |
1.21 |
Company |
dbwatch.com |
Category |
Availability |
Default Schedule |
Every 10 minutes |
Alarm Threshold |
95% usage of maximum connections triggers an alarm |
Warning Threshold |
90% usage of maximum connections triggers a warning |
Compatibility and Installation
This monitoring job is specifically compatible with MariaDB instances (where ‘is_mariadb_branch’ is set to ‘1′). It should be installed on instances where the maximum number of connections needs to be closely monitored to prevent database access issues.
Alerting Logic
- The job calculates the percentage of used connections against the maximum.
- If the percentage exceeds the alarm threshold (95% by default), it sets the job status to ‘2′ (error) and crafts an error message describing the condition.
- If the percentage exceeds the warning threshold (90% by default) but is below the alarm threshold, it sets the job status to ‘1′ (warning), unless it is already in an error state.
- An informative message is displayed in both warning and alarm conditions, showing the current and maximum connections, as well as the percentage used.
- If maximum connections are set to 0 (indicative of an error or misconfiguration), it will also report that max_connections could not be found.
Monitoring and Reporting
The information about the connection usage is reported in detail in the provided output format. The results include real-time statuses of current usage rates versus the thresholds set, helping administrators keep a pulse on the health and performance of the database in terms of connection availability.