Difference between revisions of "Plugin:MySQL"

From collectd Wiki
Jump to: navigation, search
(Description)
m (Reverted edits by 122.255.5.130 (Talk); changed back to last version by Octo)
Line 8: Line 8:
 
   | Manpage=[http://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_mysql collectd.conf(5)]
 
   | Manpage=[http://collectd.org/documentation/manpages/collectd.conf.5.shtml#plugin_mysql collectd.conf(5)]
 
}}
 
}}
DmBkHw another one!
+
== Description ==
 +
 
 +
The <em>MySQL</em> plugin connects to an MySQL-database and issues a [http://dev.mysql.com/doc/refman/5.0/en/show-status.html <code>SHOW STATUS</code> command] periodically. The command returns the server status variables, many of which are collected. The plugin has successfully been tested with the MySQL versions 4 and&nbsp;5.
 +
 
 +
If you're looking for a way to create statistics by executing and interpreting SQL statements, take a look at the [[Plugin:DBI|DBI]] plugin.
 +
 
 +
If you hoped to find a way to store data <em>in</em> a MySQL database, you're unfortunately out of luck since that is not possible (yet). It does not exist, because we didn't come up with suitable concept yet. You can help us by adding your thoughts and ideas to the “[[Store To RDBMS]]” page. Actually writing the code is not the issue.
  
 
== Synopsis ==
 
== Synopsis ==

Revision as of 22:26, 6 May 2009

MySQL plugin
Type: read
Status: supported
First version: 3.6
Copyright: 2006–2008 Florian octo Forster
2008 Mirko Buffoni
License: GPLv2
Manpage: collectd.conf(5)
List of Plugins

Description

The MySQL plugin connects to an MySQL-database and issues a SHOW STATUS command periodically. The command returns the server status variables, many of which are collected. The plugin has successfully been tested with the MySQL versions 4 and 5.

If you're looking for a way to create statistics by executing and interpreting SQL statements, take a look at the DBI plugin.

If you hoped to find a way to store data in a MySQL database, you're unfortunately out of luck since that is not possible (yet). It does not exist, because we didn't come up with suitable concept yet. You can help us by adding your thoughts and ideas to the “Store To RDBMS” page. Actually writing the code is not the issue.

Synopsis

<Plugin "mysql">
  Host "localhost"
  User "collectd"
  Password "fee4eeCu"
  #Database "db_name"
  #Port "3306"
  #Socket "/path/to/unix/socket"
</Plugin>

Collected statistics

Command statistics

These values contain the number of issues per second for various SQL-commands. Counters that are zero (i. e. the command has never been issued since server startup) are ignored, since graphing all commands would create a lot of very uninteresting RRD-files which just eat up space..

Example graph

Plugin-mysql-command.png

Handler statistics

The handler statistics gathered basically refer to the operations that can be done on tables or table-rows. This graph can give you some information if you indexes are okay or if you need some work there. Read the server status variables documentation, though it leaves you with lots of questions. At least it left me wondering what was actually going on.. ;)

Example graph

Plugin-mysql-handler.png

Query-cache statistics

MySQL will try to cache queries (i. e. SELECT statements). Information about the query cache can be found on MySQL's homepage.

Example graph

Plugin-mysql-qcache.png

Thread statistics

Information about the threads of the MySQL process(es).

Example graph

Plugin-mysql-threads.png

Traffic statistics

Information about incoming and outgoing traffic (bytes).

Example graph

Plugin-mysql-traffic.png

Dependencies