Wie geht es dem MySQL-Server?

Diese Frage beantwortet das Tool "MySQLTuner" dem Administrator des Servers.

Die Ausgabe gibt dabei Auskunft über den Status des Server und zusätzlich gibt es ein paar Tipps, was der Administrator ändern kann, damit die Effizienz und Performanz des Servers gesteigert wird.

Für eine Liste der Features zitiere ich einfach mal die Seite des Herstellers:

  • NEW! Remote server checks: Connects to remote servers to perform tests.
  • NEW! Convenient MySQL logins: MySQLTuner will automatically log in to MySQL on servers running Plesk, servers with ~/.my.cnf files, and server without MySQL root passwords. If you need to authenticate manually, you can pass the username and password on the command line or provide the credentials interactively.
  • NEW! Manually set memory sizes: Users on virtual environments can now specify how much RAM and swap memory are present so that the scripts calculations will be accurate.
  • Memory Usage: Calculates MySQL memory usage at max load and makes recommendations for increasing or decreasing the MySQL memory footprint. Per-thread and server-wide buffer data is calculated separately for an accurate snapshot of the servers configuration.
  • Slow Queries: Reviews the amount of slow queries relative to the total queries. Slow query time limits are also analyzed and recommendations are made.
  • Connections: Current and historical connection counts are reviewed.
  • Key Buffer: Takes configuration data and compares it to the actual indexes found in MyISAM tables. Key cache hit rates are calculated and variable adjustments are suggested.
  • Query Cache: Query cache hit rates and usage percentages are used to make recommendations for the query cache configuration variables.
  • Sorting & Joins: Per-thread buffers that affect sorts and joins are reviewed along with the statistics from the queries run against the server.
  • Temporary Tables: Variable recommendations are made to reduce temporary tables that are written to the disk.
  • Table Cache: Compares total tables opened to the currently open tables. Calculates the table cache hit rate in order to make suggestions.
  • Open Files: Determines if the server will approach or run into the open file limit set by the operating system or the MySQL server itself.
  • Table Locks: Finds table locking that forces queries to wait and makes suggestions for reducing locks that require a wait.
  • Thread Cache: Calculates how many times MySQL must create a new thread to respond to a query.
  • Aborted Connections: Finds applications that are not closing connections to MySQL properly.
  • Read/Write Ratios: Calculates the percentage of read and write operations on your MySQL installation.
(Quelle: http://rackerhacker.com/mysqltuner/)
Nach einigen Tests habe ich mir das Script als Cronjob eingerichtet, damit ich täglich einen Statusbericht über meinen MySQL-Server in meinem Postfach finde und unter Umständen auf Fehler in der Konfiguration oder andere Probleme reagieren kann.