interpreting mysql graphs for cacti

I am montioring my webserver with cacti using these plugins. the graph Percona MySQL Connections GT show the connections increasing every day by 10/20. when i log into the server and check using cli it is not correct.


#mysqladmin --p extended-status | grep -wi 'threads_connected\|threads_running' | awk '{ print $2,$4}'
Threads_connected 3
Threads_running 1





mysql> show processlist;
+-------+------+-----------+------+---------+------+-------+------------------+
| Id | User | Host | db | Command | Time | State | Info |
+-------+------+-----------+------+---------+------+-------+------------------+
| 58625 | root | localhost | NULL | Query | 0 | NULL | show processlist |
+-------+------+-----------+------+---------+------+-------+------------------+
1 row in set (0.00 sec)


Hi shorif2000;

I’m not familiar with that specific graph, however based on the graph name and what you describe seeing, it is likely showing you the total number of connections over time (“GT” might stand for grand total). What you are looking at in your query is threads connected / running, which are current connections. What the graph is likely showing is a running total of the MySQL status variable “Connections”, which is the total number of connections since the server was last restarted:

mysql> show global status like “Connections”;
±--------------±--------+
| Variable_name | Value |
±--------------±--------+
| Connections | 123456 |
±--------------±--------+
1 row in set (0.00 sec)

So depending on when you last restarted your MySQL server, and when you installed the graph plugins, the above command may or may not match the graph (depends on if the graph is cumulative or not). But you can test it by grabbing the value of “Connections” now and then grab it 24 hours later, and see if the difference matches the increase in the graph (i.e. if “Connections” from MySQL changes by 20, then see if your graph also went up by 20).

-Scott