This is a module for monitoring the MySQL SQL database server health (latest versions in the 4 series). Carefully chosen relevant indicators are displayed, allowing the administrator to set meaningful thresholds.
On UNIX type platforms, it requires the mysqltcl package (at http://www.xdobry.de/mysqltcl/) for connection via the native MySQL protocol, or the tclodbc package (at http://tclodbc.sourceforge.net/) for connection via ODBC (Open DataBase Connectivity).
On Windows platforms, please read the install.txt file.
Data is drawn from the SHOW STATUS and SHOW VARIABLES query results and initially displayed in 1 table:
There are 2 data columns:
The data rows are:
100 - ((Key_reads / Key_read_requests) * 100)where the number of physical reads of a key block from disk has too be small compared to the actual number of requests to read a key block from the cache. An efficiency greater than 90 percent is good.
When an error occurs (communicating with the database server or any other type), cells in the version and uptime rows become empty, while all other cells are set to void numeric values (displayed as ?). A descriptive error message is also generated in such a case.
Please see the MySQL documentation about optimizing queries and the EXPLAIN command.
Use EXPLAIN to get see what is wrong. Do it not just for SELECT queries but also for UPDATE and DELETE queries.
For example, on a query such as:
UPDATE table SET ... WHERE x = 0try:
EXPLAIN SELECT * FROM table WHERE x = 0
$ moodss myhealth --host 126.96.36.199 $ moodss myhealth --host dbserver.company.com --port 3307 $ moodss myhealth --host dbserver.company.com --user status --password xxx $ moodss myhealth --dsn mydb --user status --password xxx
If you use Tcl/Tk 8.4.1 or above with the Tcl Threads package 2.5 or above, then the module will use threads for the database connection. This means that the core (moodss user interface for example) cannot be hung (moodss menus not responding, window not being updated, ...) when the connection with the database is failing.
You can check that moodss actually is in threads mode by looking at the bottom line of the module help window, while moodss is running: a status line will indicate whether threads are in use.