Skip to content
Tubetti edited this page Jun 25, 2013 · 3 revisions

Table of Contents

Introduction

The MySQL monitor provides information regarding the MySQL database through the machine agent.

This interacts with the API's provided by MySQL to return the following metrics:

  • Availability -- What percentage of the time was the DB up. Drill through to show graph of up/down over time
  • Health Check -- list of most recent (most severe) logs, errrors, etc... (FUTURE)
  • Activity -- How much Throughput is the database producing over the last minute (Requests, transactions, tables, rows, bytes)
  • Resource Utilization -- How much of the Database's resource are currently in use, and how much is still available (Connections, threads, Cache memory)
  • Effeciency -- How well is the Database optimized to maximize Throughput. Is it using caches, indexes during its operations?

We also will display a TOP list of the following:

  • Top Queries -- queries that take up the most time during a certain interval of time
  • Top Activity -- What internal operation is taking up the most time in the database over a certain interval of time

MYSQL Monitor Metrics

Availability

  • Available (1 or 0)

Resource Utilization

  • Connections used (%)
  • ThreadsTotal Active Total Threads available in Cache
  • Tables -- total currently open
  • Memory** (MyISAM) Key Cache used (%)** Query Cache used (%)** (InnoDB) Buffer Pool used (%)** (InnoDB) Log File as percent of Buffer Pool

Activity

Connections** To* tal attempts per Minute** Total failed/aborted per Minute

  • Threads: Created per Minute
  • DB Requests per Minute
  • Transactions** In Progress** Committed per Minute** Rolled Back per Minute
  • Queries / DML** Number of Queries per Minute** Inserts per Minute** Deletes per Minute** Updates per Minute
  • Tables: Opened per Minute
  • Temp Tables: Created per Minute
  • (InnoDB) Rows Processed** Insert per Minute** Read per Minute** Update per Minute** Delete per Minute
  • Total Sorts per Minute
  • Bytes sent from/to client** KBytes sent per Minute** KBytes received per Minute
  • (InnoDB) Bytes of data processed internally** KBytes read per Minute** KBytes written per Minute
  • (InnoDB) number of file synchronizations per Minute
  • Top X operations running (FUTURE)
  • Top X Queries running (FUTURE)

Efficiency

  • Index Usage** % of Single table queries using index** % of Joins using index
  • % Sorts spilling to disk
  • % Queries that are slow
  • (MyISAM) % Table locks that waited
  • Temp Tables - Ratio of on disk vs. in memory
  • (InnoDB) Row Locking** Number of Row Locks being Waited on** (InnoDB) Avg time to wait for Row Lock (in Seconds)
  • Cache** Thread Cache - Hit Ratio** (MyISAM) Key Cache** Read Hit Ratio** Write Hit Ratio** (InnoDB) Buffer Pool** Hit Ratio** Waits for available empty pages to write to, per Minute** Query Cache - Hit Ratio

Installation Steps

Note: Machine agent has to be configured prior to installing monitors

  1. Go to /monitors and create a directory for the mysql monitor
  2. Extract the mysql.tar.gz to the newly made directory
  3. Open the monitor.xml

3.1 Change if the default value of 60 is too long. This defines how often the monitor should execute and collect metrics.

3.2 Change if the default value of 60 is too long. This defines how long the application should wait before timing out.

3.3. Change the default-value of "host" under if the mysql is not in "localhost" 3.4. Change the default-value of "port" under if the mysql is not in port 3306 3.5. Change the default-value of the username under if the default user is not "root" 3.6. Change the default-value of the password under if the default password is not "welcome" 3.7. (OPTIONAL) Change the default-value of the tier under if you want this metric to appear under a specific tier. Else the metrics will be registered in every tier.

  1. Run the machine agent and the monitor should be uploading metrics.