Buy Percona ServicesBuy Now!

Using the Percona Monitoring and Management Platform

You can access the PMM web interface using the IP address of the host where PMM Server is running. For example, if PMM Server is running on a host with IP 192.168.100.1, access the following address with your web browser: http://192.168.100.1.

The landing page has links to corresponding PMM tools:

These tools provide comprehensive insight into the performance of a MySQL host.

Query Analytics

The Query Analytics tool enables database administrators and application developers to analyze database queries over periods of time and find performance problems. Query Analytics helps you optimize database performance by making sure that queries are executed as expected and within the shortest time possible. In case of problems, you can see which queries may be the cause and get detailed metrics for them.

_images/query-analytics.png

QAN helps analyze database queries over periods of time and find performance problems.

QAN displays its metrics in both visual and numeric form: the performance related characteristics appear as plotted graphics with summaries.

_images/pmm.home-page.1.png

QAN is available from the home page of PMM. Click the Query Analytics button to access QAN.

Open QAN from the PMM home page

To start working with QAN, click the Query Analytics button on the PMM home page. Then, select a database at the top of the page from the list of database instances where the PMM client is installed.

The list of queries opens below in a summary table. Be default, QAN shows the top ten queries ranked by %GTT (Grand total time) as a result of monitoring your database server for the last hour. Each query displays three essential metrics: Load, Count, and Latency.

To view more queries, click the Load next 10 queries button below the query summary table.

_images/pmm.qan.query-summary-table.default.1.png

The query summary table shows the monitored queries from the selected database.

Filtering Queries

If you need to limit the list of available queries to only those that you are interested in, use the Query Filter field located above the query summary table.

In the Query Filter field, you can enter a query ID, query abstract, or query fingerprint. The ID is a unique signature of a query and looks like a long hexadecimal number. Note that each query in the summary table displays its ID in the ID column.

The query fingerprint is a simplified form of a query: all specific values are replaced with placeholders. You may enter only a fragment of the fingerprint to view all queries that contain that fragment in their fingerprints.

The query abstract is the portion of the query fingerprint which contains the type of the query, such as SELECT or FIND, and the attributes from the projection (a set of requested columns in case of MySQL database, for example).

When you apply your filter, the query summary table changes to display only the queries which match your criterion. Note that the TOTAL row which runs above the list of queries in the summary table does not change its values. These are always calculated based on all queries run within the selected time or date range.

_images/pmm.qan.query-summary-table.1.png

A list of queries

Selecting Time or Date Range

The query metrics that appear in QAN are computed based on a time period or a range of dates. The default value is the last hour. To set another range use the range selection tool located at the top of your QAN page.

_images/pmm.qan.range-selection.1.png

QAN displays query metrics for the time period or date range that you specify.

The tool consists of two parts. The Quick ranges offers frequently used time ranges: from 1 hour to 5 days. Use the date picker to set a range of dates.

Totals of the Query Summary

The first line of the summary table contains the totals of the load, count, and latency for all queries that were run on the selected database server during the time period that you’ve specified.

_images/pmm.qan.query-summary-table.totals.1.png

The totals appear at the top of the query summary table.

The load is the amount of time that the database server spent during the selected time or date range running all queries.

The count is the average number of requests to the server during the specified time or date range.

The latency is the average amount of time that it took the database server to retrieve and return the data.

Queries in the Query Summary Table

Each row in the query summary table contains information about a single query. Each column is query attribute. The Abstract attribute is an essential part of the fingerprint which informs the type of query, such as INSERT, or UPDATE, and the queried tables, or collections. The ID attribute is a unique hexadecimal number associated with the given query.

The Load, Count, and Latency attributes refer to the essential metrics of each query. Their values are plotted graphics and summary values in the numeric form. The summary values have two parts. The average value of the metric and its percentage with respect to the corresponding total value at the top of the query summary table.

Viewing a Specific Value of a Metric

If you hover the cursor over one of the metrics in a query, you can see a concrete value at the point where your cursor is located. Move the cursor along the plotted line to watch how the value is changing.

_images/pmm.qan.query-summary-table.1.png

Hover the cursor to see a value at the point.

Zooming into a Query

Click one of the queries to zoom it in. QAN displays detailed information about the query in the query metrics summary table below the query summary table. The detailed information includes the query type specific metrics. It also contains details about the database and tables which are used in the query.

_images/pmm.qan.query-metrics.1.png

Select a query from the query summary table to open its metrics.

Query Section

In addition to the metrics in the query metrics summary table, QAN displays more information about the query itself. The Query section contains the fingerprint and an example of the query.

_images/pmm.qan.query.1.png

The Query section shows the SQL statement for the selected query.

Explain Section

The Explain section enables you to run EXPLAIN on the selected query directly from the PMM web interface (simply specify the database).

_images/qan-realtime-explain.png

The output appears in two forms: classic and JSON. The classic form presents the attributes of the EXPLAIN command as columns of a table. The JSON format presents the output of EXPLAIN as a JSON document.

_images/pmm.qan.explain.1.png

The two output formats of the EXPLAIN command.

Note that the :EXPLAIN command only works with the following statements:

  • SELECT
  • DELETE
  • INSERT
  • REPLACE
  • UPDATE

If you are viewing the details of a query of another type, the Explain section will not contain any data.

Table Info Section

At the bottom, you can run Table Info for the selected query. This enables you to get SHOW CREATE TABLE, SHOW INDEX, and SHOW TABLE STATUS for each table used by the query directly from the PMM web interface.

_images/qan-create-table.png

Configuring Query Analytics

The Configure Query Analytics button located next to the list of database instances opens a page with settings, status, and log for the selected database instance.

Settings Tab

The Settings tab displays the essential configuration settings of the database server selected from the Databases list. From this tab you can see which DSN is being used as well as the database server version. This tab contains several settings which influence how the monitored data are collected. Note that these settings cannot be changed directly in QAN. You need to set the appropriate options by using the tools from the database server itself. You can, however, select where the database server mentrics are collected from, such as slow log, or performance schema. For this, change the value of the Collect from field accordingly.

_images/pmm.qan.settings.1.png

The Settings tab to view the essential settings of the selected database server.

Status Tab

The Status tab contains detailed information about the current status of the monitored database server. QAN collects this information from the database server directly. For example, in case of a MySQL server, the SHOW STATUS command is used.

Note

Viewing Database and Server Summary Information

The View database and server summary info button that appears next to the Configure Query Analytics button shows detailed infromation about the selected database as well as the platform where it is deployed. When clicked, this button reveals two sections. The System Summary section contains details about the platform while the Database Summary offers detailed statistics about the database server.

_images/pmm.qan.view-database-and-server-summary-info.1.png

The System summary and Database summary (showing only fragments of both sections)

Log Tab

The Log tab contains the latest version of the monitored log, such as slow log. At the top of this tab, you may notice when exactly the snapshot was taken.

Performance Schema

The default source of query data for PMM is the slow query log. It is available in MySQL 5.1 and later versions. Starting from MySQL 5.6 (including Percona Server 5.6 and later), you can select to parse query data from the Performance Schema. Starting from MySQL 5.6.6, Performance Schema is enabled by default.

Performance Schema is not as data-rich as the slow query log, but it has all the critical data and is generally faster to parse. If you are running Percona Server, a properly configured slow query log will provide the most amount of information with the lowest overhead. Otherwise, using Performance Schema will likely provide better results.

To use Performance Schema:

  1. Make sure that the performance_schema variable is set to ON:

    mysql> SHOW VARIABLES LIKE 'performance_schema';
    +--------------------+-------+
    | Variable_name      | Value |
    +--------------------+-------+
    | performance_schema | ON    |
    +--------------------+-------+
    

    If not, add the the following lines to my.cnf and restart MySQL:

    [mysql]
    performance_schema=ON
    

    Note

    Performance Schema instrumentation is enabled by default in MySQL 5.6.6 and later versions. It is not available at all in MySQL versions prior to 5.6.

  2. Configure QAN agent to collect data from Performance Schema:

    If the instance is already running:

    1. Open the Settings section in the Query Analytics web UI.
    2. Select Performance Schema in the Collect from drop-down list.
    3. Click Apply to save changes.

    If you are adding a new monitoring instance with the pmm-admin tool, use the --query-source perfschema option. For example:

    sudo pmm-admin add mysql --user root --password root --create-user --query-source perfschema
    

For more information, run pmm-admin add mysql --help.

QAN for MongoDB

MongoDB is conceptually different from relational database management systems, such as MySQL or MariaDB. Relational database management systems store data in tables that represent single entities. In order to represent complex objects you may need to link records from multiple tables. MongoDB, on the other hand, uses the concept of a document where all essential information pertaining to a complex object is stored together.

_images/pmm.qan.query-summary-table.mongodb.1.png

A list of queries from a MongoDB host

QAN supports monitoring MongoDB queries. Although MongoDB is not a relational database management system, you analyze its databases and collections in the same interface using the same tools. By using the familiar and intuitive interface of QAN you can analyze the efficiency of your application reading and writing data in the collections of your MongoDB databases.

Note

Suppored MongoDB versions

PMM supports MongoDB version 3.2 or higher.

_images/pmm.qan.query-metrics.mongodb.1.png

Analyze MongoDB queries using the same tools as relational database management systems.

Metrics Monitor

The Metrics Monitor tool provides a historical view of metrics that are critical to a database server. Time-based graphs are separated into dashboards by themes: some are related to MySQL or MongoDB, others provide general system metrics.

When you open Metrics Monitor for the first time, it loads the Cross Server Graphs dashboard. The credentials used to sign in to Grafana depend on the options that you specified when starting PMM Server:

  • If you did not specify either SERVER_USER or SERVER_PASSWORD, you will be signed in anonymously. You can change to a different existing Grafana user.
  • If you specified both SERVER_USER and SERVER_PASSWORD, then these credentials will be used to sign in to Grafana.
  • If you specified only SERVER_PASSWORD, a single user (pmm) will be used to sign in to all components (including QAN, Prometheus, Grafana, etc.). You will not be able to change to a different Grafana user.
  • If you specified only SERVER_USER, this parameter will be ignored.

Warning

Do not include the # or : symbols in SERVER_USER.

To access the dashboards, provide default user credentials:

  • User: admin
  • Password: admin

On the Home screen, select a dashboard from the list of available Percona Dashboards. For example, the following image shows the MySQL Overview dashboard:

_images/metrics-monitor.png

Each graph has a graph descriptions to display more information about the monitored data without cluttering the interface.

These are on-demand descriptions in the tooltip format that you can find by hovering the mouse pointer over the More information icon at the top left corner of a graph. When you move the mouse pointer away from the More information button the description disappears.

_images/pmm.metrics-monitor.description.1.png

Graph descriptions provide more information about a graph without claiming any space in the interface.

MySQL MyRocks dashboard

The MyRocks storage engine developed by Facebook based on the RocksDB storage engine is applicable to systems which primarily interact with the database by writing data to it rather than reading from it. MyRocks also features a good level of compression, higher than that of the InnoDB storage engine, which makes it especially valuable when optimizing the usage of hard drives.

PMM collects statistics on the MyRocks storage engine for MySQL in the metrics monitor as a separate dashboard titled MySQL MyRocks Metrics. The main sourse of information for this dashboard comes from the information schema tables.

_images/pmm.metrics-monitor.mysql-myrocks-metrics.1.png

The MySQL MyRocks metrics dashboard

Orchestrator

Orchestrator is a MySQL replication topology management and visualization tool. If it is enabled, you can access it using the /orchestrator URL after PMM Server address. Alternatively, you can click the MySQL Replication Topology Manager button on the main PMM Server landing page.

To use it, create a MySQL user for Orchestrator on all managed instances:

GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orc_client_user'@'%' IDENTIFIED BY 'orc_client_password’;

Note

The credentials in the previous example are default. If you use a different user name or password, you have to pass them when running PMM Server using the following options:

-e ORCHESTRATOR_USER=name -e ORCHESTRATOR_PASSWORD=pass

Then you can use the Discover page in the Orchestrator web interface to add the instances to the topology.

Note

Orchestrator not enabled by default starting with PMM 1.3.0

Orchestrator was included into PMM for experimental purposes. It is a standalone tool, not integrated with PMM other than that you can access it from the landing page.

In version 1.3.0 and later, Orchestrator is not enabled by default. To enable it, see Additional parameters in the Running PMM Server Using Docker section.

Table Of Contents

Previous topic

Starting Data Collection

Next topic

Managing PMM Client

Visit Percona Store


General Inquiries

For general inquiries, please send us your question and someone will contact you.