Percona Monitoring An Management
Percona Monitoring An Management
Percona Monitoring An Management
Documentation
Release 1.17.0
I Basics 3
II Advanced 59
i
ii
Percona Monitoring and Management Documentation, Release 1.17.0
Percona Monitoring and Management (PMM) is an open-source platform for managing and monitoring MySQL and
MongoDB performance. It is developed by Percona in collaboration with experts in the field of managed database
services, support and consulting.
PMM is a free and open-source solution that you can run in your own environment for maximum security and relia-
bility. It provides thorough time-based analysis for MySQL and MongoDB servers to ensure that your data works as
efficiently as possible.
CONTENTS 1
Percona Monitoring and Management Documentation, Release 1.17.0
2 CONTENTS
Part I
Basics
3
CHAPTER
ONE
The PMM platform is based on a client-server model that enables scalability. It includes the following modules:
• PMM Client installed on every database host that you want to monitor. It collects server metrics, general system
metrics, and Query Analytics data for a complete performance overview.
• PMM Server is the central part of PMM that aggregates collected data and presents it in the form of tables,
dashboards, and graphs in a web interface.
The modules are packaged for easy installation and usage. It is assumed that the user should not need to understand
what are the exact tools that make up each module and how they interact. However, if you want to leverage the full
potential of PMM, the internal structure is important.
• PMM Client
• PMM Server
• Orchestrator
PMM is a collection of tools designed to seamlessly work together. Some are developed by Percona and some are
third-party open-source tools.
Note: The overall client-server model is not likely to change, but the set of tools that make up each component may
evolve with the product.
5
Percona Monitoring and Management Documentation, Release 1.17.0
PMM Client
Each PMM Client collects various data about general system and database performance, and sends this data to the
corresponding PMM Server.
The PMM Client package consist of the following:
• pmm-admin is a command-line tool for managing PMM Client, for example, adding and removing database
instances that you want to monitor. For more information, see Managing PMM Client.
• pmm-mysql-queries-0 is a service that manages the QAN agent as it collects query performance data from
MySQL and sends it to the QAN API on PMM Server.
• pmm-mongodb-queries-0 is a service that manages the QAN agent as it collects query performance data
from MongoDB and sends it to QAN API on PMM Server.
• node_exporter is a Prometheus exporter that collects general system metrics.
• mysqld_exporter is a Prometheus exporter that collects MySQL server metrics.
PMM Server
PMM Server runs on the machine that will be your central monitoring host. It is distributed as an appliance via the
following:
• Docker image that you can use to run a container
• OVA (Open Virtual Appliance) that you can run in VirtualBox or another hypervisor
• AMI (Amazon Machine Image) that you can run via Amazon Web Services
For more information, see Installing PMM Server.
PMM Server includes the following tools:
• Query Analytics enables you to analyze MySQL query performance over periods of time. In addition to the
client-side QAN agent, it includes the following:
– QAN API is the backend for storing and accessing query data collected by the QAN agent running on a
PMM Client.
– QAN Web App is a web application for visualizing collected Query Analytics data.
• Metrics Monitor provides a historical view of metrics that are critical to a MySQL or MongoDB server instance.
It includes the following:
– Prometheus is a third-party time-series database that connects to exporters running on a PMM Client and
aggregates metrics collected by the exporters. For more information, see Prometheus Docs.
* Consul provides an API that a PMM Client can use to remotely list, add, and remove hosts for
Prometheus. It also stores monitoring metadata. For more information, see Consul Docs.
Warning: Although the Consul web UI is accessible, do not make any changes to the configura-
tion.
– Grafana is a third-party dashboard and graph builder for visualizing data aggregated by Prometheus in an
intuitive web interface. For more information, see Grafana Docs.
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 PMM Server landing page.
To use it, create a MySQL user for Orchestrator on all managed instances:
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 ORCHESTRATOR_PASSWORD and ORCHESTRATOR_USER
options.
Then you can use the Discover page in the Orchestrator web interface to add the instances to the topology.
TWO
PMM (Percona Monitoring and Management) is designed to be scalable for various environments. If you have just
one MySQL or MongoDB server, you can install and run both PMM server and PMM clients on one database host.
It is more typical to have several MySQL and MongoDB server instances distributed over different hosts. In this case,
you need to install the PMM client package on each database host that you want to monitor. In this scenario, the PMM
server is set up on a dedicated monitoring host.
In this chapter
To install and set up the PMM Server, use one of the following options:
Docker images of PMM Server are stored at the percona/pmm-server public repository. The host must be able to run
Docker 1.12.6 or later, and have network access.
PMM needs roughly 1GB of storage for each monitored database node with data retention set to one week. Minimum
memory is 2 GB for one monitored database node, but it is not linear when you add more nodes. For example, data
from 20 nodes should be easily handled with 16 GB.
Make sure that the firewall and routing rules of the host do not constrain the Docker container. For more information,
see How to troubleshoot communication issues between PMM Client and PMM Server?.
For more information about using Docker, see the Docker Docs.
9
Percona Monitoring and Management Documentation, Release 1.17.0
Important: By default, retention is set to 30 days for Metrics Monitor and to 8 days for PMM Query Analytics. Also
consider disabling table statistics, which can greatly decrease Prometheus database size.
A Docker image is a collection of preinstalled software which enables running a selected version of PMM Server on
your computer. A Docker image is not run directly. You use it to create a Docker container for your PMM Server.
When launched, the Docker container gives access to the whole functionality of PMM.
PMM Server deployment via Docker can be done either automatically with a special installation script, or manually.
Both variants are covered in the following sections.
Automatic installation of the PMM Server is done with a special script, get-pmm.sh. This script should be downloaded
and executed, for example with the following two commands:
sh get-pmm.sh
This script should be executed under root user, or under non-root user either with rights to run docker containers, or
with privileges to run sudo command.
Being executed, get-pmm.sh performs following actions:
• checking if Docker is installed, and trying to install it if not,
• running Docker if necessary,
• downloading the PMM Server image,
• generating the necessary pmm-data container,
• configuring and starting the PMM Server container.
Manual Installation
The setup begins with pulling the required Docker image. Then, you proceed by creating a special container for
persistent PMM data. The last step is creating and launching the PMM Server container.
This step is not required if you are running PMM Server for the first time. However, it ensures that if there is an older
version of the image tagged with latest available locally, it will be replaced by the actual latest version.
To create a container for persistent PMM data, run the following command:
$ docker create \
-v /opt/prometheus/data \
-v /opt/consul-data \
-v /var/lib/mysql \
-v /var/lib/grafana \
--name pmm-data \
percona/pmm-server:latest /bin/true
Note: This container does not run, it simply exists to make sure you retain all PMM data when you upgrade to a
newer PMM Server image. Do not remove or re-create this container, unless you intend to wipe out all PMM data and
start over.
Important: Make sure that the data volumes that you initialize with the -v option match those given in the example.
PMM Server expects that those directories are bind mounted exactly as demonstrated.
To create and launch PMM Server in one command, use docker run:
$ docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:latest
• The docker run command runs a new container based on the percona/pmm-server:latest image.
• The -d option starts the container in the background (detached mode).
• The -p option maps the port for accessing the PMM Server web UI. For example, if port 80 is not available,
you can map the landing page to port 8080 using -p 8080:80.
• The -v option mounts volumes from the pmm-data container (see Creating the pmm-data Container).
• The --name option assigns a custom name to the container that you can use to reference the container within
the Docker network. In this case: pmm-server.
• The --restart option defines the container’s restart policy. Setting it to always ensures that the Docker
daemon will start the container on startup and restart it if the container exits.
• percona/pmm-server:latest is the name and version tag of the image to derive the container from.
To install specific PMM Server version instead of the latest one, just put desired version number after the colon. Also
in this scenario it may be useful to prevent updating PMM Server via the web interface with the DISABLE_UPDATES
docker option.
For example, installing version 1.14.1 with disabled update button in the web interface would look as follows:
$ docker create \
-v /opt/prometheus/data \
-v /opt/consul-data \
-v /var/lib/mysql \
-v /var/lib/grafana \
--name pmm-data \
percona/pmm-server:1.14.1 /bin/true
$ docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
-e DISABLE_UPDATES=true \
--restart always \
percona/pmm-server:1.14.1
Additional options
When running the PMM Server, you may pass additional parameters to the docker run subcommand. All options
that appear after the -e option are the additional parameters that modify the way how PMM Server operates.
The section PMM Server Additional Options lists all supported additional options.
See also:
Default ports Ports in Terminology Reference
Updating PMM Updating PMM
Backing Up the PMM Server Docker container Backing Up PMM Data from the Docker Container
Restoring pmm-data Restoring the Backed Up Information to the PMM Data Container
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS
˓→ PORTS NAMES
480696cd4187 percona/pmm-server:1.4.0 "/opt/entrypoint.sh" 4 weeks ago Up
˓→About an hour 192.168.100.1:80->80/tcp, 443/tcp pmm-server
The version number is visible in the Image column. For a Docker container created from the image tagged latest,
the Image column contains latest and not the specific version number of PMM Server.
The information about the currently installed version of PMM Server is available from the /srv/update/main.
yml file. You may extract the version number by using the docker exec command:
You need to create a backup version of the current pmm-server container if the update procedure does not complete
successfully or if you decide not to upgrade your PMM Server after trying the new version.
The docker stop command stops the currently running pmm-server container:
The following command simply renames the current pmm-server container to avoid name conflicts during the
update procedure:
Docker images for all versions of PMM are available from percona/pmm-server Docker repository.
When pulling a newer Docker image, you may either use a specific version number or the latest image which
always matches the highest version number.
This example shows how to pull a specific version:
After you have pulled a new version of PMM from the Docker repository, you can use docker run to create a
pmm-server container using the new image.
$ docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:latest
Important: The pmm-server container must be stopped before attempting docker run.
The docker run command refers to the pulled image as the last parameter. If you used a specific version number
when running docker pull (see Pulling the PMM Server Docker Image) replace latest accordingly.
Note that this command also refers to pmm-data as the value of --volumes-from option. This way, your new
version will continue to use the existing data.
Warning: Do not remove the pmm-data container when updating, if you want to keep all collected data.
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED
˓→STATUS PORTS NAMES
480696cd4187 percona/pmm-server:1.5.0 "/opt/entrypoint.sh" 4 minutes ago Up 4
˓→minutes 192.168.100.1:80->80/tcp, 443/tcp pmm-server
Then, make sure that the PMM version has been updated (see PMM Version) by checking the PMM Server web
interface.
After you have tried the features of the new version, you may decide to continupe using it. The backup container that
you have stored (Creating a backup version of the current pmm-server Docker container) is no longer needed in this
case.
To remove this backup container, you need the docker rm command:
$ docker rm pmm-server-backup
As the parameter to docker rm, supply the tag name of your backup container.
If, for whatever reason, you decide to keep using the old version, you just need to stop and remove the new
pmm-server container.
Now, rename the pmm-server-backup to pmm-server (see Creating a backup version of the current pmm-
server Docker container) and start it.
Warning: Do not use the docker run command to start the container. The docker run command creates
and then runs a new container.
To start a new container use the docker start command.
See also:
Setting up a Docker container Setting Up a Docker Container for PMM Server
Backing Up the PMM Server Docker container Backing Up PMM Data from the Docker Container
Updating the PMM Server and the PMM Client Updating section.
When PMM Server is run via Docker, its data are stored in the pmm-data container. To avoid data loss, you can
extract the data and store outside of the container.
This example demonstrates how to back up PMM data on the computer where the Docker container is run and then
how to restore them.
To back up the information from pmm-data, you need to create a local directory with essential sub folders and then
run Docker commands to copy PMM related files into it.
1. Create a backup directory and make it the current working directory. In this example, we use pmm-data-backup
as the directory name.
$ mkdir -p opt/prometheus
$ mkdir -p var/lib
Now, your PMM data are backed up and you can start PMM Server again:
See also:
Restoring pmm-data Restoring the Backed Up Information to the PMM Data Container
Updating PMM Server run via Docker Updating PMM Server Using Docker
If you have a backup copy of your pmm-data container, you can restore it into a Docker container. Start with
renaming the existing PMM containers to prevent data loss, create a new pmm-data container, and finally copy the
backed up information into the pmm-data container.
Run the following commands as root or by using the sudo command
1. Stop the running pmm-server container.
$ docker create \
-v /opt/prometheus/data \
-v /opt/consul-data \
-v /var/lib/mysql \
-v /var/lib/grafana \
--name pmm-data \
percona/pmm-server:latest /bin/true
Important: The last step creates a new pmm-data container based on the percona/pmm-server:latest
image. If you do not intend to use the latest tag, specify the exact version instead, such as 1.5.0. You can find all
available versions of pmm-server images at percona/pmm-server.
Assuming that you have a backup copy of your pmm-data, created according to the procedure described in
the:ref:pmm.server.docker.backing-up section, restore your data as follows:
1. Change the working directory to the directory that contains your pmm-data backup files.
$ cd ~/pmm-data-backup
Note: This example assumes that the backup directory is found in your home directory.
$ docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:latest
To make sure that the new server is available run the pmm-admin check-network command from the computer
where PMM Client is installed. Run this command as root or by using the sudo command.
$ pmm-admin check-network
See also:
Setting up PMM Server via Docker Setting Up a Docker Container for PMM Server
Updating PMM Updating PMM
Backing Up the PMM Server Docker container Backing Up PMM Data from the Docker Container
Percona provides a virtual appliance for running PMM Server in a virtual machine. It is distributed as an Open Virtual
Appliance (OVA) package, which is a tar archive with necessary files that follow the Open Virtualization Format
(OVF). OVF is supported by most popular virtualization platforms, including:
• VMware - ESXi 6.5
• Red Hat Virtualization
• VirtualBox
• XenServer
• Microsoft System Center Virtual Machine Manager
In this chapter
The virtual appliance is ideal for running PMM Server on an enterprise virtualization platform of your choice. This
page explains how to run the appliance in VirtualBox and VMware Workstation Player. which is a good choice to
experiment with PMM at a smaller scale on a local machine. Similar procedure should work for other platforms
(including enterprise deployments on VMware ESXi, for example), but additional steps may be required.
The virtual machine used for the appliance runs CentOS 7.
Warning: The appliance must run in a network with DHCP, which will automatically assign an IP address for it.
To assign a static IP manually, you need to acquire the root access as described in How to set the root password
when PMM Server is installed as a virtual appliance. Then, see the documentation for the operating system for
further instructions: Configuring network interfaces in CentOS
Instead of using the VirtualBox GUI, you can do everything on the command line. Use the VBoxManage command
to import, configure, and start the appliance.
The following script imports the PMM Server appliance from PMM-Server-1.6.0.ova and configures it to
bridge the en0 adapter from the host. Then the script routes console output from the appliance to /tmp/
pmm-server-console.log. This is done because the script then starts the appliance in headless (without the
console) mode.
To get the IP address for accessing PMM, the script waits for 1 minute until the appliance boots up and returns the
lines with the IP address from the log file.
# Import image
VBoxManage import pmm-server-|VERSION NUMBER|.ova
# Start instance
VBoxManage startvm --type headless 'PMM Server [VERSION NUMBER]'
sleep 60
grep cloud-init /tmp/pmm-server-console.log
In this script, [VERSION NUMBER] is the placeholder of the version of PMM Server that you are installing. By
convention OVA files start with pmm-server- followed by the full version number such as 1.17.0.
To use this script, make sure to replace this placeholder with the the name of the image that you have downloaded
from the Download Percona Monitoring and Management site. This script also assumes that you have changed the
working directory (using the cd command, for example) to the directory which contains the downloaded image file.
See also:
Using PMM Server as a virtual appliance PMM Server as a Virtual Appliance
Setting the root password How to set the root password when PMM Server is installed as a virtual appliance
The following procedure describes how to run the PMM Server appliance using the graphical user interface of Virtu-
alBox:
1. Download the OVA. The latest version is available at the Download Percona Monitoring and Management site.
2. Import the appliance. For this, open the File menu and click Import Appliance and specify the path to the OVA
and click Continue. Then, select Reinitialize the MAC address of all network cards and click Import.
3. Configure network settings to make the appliance accessible from other hosts in your network.
Note: All database hosts must be in the same network as PMM Server, so do not set the network adapter to
NAT.
If you are running the appliance on a host with properly configured network settings, select Bridged Adapter in
the Network section of the appliance settings.
4. Start the PMM Server appliance and set the root password (required on the first login).
If it was assigned an IP address on the network by DHCP, the URL for accessing PMM will be printed in the
console window.
See also:
Using PMM Server as a virtual appliance PMM Server as a Virtual Appliance
Setting the root password How to set the root password when PMM Server is installed as a virtual appliance
The following procedure describes how to run the PMM Server appliance using VMware Workstation Player:
1. Download the OVA. The latest version is available at the Download Percona Monitoring and Management site.
2. Import the appliance.
(a) Open the File menu and click Open.
Note: You may get an error indicating that import failed. Simply click Retry and import should succeed.
3. Configure network settings to make the appliance accessible from other hosts in your network.
If you are running the applianoce on a host with properly configured network settings, select Bridged in the
Network connection section of the appliance settings.
4. Start the PMM Server appliance and set the root password (required on the first login)
If it was assigned an IP address on the network by DHCP, the URL for accessing PMM will be printed in the
console window.
5. Set the root password as described in the section
See also:
Using PMM Server as a virtual appliance PMM Server as a Virtual Appliance
Setting the root password How to set the root password when PMM Server is installed as a virtual appliance
When run PMM Server as virtual appliance, The IP address of your PMM Server appears at the top of the screen above
the login prompt. Use this address to acces the web interface of PMM Server.
PMM Server uses DHCP for security reasons, and thus you need to check the PMM Server console in order to identify
the address. If you require configuration of a static IP address, see Configuring network interfaces in CentOS
To run the PMM Server, start the virtual machine and open in your browser the URL that appears at the top of the
terminal when you are logging in to the virtual machine.
Fig. 2.2: The URL to open in the browser appears at the top of the terminal when running the virtual machine.
If you run PMM Server in your browser for the first time, you are requested to supply the user and a new password.
Optionally, you may also provide your SSH public key.
Click Submit and enter your user name and password in the dialog window that pops up. The PMM Server is now
ready and the home page opens.
You are creating a username and password that will be used for two purposes:
1. authentication as a user to PMM - this will be the credentials you need in order to log in to PMM.
2. authentication between PMM Server and PMM Clients - you will re-use these credentials when configuring
pmm-client for the first time on a server, for example:
Run this command as root or by using the sudo command
To access the VM with the PMM Server appliance via SSH, provide your public key:
1. Open the URL for accessing PMM in a web browser.
The URL is provided either in the console window or in the appliance log.
2. Submit your public key in the PMM web interface.
After that you can use ssh to log in as the admin user. For example, if PMM Server is running at 192.168.100.1 and
your private key is ~/.ssh/pmm-admin.key, use the following command:
Fig. 2.3: Set the user and password to access the PMM Server web interface.
Next Steps
Verify that PMM Server is running by connecting to the PMM web interface using the IP address assigned to the virtual
appliance, then install PMM Client on all database hosts that you want to monitor.
You can run an instance of PMM Server hosted at AWS Marketplace. This method replaces the outdated method
where you would have to accessing an AMI (Amazon Machine Image) by using its ID, different for each region.
Assuming that you have an AWS (Amazon Web Services) account, locate Percona Monitoring and Management
Server in AWS Marketplace.
The Pricing Information section allows to select your region and choose an instance type in the table that shows the
pricing for the software and infrastructure hosted in the region you have selected (the recommended EC2 instance type
is preselected for you). Note that actual choice will be done later, and this table serves the information purposes, to
plan costs.
Note: Disk space consumed by PMM Server depends on the number of hosts under monitoring. Each environment
Fig. 2.6: As soon as you select your region, you can choose the EC2 instance in it and see its price. PMM comes for
no cost, you may only need to pay for the infrastructure provided by Amazon.
will be unique, however consider modeling your data consumption based on PMM Demo <https://pmmdemo.percona.
com/>‘_ web site, which consumes ~230MB/host/day, or ~6.9GB/host
at the default 30 day retention period. See this blog post for more details.
Clicking the Continue to Subscribe button will proceed to the terms and conditions page. Clicking Continue to Con-
figuration there will bring a new page to start setting up your instance.
Fig. 2.7: Percona Monitoring and Management on AWS Marketplace - launch options.
Available launch options in the drop-down menu include Launch from Website and Launch through EC2. The first one
is a quick way to make your instance ready. For more control, use the Manual Launch through EC2 option.
In this chapter
Choose Launch from Website option, your region, and the EC2 instance type on the launch options page. On the
previous screenshot, we use the US East (N. Virginia) region and the EC2 Instance Type named m4.large.
To reduce cost, you need to choose the region closest to your location.
When all choices are done, click the Continue to Launch button to proceed.
Instead of a VPC (virtual private cloud) you may choose the EC2 Classic (no VPC) option and use a public
cloud.
Selecting a subnet, you effectively choose an availability zone in the selected region. We recommend that you choose
the availability zone where your RDS is located.
Note that the cost estimation is automatically updated based on your choice.
See also:
AWS Documentation: Availability zones https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
using-regions-availability-zones.html
In the Security Group section, which acts like a firewall, you may use the preselected option Create new based
on seller settings to create a security group with recommended settings. In the Key Pair select an already set
up EC2 key pair to limit access to your instance.
Fig. 2.9: Select an already existing key pair (use the EC2 console to create one if necessary)
Important: It is important that the security group allow communication via the following ports: 22, 80, and 443.
PMM should also be able to access port 3306 on the RDS that uses the instance.
See also:
Amazon Documentation: Security groups https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
using-network-security.html
Amazon Documentation: Key pairs https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html
Amazon Documentation: Importing your own public key to Amazon EC2 https://docs.aws.amazon.com/
AWSEC2/latest/UserGuide/ec2-key-pairs.html#how-to-generate-your-own-key-and-import-it-to-aws
Applying settings
Scroll up to the top of the page to view your settings. Then, click the Launch with 1 click button to continue and adjust
your settings in the EC2 console.
Note: The Launch with 1 click button may alternatively be titled as Accept Software Terms & Launch with 1-Click.
Your clicking the Launch with 1 click button, deploys your instance. To continue setting up your instance, run the EC2
console. It is available as a link at the top of the page that opens after you click the Launch with 1 click button.
Fig. 2.11: Your instance settings are summarized in a special area. Click the Launch with 1 click button to continue.
Your instance appears in the EC2 console in a table that lists all instances available to you. When a new instance
is only created, it has no name. Make sure that you give it a name to distinguish from other instances managed via the
EC2 console.
After you add your new instance it will take some time to initialize it. When the AWS console reports that the instance
is now in a running state, you many continue with configuration of PMM Server.
Note: When started the next time after rebooting, your instance may acquire another IP address. You may choose to
set up an elastic IP to avoid this problem.
See also:
Amazon Documentation: Elastic IP Addresses http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/
elastic-ip-addresses-eip.html
With your instance selected, open its IP address in a web browser. The IP address appears in the IPv4 Public IP
column or as value of the Public IP field at the top of the Properties panel.
To run the instance, copy and paste its public IP address to the location bar of your browser. In the Percona Monitoring
and Management welcome page that opens, enter the instance ID.
You can copy the instance ID from the Properties panel of your instance, select the Description tab back in the EC2
console. Click the Copy button next to the Instance ID field. This button appears as soon as you hover the cursor of
your mouse over the ID.
Fig. 2.15: Hover the cursor over the instance ID for the Copy button to appear.
Paste the instance in the Instance ID field of the Percona Monitoring and Management welcome page and click Submit.
Click Submit and enter your user name and password in the dialog window that pops up. The PMM Server is now
ready and the home page opens.
Click Submit and enter your user name and password in the dialog window that pops up. The PMM Server is now
ready and the home page opens.
You are creating a username and password that will be used for two purposes:
1. authentication as a user to PMM - this will be the credentials you need in order to log in to PMM.
2. authentication between PMM Server and PMM Clients - you will re-use these credentials when configuring
pmm-client for the first time on a server, for example:
Run this command as root or by using the sudo command
See also:
How to verify that the PMM Server is running properly? Verifying PMM Server
How to connect a PMM Client to the PMM Server? Connecting PMM Clients to the PMM Server
Your instance comes with a predefined size which can become a limitation. To make more disk space available to your
instance, you need to increase the size of the EBS volume as needed and then your instance will reconfigure itself to
use the new size.
The procedure of resizing EBS volumes is described in the Amazon documentation: Modifying the Size, IOPS, or
Type of an EBS Volume on Linux.
After the EBS volume is updated, PMM Server instance will autodetect changes in approximately 5 minutes or less
and will reconfigure itself for the updated conditions.
Percona provides public Amazon Machine Images (AMI) with PMM Server in all regions where Amazon Web Ser-
vices (AWS) is available. You can launch an instance using the web console for the corresponding image:
Region String AMI ID
Asia Pacific (Tokyo) ap-northeast-1 ami-081b63c019880c9d6
Asia Pacific (Seoul) ap-northeast-2 ami-0299fd006902387fb
Asia Pacific (Mumbai) ap-south-1 ami-0ae6d88793bfd1c25
Asia Pacific (Singapore) ap-southeast-1 ami-0b75d0daff534821b
Asia Pacific (Sydney) ap-southeast-2 ami-066240e0e538a2d5b
Canada (Central) ca-central-1 ami-043636fe79bd57dcf
EU (Frankfurt) eu-central-1 ami-0f11e38faf1e13b95
EU (Ireland) eu-west-1 ami-01144c4acc8b6e1f2
EU (London) eu-west-2 ami-0f83e56754f334842
EU (Paris) eu-west-3 ami-0c969dd2dc2bd59da
South America (São Paulo) sa-east-1 ami-0e4a9988906825cdf
US East (N. Virginia) us-east-1 ami-0c0b294064bea85d0
US East (Ohio) us-east-2 ami-0125f42891b1de6e0
US West (N. California) us-west-1 ami-0284d9d12f7fe0959
US West (Oregon) us-west-2 ami-036f591241f108627
1. Launch the PMM Server instance using the run-instances command for the corresponding region and
image. For example:
aws ec2 run-instances \
--image-id ami-30ad0f4d \
--security-group-ids sg-3b6e5e46 \
--instance-type t2.micro \
--subnet-id subnet-4765a930 \
--region us-east-1 \
--key-name SSH-KEYNAME
Note: Providing the public SSH key is optional. Specify it if you want SSH access to PMM Server.
2. Set a name for the instance using the create-tags command. For example:
aws ec2 create-tags \
--resources i-XXXX-INSTANCE-ID-XXXX \
--region us-east-1 \
--tags Key=Name,Value=OWNER_NAME-pmm
3. Get the IP address for accessing PMM Server from console output using the get-console-output com-
mand. For example:
Important: On each computer where PMM Client is installed, the following ports must be open. These are default
ports that you can change when adding the respective monitoring service with the pmm-admin add command.
See also:
Improving security Security Features in Percona Monitoring and Management
In your browser, go to the server by its IP address. If you run your server as a virtual appliance or by using an Amazon
machine image, you will need to setup the user name, password and your public key if you intend to connect to the
server by using ssh. This step is not needed if you run PMM Server using Docker.
In the given example, you would need to direct your browser to http://192.168.100.1. Since you have not added any
monitoring services yet, the site will not show any data.
Accessing the Components of the Web Interface
Component URL
PMM Home Page http://192.168.100.1
Metrics Monitor (MM)
http://192.168.100.1/graph/
User name: admin
Password: admin
Orchestrator http://192.168.100.1/orchestrator
You can also check if PMM Server is available requesting the /ping URL as in the following example:
$ curl http://192.168.100.1/ping
{'version': '1.8.0'}
Installing Clients
PMM Client is a package of agents and exporters installed on a database host that you want to monitor. Before
installing the PMM Client package on each database host that you intend to monitor, make sure that your PMM Server
host is accessible.
For example, you can run the ping command passing the IP address of the computer that PMM Server is running on.
For example:
$ ping 192.168.100.1
You will need to have root access on the database host where you will be installing PMM Client (either logged in as a
user with root privileges or be able to run commands with sudo).
Supported platforms
PMM Client should run on any modern Linux 64-bit distribution, however Percona provides PMM Client packages
for automatic installation from software repositories only on the most popular Linux distributions:
• DEB packages for Debian based distributions such as Ubuntu
• RPM packages for Red Hat based distributions such as CentOS
It is recommended that you install your PMM client by using the software repository for your system. If this option
does not work for you, Percona provides downloadable PMM Client packages from the Download Percona Monitoring
and Management page.
In addition to DEB and RPM packages, this site also offers:
• Generic tarballs that you can extract and run the included install script.
• Source code tarball to build your PMM client from source.
Warning: You should not install agents on database servers that have the same host name, because host names
are used by PMM Server to identify collected data.
Storage requirements
Minimum 100 MB of storage is required for installing the PMM Client package. With a good constant connection to
PMM Server, additional storage is not required. However, the client needs to store any collected data that it is not able
to send over immediately, so additional storage may be required if connection is unstable or throughput is too low.
With your server and clients set up, you must configure each PMM Client and specify which PMM Server it should
send its data to.
To connect a PMM Client, enter the IP address of the PMM Server as the value of the --server parameter to the
pmm-admin config command.
Run this command as root or by using the sudo command
For example, if your PMM Server is running on 192.168.100.1, and you have installed PMM Client on a machine with
IP 192.168.200.1, run the following in the terminal of your client. Run the following commands as root or by using
the sudo command:
If you change the default port 80 when running PMM Server, specify the new port number after the IP address of
PMM Server. For example:
Important: On each computer where PMM Client is installed, the following ports must be open. These are default
ports that you can change when adding the respective monitoring service with the pmm-admin add command.
See also:
Improving security Security Features in Percona Monitoring and Management
See also:
What other options can I pass to pmm-admin config? Run pmm-admin config --help
To start collecting data on each PMM Client connected to a PMM server, run the pmm-admin add command along
with the name of the selected monitoring service.
Run the following commands as root or by using the sudo command.
Enable general system metrics, MySQL metrics, MySQL query analytics:
Enable general system metrics, MongoDB metrics, and MongoDB query analytics:
To see what is being monitored, run pmm-admin list. For example, if you enable general OS and MongoDB
metrics monitoring, the output should be similar to the following:
$ pmm-admin list
...
See also:
What other monitoring services can I add using the pmm-admin add command? Run pmm-admin add
--help in your terminal
PMM Server is able to generate a set of files for enhanced diagnostics, which can be examined and/or shared with
Percona Support to solve an issue faster.
Collected data are provided by the logs.zip service, and cover the following subjects:
• Prometheus targets
• Consul nodes, QAN API instances
• Amazon RDS and Aurora instances
• Version
• Server configuration
• Percona Toolkit commands
You can retrieve collected data from your PMM Server in a single zip archive using this URL:
https://<address-of-your-pmm-server>/managed/logs.zip
Updating
When changing to a new version of PMM, you update the PMM Server and each PMM Client separately.
The updating procedure of your PMM Server depends on the option that you selected for installing it.
If you are running PMM Server as a virtual appliance or using an Amazon Machine Image, use the Check for Updates
Manually button on the Home dashboard (see PMM Home Page).
See also:
How to update PMM Server installed using Docker? Updating PMM Server Using Docker
When a newer version of PMM Client becomes available, you can update to it from the Percona software repositories:
Debian or Ubuntu
If you installed your PMM client manually, remove it and then download and install a newer version.
2.6. Updating 37
Percona Monitoring and Management Documentation, Release 1.17.0
Each PMM Client and the PMM Server are removed separately. First, remove all monitored services by using the
pmm-admin remove command (see Removing monitoring services). Then you can remove each PMM Client and
the PMM Server.
Remove all monitored instances as described in Removing monitoring services. Then, uninstall the pmm-admin
package. The exact procedure of removing the PMM Client depends on the method of installation.
Run the following commands as root or by using the sudo command
Using YUM
Using APT
$ rpm -e pmm-client
$ dpkg -r pmm-client
Using the generic PMM Client tarball. cd into the directory where you extracted the tarball contents. Then, run the
unistall script:
$ ./uninstall
If you run your PMM Server using Docker, stop the container as follows:
To discard all collected data (if you do not plan to use PMM Server in the future), remove the pmm-data container:
$ docker rm pmm-data
If you run your PMM Server using a virtual appliance, just stop and remove it.
To terminate the PMM Server running from an Amazon machine image, run the following command in your terminal:
See also:
PMM Building Blocks Overview of Percona Monitoring and Management Architecture
About using the pmm-admin add command Adding monitoring services
THREE
TOOLS OF PMM
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.
See also:
Installing PMM Server Installing PMM Server
The PMM home page that opens provides an overview of the environment that you have set up to monitor by using
the pmm-admin tool.
From the PMM home page, you can access specific monitoring tools, or dashboards. Each dashboard features a
collection of metrics. These are graphs of a certain type that represent one specific aspect showing how metric values
change over time.
By default the PMM home page lists most recently used dashboards and helpful links to the information that may be
useful to understand PMM better.
The PMM home page lists all hosts that you have set up for monitoring as well as the essential details about their
performance such as CPU load, disk performance, or network activity.
39
Percona Monitoring and Management Documentation, Release 1.17.0
The QAN is a special dashboard which enables database administrators and application developers to analyze database
queries over periods of time and find performance problems. QAN 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.
Fig. 3.2: QAN helps analyze database queries over periods of time and find performance problems.
Important: PMM Query Analytics supports MySQL and MongoDB. The minimum requirements for MySQL are:
• MySQL 5.1 or later (if using the slow query log)
• MySQL 5.6.9 or later (if using Performance Schema)
QAN displays its metrics in both visual and numeric form: the performance related characteristics appear as plotted
graphics with summaries. .. rubric:: In this section
– Query Section
– Explain Section
– Table Info Section
• Configuring QAN
– Settings Tab
– Status Tab
– Log Tab
• QAN for MongoDB
See also:
A historical view of metrics that are critical to a database server Metrics Monitor
Overview of PMM Components Tools of PMM
To start working with QAN, open the list of dashboards on the PMM home page. Then, proceed to the Host field at
the top of the page and select a host where the PMM Client is installed from the list of database instances.
The QAN dashboard will show a summary of the selected host and database activity metrics followed by the list of
queries in a summary table. By default, QAN shows the top ten queries ranked by %GTT (Grand total time). Each
query displays three essential metrics: Load, Count, and Latency. Also queries which are newly seen within the the
time range selected are highlighted with a blue color for quicker identification.
Also it worth to mention that QAN data come in with typical 1-2 min delay, though it is possible to be delayed more
because of specific network condition and state of the monitored object. In such situations QAN reports “no data”
situation, using sparkline to and showing a gap in place of the time interval, for which data are not available yet.
Fig. 3.3: Showing intervals for which data are unavailable yet.
To view more queries, click the Load next 10 queries button below the query summary table.
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).
Fig. 3.4: The query summary table shows the monitored queries from the selected database.
When you apply a 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.
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 the QAN page.
The tool consists of two parts. The Quick ranges offers frequently used time ranges.. The date picker sets a range of
dates.
The first line of the query summary 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.
The load is the amount of time that the database server spent during the selected time or date range running all queries.
Fig. 3.6: QAN displays query metrics for the time period or date range that you specify.
Fig. 3.7: The totals appear at the top of the query summary table.
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.
Each row in the query summary 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.
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.
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.
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.
Fig. 3.9: Select a query from the query summary table to open its metrics.
Fig. 3.10: 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).
The output appears in three forms: classic, JSON and visual. 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. To help
you better understand how the query has been optimized, the visual form shows how the query accesses the tables it
includes. The output of the visual form is identical to that of pt-visual-explain.
Note: The Copy to clipboard button available in Explain, Fingerprint, Example, and Tables sections is useful to save
the output and pass it to external tools, such as pt-visual-explain.
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.
Related information
pt-visual-explain: a tool to show the query plan based on the output of the EXPLAIN command
https://www.percona.com/doc/percona-toolkit/LATEST/pt-visual-explain.html
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.
Configuring QAN
All PMM Query Analytics settings are available from the Query Analytics Settings dashboard. To open this dashboard,
use the PMM menu group.
Fig. 3.12: The PMM group in the Metrics Monitor navigation menu
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.
Fig. 3.13: The Settings tab to view the essential settings of the selected database server.
When you choose to collect MySQL data from slow log, a group of read only values becomes available. Note that
these settings cannot be set in PMM directly. These are essential parameters of MySQL that affect the operation of
slow log. If you need to change these settings refer to the appropriate sections of MySQL documentation.
See also:
Percona Server Documentation: Slow Query Log Rotation and Expiration
MySQL Documentation: The Slow Query Log
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.
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.
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.
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.
See also:
What MongoDB versions are supported by QAN? See more information about how to configure MongoDB
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.
In this section
• Signing in
• Opening a Dashboard
• Viewing More Information about a Graph
• Zooming in on a single metric
• Marking Important Events with Annotations
Fig. 3.15: Analyze MongoDB queries using the same tools as relational database management systems.
See also:
How to analyze database queries over periods of time and find performance problems PMM Query Analytics
Signing in
The credentials used to sign in to Grafana depend on the options that you specified when starting PMM Server:
• If you do not specify either SERVER_USER or SERVER_PASSWORD, you will log in as an anonymous user.
You can change to a different existing Grafana user.
• If you specify both --SERVER_USER and --SERVER_PASSWORD, then these credentials will be used to sign
in to Grafana.
• If you specify 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 specify only --SERVER_USER, this parameter will be ignored.
Warning: The value of the --SERVER_USER parameter may not contain the # or : symbols.
• 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:
Opening a Dashboard
The default PMM installation provides more than thirty dashboards. To make it easier to reach a specific dashboard, the
system offers two tools. The Dashboard Dropdown is a button in the header of any PMM page. It lists all dashboards,
organized into folders. Right sub-panel allows to rearrange things, creating new folders and dragging dashboards into
them. Also a text box on the top allows to search the required dashboard by typing.
Fig. 3.16: With Dashboard Dropdown, search the alphabetical list for any dashboard.
You can also use a navigation menu which groups dashboards by application. Click the required group and then select
See also:
Percona support for high availability https://www.percona.com/services/support/mysql-ha-cluster-support
List of Metrics Monitor dashboards See section Metrics Monitor Dashboards
Each graph has a 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.
On dashboards with multiple metrics, it is hard to see how the value of a single metric changes over time. Use the
context menu to zoom in on the selected metric so that it temporarily occupies the whole dashboard space.
Click the title of the metric that you are interested in and select the View option from the context menu that opens.
The selected metric opens to occupy the whole dashboard space. You may now set another time range using the time
and date range selector at the top of the Metrics Monitor page and analyze the metric data further.
Fig. 3.18: Graph descriptions provide more information about a graph without claiming any space in the interface.
Note: If you are zooming in on a metric which is represented as a single number on its dashboard, you cannot change
the level of detail by selecting a range on the graph itself.
To return to the dashboard, click the Back to dashboard button next to the time range selector.
Fig. 3.20: The Back to dashboard button returns to the dashboard; this button appears when you are zooming in on
one metric.
See also:
More information about the time range selector Selecting time or date range
Some events in your application may impact your database. Annotations visualize these events on each dashboard of
PMM Server.
Fig. 3.21: An annotation appears as a vertical line which crosses a graph at a specific point. Its text explains which
event occurred at that time.
To create a new annotation, run pmm-admin annotate command on PMM Client passing it text which explains
what event the new annotation should represent. Use the --tags option to supply one or more tags separated by a
comma.
You may toggle displaying annotations on metric graphs by using the PMM Annotations checkbox.
See also:
Adding annotations Adding annotations
Grafana Documentation:
Fig. 3.22: Remove the checkmark from the PMM Annotations checkbox to hide annotations from all dashboards.
• Annotations
• Using annotations in queries
A snapshot is a way to securely share your dashboard with Percona. When created, we strip sensitive data like queries
(metrics, template variables, and annotations) along with panel links. The shared dashboard will only be available for
viewing by Percona engineers. The content on the dashboard will assist Percona engineers in troubleshooting your
case.
You can safely leave the defaults set as they are, but for further information:
Snapshot name The name Percona will see when viewing your dashboard.
Expire How long before snapshot should expire, configure lower if required. Percona automatically purges shared
dashboards after 90 days.
Timeout (seconds) Duration the dashboard will take to load before the snapshot is generated.
First, open the dashboard that you would like to share. Click the Share button at the top of the page and select the
Snapshot command. Finally, click the Share with Percona button.
What to do next
After clicking Share with Percona, wait for the dashboard to be generated, and you will be provided a unique URL
that then needs to be communicated to Percona via the ticket.
Advanced
59
CHAPTER
FOUR
61
Percona Monitoring and Management Documentation, Release 1.17.0
USAGE
Note: The pmm-admin tool requires root access (you should either be logged in as a user with root privileges or be
able to run commands with sudo).
To view all available commands and options, run pmm-admin without any commands or options:
$ sudo pmm-admin
OPTIONS
COMMANDS
pmm-admin show-passwords Print passwords used by PMM Client (stored in the configuration file).
pmm-admin start Start monitoring service.
pmm-admin stop Stop monitoring service.
pmm-admin uninstall Clean up PMM Client before uninstalling it.
USAGE
When you add a monitoring service pmm-admin automatically creates and sets up a service in the operating system.
You can tweak the systemd configuration file and change its behavior.
For example, you may need to disable the HTTPS protocol for the Prometheus exporter associated with the given
service. To accomplish this task, you need to remove all SSL related options.
Run the following commands as root or by using the sudo command:
1. Open the systemd unit file associated with the monitoring service that you need to change, such as
pmm-mysql-metrics-42002.service.
$ cd /etc/systemd/system
$ cat pmm-mysql-metrics-42002.service
2. Remove the SSL related configuration options (key, cert) from the systemd unit file or init.d startup script.
sample.systemd highlights the SSL related options in the systemd unit file.
The following code demonstrates how you can remove the options using the sed command. (If you need more
information about how sed works, see the documentation of your system).
3. Reload systemd:
$ systemctl daemon-reload
OPTIONS
The following option can be used with the pmm-admin add command:
--dev-enable Enable experimental features.
--disable-ssl Disable (otherwise enabled) SSL for the connection between PMM Client and PMM Server.
Turning off SSL encryption for the data acquired from some objects of monitoring allows to decrease the over-
head for a PMM Server connected with a lot of nodes.
--service-port
Specify the service port.
You can also use global options that apply to any other command.
SERVICES
Specify a monitoring service alias, along with any relevant additional arguments.
For more information, run pmm-admin add --help.
The pmm-admin add command is also used to add external monitoring services. This command adds an external
monitoring service assuming that the underlying Prometheus exporter is already set up and accessible. The default
scrape timeout is 10 seconds, and the interval equals to 1 minute.
To add an external monitoring service use the external:service monitoring service followed by the port number,
name of a Prometheus job. These options are required. To specify the port number the --service-port option.
pmm-admin 1.12.0
...
Job name Scrape interval Scrape timeout Metrics path Scheme Target
˓→Labels Health
postgresql 10s 1m /metrics http 172.17.0.1:9187
˓→instance="percona"
By default, the pmm-admin add command automatically creates the name of the host to be displayed in the Host
field of the Advanced Data Exploration dashboard where the metrics of the newly added external monitoring service
will be displayed. This name matches the name of the host where pmm-admin is installed. You may choose another
display name when adding the external:service monitoring service giving it explicitly after the Prometheus
exporter name.
You may also use the external:metrics monitoring service. When using this option, you refer to the exporter
by using a URL and a port number. The following example adds an external monitoring service which monitors a
PostgreSQL instance at 192.168.200.1, port 9187. After the command completes, the pmm-admin list command
shows the newly added external exporter at the bottom of the command’s output:
Run this command as root or by using the sudo command
See also:
View all added monitoring services See Listing monitoring services
Use the external monitoring service to add PostgreSQL running on an Amazon RDS instance See use-
case.external-monitoring-service.postgresql.rds
pmm-admin add sends all options which follow -- (two consecutive dashes delimited by whitespace) to the
Prometheus exporter that the given monitoring services uses. Each exporter has its own set of options.
Run the following commands as root or by using the sudo command.
SSL/TLS related parameters are passed to an SSL enabled MongoDB server as monitoring service parameters along
with the pmm-admin add command when adding the mongodb:metrics monitoring service.
Run this command as root or by using the sudo command
Note: PMM does not support passing SSL/TLS related parameters to mongodb:queries.
USAGE
This creates the pmm-linux-metrics-42000 service that collects local system metrics for this particular OS
instance.
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
This example will show you how to collect the number of running and stopped docker containers on a host. It uses a
crontab task, set with the following lines in the cron configuration file (e.g. in /etc/crontab):
˓→local/percona/pmm-client/docker_all.prom;
˓→' >>/usr/local/percona/pmm-client/docker_running.prom;
The result of the commands is placed into the docker_all.prom and docker_running.prom files and read
by exporter.
The first command executed by cron is rather simple: the destination text file is cleared by executing echo -n "",
then a list of running and closed containers is generated with docker ps -a, and finally sed and wc tools are used
to count the number of containers in this list and to form the output file which looks like follows:
node_docker_containers_total 2
USAGE
This creates the pmm-mysql-queries-0 service that is able to collect QAN data for multiple remote MySQL
server instances.
The pmm-admin add command is able to detect the local PMM Client name, but you can also specify it explicitly
as an argument.
Important: If you connect MySQL Server version 8.0, make sure it is started with the
default_authentication_plugin set to the value mysql_native_password.
You may alter your PMM user and pass the authentication plugin as a parameter:
See also:
MySQL Documentation: Authentication Plugins https://dev.mysql.com/doc/refman/8.0/en/
authentication-plugins.html
MySQL Documentation: Native Pluggable Authentication https://dev.mysql.com/doc/refman/8.0/en/
native-pluggable-authentication.html
OPTIONS
Related Information
Percona Database Performance Blog: Rotating MySQL Slow Logs Safely https://www.percona.
com/blog/2013/04/18/rotating-mysql-slow-logs-safely/
Percona Database Performance Blog: Log Rotate and the (Deleted) MySQL Log File Mystery
https://www.percona.com/blog/2014/11/12/log-rotate-and-the-deleted-mysql-log-file-mystery/
DETAILED DESCRIPTION
When adding the MySQL query analytics service, the pmm-admin tool will attempt to automatically detect the local
MySQL instance and MySQL superuser credentials. You can use options to provide this information, if it cannot be
detected automatically.
You can also specify the --create-user option to create a dedicated pmm user on the MySQL instance that you
want to monitor. This user will be given all the necessary privileges for monitoring, and is recommended over using
the MySQL superuser.
See also:
More information about MySQL users with PMM Creating a MySQL User Account to Be Used with PMM
For example, to set up remote monitoring of QAN data on a MySQL server located at 192.168.200.2, use a command
similar to the following:
QAN can use either the slow query log or Performance Schema as the source. By default, it chooses the slow query
log for a local MySQL instance and Performance Schema otherwise. For more information about the differences, see
Configuring Performance Schema.
You can explicitely set the query source when adding a QAN instance using the --query-source option.
For more information, run pmm-admin add mysql:queries --help.
See also:
How to set up MySQL for monitoring? Configuring MySQL for Best Results
USAGE
This creates the pmm-mysql-metrics-42002 service that collects MySQL instance metrics.
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
DETAILED DESCRIPTION
When adding the MySQL metrics monitoring service, the pmm-admin tool attempts to automatically detect the local
MySQL instance and MySQL superuser credentials. You can use options to provide this information, if it cannot be
detected automatically.
You can also specify the --create-user option to create a dedicated pmm user on the MySQL host that you want
to monitor. This user will be given all the necessary privileges for monitoring, and is recommended over using the
MySQL superuser.
For example, to set up remote monitoring of MySQL metrics on a server located at 192.168.200.3, use a command
similar to the following:
USAGE
This creates the pmm-mongodb-queries-0 service that is able to collect QAN data for multiple remote MongoDB
server instances.
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
[mongodb://][user:pass@]host[:port][/database][?options]
By default, it is localhost:27017.
Important: In cases when the password contains special symbols like the at (@) symbol, the host might not
not be detected correctly. Make sure that you insert the password with special characters replaced with their
escape sequences. The simplest way is to use the encodeURIComponent JavaScript function.
For this, open the web console of your browser (usually found under Development tools) and evaluate the
following expression, passing the password that you intend to use:
> encodeURIComponent('$ecRet_pas$w@rd')
"%24ecRet_pas%24w%40rd"
Related Information
MDN Web Docs: encodeURIComponent https://developer.mozilla.org/en-US/docs/Web/JavaScript/
Reference/Global_Objects/encodeURIComponent
You can also use global options that apply to any other command, as well as options that apply to adding services in
general.
Note: PMM does not support passing SSL/TLS related parameters to mongodb:queries.
USAGE
This creates the pmm-mongodb-metrics-42003 service that collects local MongoDB metrics for this particular
MongoDB instance.
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
[mongodb://][user:pass@]host[:port][/database][?options]
By default, it is localhost:27017.
You can also use global options that apply to any other command, as well as options that apply to adding services in
general.
For more information, run pmm-admin add mongodb:metrics --help.
Monitoring a cluster
When using PMM to monitor a cluster, you should enable monitoring for each instance by using the pmm-admin
add command. This includes each member of replica sets in shards, mongos, and all configuration servers. Make sure
that for each instance you supply the cluster name via the --cluster option and provide its URI via the --uri
option.
Run this command as root or by using the sudo command. This examples uses 127.0.0.1 as a URL.
See also:
Default ports Ports in Terminology Reference
Essential MongoDB configuration Configuring MongoDB for Monitoring in PMM Query Analytics
USAGE
This creates the pmm-proxysql-metrics-42004 service that collects local ProxySQL performance metrics.
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
Adding annotations
Use the pmm-admin annotate command to set notifications about important application events and display them
on all dashboards. By using annotations, you can conveniently analyze the impact of application events on your
database.
USAGE
OPTIONS
Use the pmm-admin check-network command to run tests that verify connectivity between PMM Client and
PMM Server.
USAGE
OPTIONS
The pmm-admin check-network command does not have its own options, but you can use global options that
apply to any other command
DETAILED DESCRIPTION
Connection tests are performed both ways, with results separated accordingly:
• Client --> Server
Pings Consul API, PMM Query Analytics API, and Prometheus API to make sure they are alive and reachable.
Performs a connection performance test to see the latency from PMM Client to PMM Server.
• Client <-- Server
Checks the status of Prometheus endpoints and makes sure it can scrape metrics from corresponding exporters.
Successful pings of PMM Server from PMM Client do not mean that Prometheus is able to scrape from ex-
porters. If the output shows some endpoints in problem state, make sure that the corresponding service is
running (see pmm-admin list). If the services that correspond to problematic endpoints are running, make
sure that firewall settings on the PMM Client host allow incoming connections for corresponding ports.
OUTPUT EXAMPLE
$ pmm-admin check-network
PMM Network Status
* System Time
NTP Server (0.pool.ntp.org) | 2017-05-03 12:05:38 -0400 EDT
PMM Server | 2017-05-03 16:05:38 +0000 GMT
PMM Client | 2017-05-03 12:05:38 -0400 EDT
PMM Server Time Drift | OK
PMM Client Time Drift | OK
PMM Client to PMM Server Time Drift | OK
PMM Client is able to generate a set of files for enhanced diagnostics, which is designed to be shared with Percona
Support to solve an issue faster. This feature fetches logs, network, and the Percona Toolkit output. To perform data
collection by PMM Client, execute:
pmm-admin summary
The output will be a tarball you can examine and/or attach to your Support ticket in the Percona’s issue tracking
system. The single file will look like this:
summary__2018_10_10_16_20_00.tar.gz
Use the pmm-admin config command to configure how PMM Client communicates with PMM Server.
USAGE
OPTIONS
The following options can be used with the pmm-admin config command:
--bind-address Specify the bind address, which is also the local (private) address mapped from client address
via NAT or port forwarding By default, it is set to the client address.
--client-address Specify the client address, which is also the remote (public) address for this system. By
default, it is automatically detected via request to server.
--client-name Specify the client name. By default, it is set to the host name.
--force Force to set the client name on initial setup after uninstall with unreachable server.
--server Specify the address of the PMM Server host. If necessary, you can also specify the port after colon, for
example:
By default, port 80 is used with SSL disabled, and port 443 when SSL is enabled.
--server-insecure-ssl Enable insecure SSL (self-signed certificate).
--SERVER_PASSWORD Specify the HTTP password configured on PMM Server.
--server-ssl Enable SSL encryption for connection to PMM Server.
--SERVER_USER Specify the HTTP user configured on PMM Server (default is pmm).
You can also use global options that apply to any other command.
For more information, run pmm-admin config –help.
Use the pmm-admin help command to print help for any command.
USAGE
This will print help information and exit. The actual command is not run and options are ignored.
Note: You can also use the global -h or --help option after any command to get the same help information.
COMMANDS
You can print help information for any command or service alias.
Use the pmm-admin info command to print basic information about PMM Client.
USAGE
OPTIONS
The pmm-admin info command does not have its own options, but you can use global options that apply to any
other command
OUTPUT
$ pmm-admin info
Go Version | 1.8
Runtime Info | linux/amd64
Use the pmm-admin list command to list all enabled services with details.
USAGE
OPTIONS
The pmm-admin list command supports global options that apply to any other command and also provides a
machine friendly JSON output.
--json list the enabled services as a JSON document. The information provided in the standard tabular form is
captured as keys and values. The general information about the computer where PMM Client is installed is
given as top level elements:
• Version
• ServerAddress
• ServerSecurity
• ClientName
• ClientAddress
• ClientBindAddress
• Platform
Note that you can quickly determine if there are any errors by inspecting the Err top level element in the JSON
output. Similarly, the ExternalErr element reports errors in external services.
The Services top level element contains a list of documents which represent enabled monitoring services.
Each attribute in a document maps to the column in the tabular output.
The ExternalServices element contains a list of documents which represent enabled external monitoring
services. Each attribute in a document maps to the column in the tabular output.
OUTPUT
...
Use the pmm-admin ping command to verify connectivity with PMM Server.
USAGE
$ pmm-admin ping
OK, PMM server is alive.
OPTIONS
The pmm-admin ping command does not have its own options, but you can use global options that apply to any
other command.
For more information, run pmm-admin ping --help.
Use the pmm-admin purge command to purge metrics data associated with a service on PMM Server. This is
usually required after you remove a service and do not want its metrics data to show up on graphs.
USAGE
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
SERVICES
Specify a monitoring service alias. To see which services are enabled, run pmm-admin list.
OPTIONS
The pmm-admin purge command does not have its own options, but you can use global options that apply to any
other command
For more infomation, run pmm-admin purge --help.
USAGE
When you remove a service, collected data remains in Metrics Monitor on PMM Server. To remove the collected data,
use the pmm-admin purge command.
OPTIONS
SERVICES
Specify a monitoring service alias. To see which services are enabled, run pmm-admin list.
EXAMPLES
$ pmm-admin rm --all
$ pmm-admin rm mysql
$ pmm-admin rm mongodb:metrics
Use the pmm-admin repair command to remove information about orphaned services from PMM Server. This
can happen if you removed services locally while PMM Server was not available (disconnected or shut down), for
example, using the pmm-admin uninstall command.
USAGE
OPTIONS
The pmm-admin repair command does not have its own options, but you can use global options that apply to any
other command.
For more information, run pmm-admin repair –help.
Use the pmm-admin restart command to restart services managed by this PMM Client. This is the same as
running pmm-admin stop and pmm-admin start.
USAGE
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
The following option can be used with the pmm-admin restart command:
--all Restart all monitoring services.
You can also use global options that apply to any other command.
SERVICES
Specify a monitoring service alias that you want to restart. To see which services are available, run pmm-admin
list.
EXAMPLES
Use the pmm-admin show-passwords command to print credentials stored in the configuration file (by default:
/usr/local/percona/pmm-client/pmm.yml).
USAGE
OPTIONS
The pmm-admin show-passwords command does not have its own options, but you can use global options that
apply to any other command
OUTPUT
This command prints HTTP authentication credentials and the password for the pmm user that is created on the MySQL
instance if you specify the --create-user option when adding a service.
Run this command as root or by using the sudo command
$ pmm-admin show-passwords
HTTP basic authentication
User | aname
Password | secr3tPASS
Use the pmm-admin start command to start services managed by this PMM Client.
USAGE
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
The following option can be used with the pmm-admin start command:
--all Start all monitoring services.
You can also use global options that apply to any other command.
SERVICES
Specify a monitoring service alias that you want to start. To see which services are available, run pmm-admin list.
EXAMPLES
Use the pmm-admin stop command to stop services managed by this PMM Client.
USAGE
Note: It should be able to detect the local PMM Client name, but you can also specify it explicitly as an argument.
OPTIONS
The following option can be used with the pmm-admin stop command:
--all Stop all monitoring services.
You can also use global options that apply to any other command.
SERVICES
Specify a monitoring service alias that you want to stop. To see which services are available, run pmm-admin list.
EXAMPLES
Use the pmm-admin uninstall command to remove all services even if PMM Server is not available. To uninstall
PMM correctly, you first need to remove all services, then uninstall PMM Client, and then stop and remove PMM
Server. However, if PMM Server is not available (disconnected or shut down), pmm-admin rm will not work. In
this case, you can use pmm-admin uninstall to force the removal of monitoring services enabled for PMM
Client.
Note: Information about services will remain in PMM Server, and it will not let you add those services again. To
remove information about orphaned services from PMM Server, once it is back up and available to PMM Client, use
the pmm-admin repair command.
USAGE
OPTIONS
The pmm-admin uninstall command does not have its own options, but you can use global options that apply
to any other command.
For more information, run pmm-admin uninstall --help.
The following aliases are used to designate PMM services that you want to add, remove, restart, start, or stop:
Alias Services
linux:metrics General system metrics monitoring service
mysql:metrics MySQL metrics monitoring service
mysql:queries MySQL query analytics service
mongodb:metrics MongoDB metrics monitoring service
mongodb:queries MongoDB query analytics service
proxysql:metrics ProxySQL metrics monitoring service
mysql Complete MySQL instance monitoring:
• linux:metrics
• mysql:metrics
• mysql:queries
FIVE
There is a quick method for users to add DBaaS instances to PMM without having to hook into the Cloud Provider’s
API, and with no need to have PMM Client installed or any exporters running on the monitored node. The drawback
of this approach is that you will not have visibility of host-level metrics (CPU, memory, and disk activity will not be
captured nor displayed in PMM).
Both methods can be accessed in the Metrics Monitor navigation menu by selecting the PMM Add Instance item in a
PMM Dropdown group:
Two database servers are currently supported by this method: PostgreSQL and MySQL.
87
Percona Monitoring and Management Documentation, Release 1.17.0
To add a remote PostgreSQL DB instance, you will need to fill in three fields: Hostname, Username, and Password,
and optionally override the default Port and Name fields:
To add a remote MySQL DB instance, you will need to fill in three fields: Hostname, Username, and Password, and
optionally override the default Port and Name fields:
Amazon RDS and remote instances can be seen in the RDS and Remote Instances list, which can be accessed in the
Metrics Monitor navigation menu by selecting the PMM RDS and Remote Instances item from the PMM Dropdown
menu:
Remote ones have remote keyword as a Region:
SIX
Fig. 6.1: Enter the access key ID and the secret access key of your IAM user to view Amazon RDS DB instances.
1. Open the PMM web interface and select the PMM Add Instance dashboard.
2. Select the Add an AWS RDS MySQL or Aurora MySQL Instance option in the dashboard.
3. Enter the access key ID and the secret access key of your IAM user.
4. Click the Discover button for PMM to retrieve the available Amazon RDS instances.
91
Percona Monitoring and Management Documentation, Release 1.17.0
For each instance that you would like to monitor, select the Enabled button and enter the user name and password.
Click Connect. You can now monitor your instances in the Amazon RDS / Aurora MySQL Metrics.
Fig. 6.3: Enter the DB user name and password to connect to the selected RDS or Amazon Aurora instance.
See also:
AWS Documentation: Managing access keys of IAM users https://docs.aws.amazon.com/IAM/latest/UserGuide/
id_credentials_access-keys.html
It is possible to use PMM for monitoring Amazon RDS (just like any remote MySQL instance). In this case, the
PMM Client is not installed on the host where the database server is deployed. By using the PMM web interface, you
connect to the Amazon RDS DB instance. You only need to provide the IAM user access key (or assign an IAM role)
and PMM discovers the Amazon RDS DB instances available for monitoring.
First of all, ensure that there is the minimal latency between PMM Server and the Amazon RDS instance.
Network connectivity can become an issue for Prometheus to scrape metrics with 1 second resolution. We strongly
suggest that you run PMM Server on AWS (Amazon Web Services) in the same availability zone as Amazon RDS
instances.
It is crucial that enhanced monitoring be enabled for the Amazon RDS DB instances you intend to monitor.
Fig. 6.4: Set the Enable Enhanced Monitoring option in the settings of your Amazon RDS DB instance.
See also:
Amazon RDS Documentation:
• Modifying an Amazon RDS DB Instance
• More information about enhanced monitoring
• Setting Up
• Getting started
• Creating a MySQL DB Instance
• Availability zones
• What privileges are automatically granted to the master user of an Amazon RDS DB instance?
Which ports should be open? See Ports in glossary
It is recommended that you use an IAM user account to access Amazon RDS DB instances instead of using your AWS
account. This measure improves security as the permissions of an IAM user account can be limited so that this account
only grants access to your Amazon RDS DB instances. On the other hand, you use your AWS account to access all
AWS services.
The procedure for creating IAM user accounts is well described in the Amazon RDS documentation. This section only
goes through the essential steps and points out the steps required for using Amazon RDS with Percona Monitoring
and Management.
See also:
Amazon RDS Documentation: Creating an IAM user https://docs.aws.amazon.com/AmazonRDS/latest/
UserGuide/CHAP_SettingUp.html#CHAP_SettingUp.IAM
The first step is to define a policy which will hold all the necessary permissions. Then, you need to associate this
policy with the IAM user or group. In this section, we will create a new user for this purpose.
Creating a policy
A policy defines how AWS services can be accessed. Once defined it can be associated with an existing user or group.
To define a new policy use the IAM page at AWS.
1. Select the Policies option on the navigation panel and click the Create policy button.
2. On the Create policy page, select the JSON tab and replace the existing contents with the following JSON
document.
{ "Version": "2012-10-17",
"Statement": [{ "Sid": "Stmt1508404837000",
"Effect": "Allow",
"Action": [ "rds:DescribeDBInstances",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics"],
"Resource": ["*"] },
6.1. Essential AWS settings for monitoring Amazon RDS DB instances in PMM 93
Percona Monitoring and Management Documentation, Release 1.17.0
{ "Sid": "Stmt1508410723001",
"Effect": "Allow",
"Action": [ "logs:DescribeLogStreams",
"logs:GetLogEvents",
"logs:FilterLogEvents" ],
"Resource": [ "arn:aws:logs:*:*:log-
˓→group:RDSOSMetrics:*" ]}
]
}
3. Click Review policy and set a name to your policy, such as AmazonRDSforPMMPolicy. Then, click the Create
policy button.
See also:
AWS Documenation: Creating IAM policies https://docs.aws.amazon.com/IAM/latest/UserGuide/access_
policies_create.html
Policies are attached to existing IAM users or groups. To create a new IAM user, select Users on the Identity and
Access Management page at AWS. Then click Add user and complete the following steps:
1. On the Add user page, set the user name and select the Programmatic access option under Select AWS access
type. Set a custom password and then proceed to permissions by clicking the Permissions button.
2. On the Set permissions page, add the new user to one or more groups if necessary. Then, click Review.
3. On the Add user page, click Create user.
See also:
AWS Documentation:
6.1. Essential AWS settings for monitoring Amazon RDS DB instances in PMM 95
Percona Monitoring and Management Documentation, Release 1.17.0
In order to be able to discover an Amazon RDS DB instance in PMM, you either need to use the access key and secret
access key of an existing IAM user or an IAM role. To create an access key for use with PMM, open the IAM console
and click Users on the navigation pane. Then, select your IAM user.
To create the access key, open the Security credentials tab and click the Create access key button. The system automat-
ically generates a new access key ID and a secret access key that you can provide on the PMM Add Instance dashboard
to have your Amazon RDS DB instances discovered.
Important: You may use an IAM role instead of IAM user provided your Amazon RDS DB instances are associated
with the same AWS account as PMM.
In case, the PMM Server and Amazon RDS DB instance were created by using the same AWS account, you do not
need create the access key ID and secret access key manually. PMM retrieves this information automatically and
attempts to discover your Amazon RDS DB instances.
See also:
AWS Documentation: Managing access keys of IAM users https://docs.aws.amazon.com/IAM/latest/UserGuide/
id_credentials_access-keys.html
The last step before you are ready to create an Amazon RDS DB instance is to attach the policy with the required
permissions to the IAM user.
First, make sure that the Identity and Access Management page is open and open Users. Then, locate and open the
IAM user that you plan to use with Amazon RDS DB instances. Complete the following steps, to apply the policy:
1. On the Permissions tab, click the Add permissions button.
2. On the Add permissions page, click Attach existing policies directly.
3. Using the Filter, locate the policy with the required permissions (such as AmazonRDSforPMMPolicy).
4. Select a checkbox next to the name of the policy and click Review.
5. The selected policy appears on the Permissions summary page. Click Add permissions.
The AmazonRDSforPMMPolicy is now added to your IAM user.
See also:
Creating an IAM policy for PMM Creating a policy
Query Analytics requires Configuring Performance Schema as the query source, because the slow query log is stored on
the AWS side, and QAN agent is not able to read it. Enable the performance_schema option under Parameter
Groups in Amazon RDS.
See also:
Fig. 6.8: To attach, find the policy on the list and place a check mark to select it
More information about the performance schema See Configuring Performance Schema.
AWS Documentation: Parameter groups https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_
WorkingWithParamGroups.html
When adding a monitoring instance for Amazon RDS, specify a unique name to distinguish it from the local MySQL
instance. If you do not specify a name, it will use the client’s host name.
Create the pmm user with the following privileges on the Amazon RDS instance that you want to monitor:
If you have Amazon RDS with a MySQL version prior to 5.5, REPLICATION CLIENT privilege is not available there
and has to be excluded from the above statement.
Note: General system metrics are monitored by using the rds_exporter Prometheus exporter which replaces
node_exporter. rds_exporter gives acces to Amazon Cloudwatch metrics.
node_exporter, used in versions of PMM prior to 1.8.0, was not able to monitor general system metrics remotely.
The following example shows how to enable QAN and MySQL metrics monitoring on Amazon RDS:
See also:
AWS Documentation: Connecting to a DB instance (MySQL engine) https://docs.aws.amazon.com/
AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html
6.1. Essential AWS settings for monitoring Amazon RDS DB instances in PMM 97
Percona Monitoring and Management Documentation, Release 1.17.0
SEVEN
PMM supports all commonly used variants of MySQL, including Percona Server, MariaDB, and Amazon RDS. To
prevent data loss and performance issues, PMM does not automatically change MySQL configuration. However, there
are certain recommended settings that help maximize monitoring efficiency. These recommendations depend on the
variant and version of MySQL you are using, and mostly apply to very high loads.
PMM can collect query data either from the slow query log or from Performance Schema. The slow query log provides
maximum details, but can impact performance on heavily loaded systems. On Percona Server the query sampling
feature may reduce the performance impact.
Performance Schema is generally better for recent versions of other MySQL variants. For older MySQL variants,
which have neither sampling, nor Performance Schema, configure logging only slow queries.
You can add configuration examples provided in this guide to my.cnf and restart the server or change variables
dynamically using the following syntax:
The following sample configurations can be used depending on the variant and version of MySQL:
• If you are running Percona Server (or XtraDB Cluster), configure the slow query log to capture all queries and
enable sampling. This will provide the most amount of information with the lowest overhead.
log_output=file
slow_query_log=ON
long_query_time=0
log_slow_rate_limit=100
log_slow_rate_type=query
log_slow_verbosity=full
log_slow_admin_statements=ON
log_slow_slave_statements=ON
slow_query_log_always_write_time=1
slow_query_log_use_global_control=all
99
Percona Monitoring and Management Documentation, Release 1.17.0
innodb_monitor_enable=all
userstat=1
• If you are running MySQL 5.6+ or MariaDB 10.0+, configure Configuring Performance Schema.
innodb_monitor_enable=all
performance_schema=ON
• If you are running MySQL 5.5 or MariaDB 5.5, configure logging only slow queries to avoid high performance
overhead.
Note: This may affect the quality of monitoring data gathered by QAN (Query Analytics).
log_output=file
slow_query_log=ON
long_query_time=0
log_slow_admin_statements=ON
log_slow_slave_statements=ON
When adding a MySQL instance to monitoring, you can specify the MySQL server superuser account credentials.
However, monitoring with the superuser account is not secure. If you also specify the --create-user option, it
will create a user with only the necessary privileges for collecting data.
See also:
Using the pmm-admin add command to add a monitoring service Adding MySQL metrics service
You can also set up the pmm user manually with necessary privileges and pass its credentials when adding the instance.
To enable complete MySQL instance monitoring, a command similar to the following is recommended:
$ sudo pmm-admin add mysql --user root --password root --create-user
The superuser credentials are required only to set up the pmm user with necessary privileges for collecting data. If you
want to create this user yourself, the following privileges are required:
GRANT SELECT, PROCESS, SUPER, REPLICATION CLIENT, RELOAD ON *.* TO 'pmm'@' localhost'
˓→IDENTIFIED BY 'pass' WITH MAX_USER_CONNECTIONS 10;
If the pmm user already exists, simply pass its credential when you add the instance:
$ sudo pmm-admin add mysql --user pmm --password pass
For more information, run as root pmm-admin add mysql --help.
If you are running Percona Server, a properly configured slow query log will provide the most amount of information
with the lowest overhead. In other cases, use Performance Schema if it is supported.
By definition, the slow query log is supposed to capture only slow queries. These are the queries the execution time
of which is above a certain threshold. The threshold is defined by the long_query_time variable.
In heavily loaded applications, frequent fast queries can actually have a much bigger impact on performance than rare
slow queries. To ensure comprehensive analysis of your query traffic, set the long_query_time to 0 so that all
queries are captured.
However, capturing all queries can consume I/O bandwidth and cause the slow query log file to quickly grow very
large. To limit the amount of queries captured by the slow query log, use the query sampling feature available in
Percona Server.
The log_slow_rate_limit variable defines the fraction of queries captured by the slow query log. A good rule
of thumb is to have approximately 100 queries logged per second. For example, if your Percona Server instance
processes 10_000 queries per second, you should set log_slow_rate_limit to 100 and capture every 100th
query for the slow query log.
Note: When using query sampling, set log_slow_rate_type to query so that it applies to queries, rather than
sessions.
It is also a good idea to set log_slow_verbosity to full so that maximum amount of information about each
captured query is stored in the slow query log.
A possible problem with query sampling is that rare slow queries might not get captured at all. To avoid this, use
the slow_query_log_always_write_time variable to specify which queries should ignore sampling. That
is, queries with longer execution time will always be captured by the slow query log.
By default, slow query log settings apply only to new sessions. If you want to configure the slow query log during
runtime and apply these settings to existing connections, set the slow_query_log_use_global_control
variable to all.
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 choose to parse query data from the
Performance Schema instead of slow query log. 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 not running Percona Server (which supports sampling for the slow query log), then Performance
Schema is a better alternative.
To use Performance Schema, set the performance_schema variable to ON:
If this variable is not set to ON, add the the following lines to the MySQL configuration file my.cnf and restart
MySQL:
[mysql]
performance_schema=ON
If you are running a custom Performance Schema configuration, make sure that the statements_digest con-
sumer is enabled:
mysql> select * from setup_consumers;
+----------------------------------+---------+
| NAME | ENABLED |
+----------------------------------+---------+
| events_stages_current | NO |
| events_stages_history | NO |
| events_stages_history_long | NO |
| events_statements_current | YES |
| events_statements_history | YES |
| events_statements_history_long | NO |
| events_transactions_current | NO |
| events_transactions_history | NO |
| events_transactions_history_long | NO |
| events_waits_current | NO |
| events_waits_history | NO |
| events_waits_history_long | NO |
| global_instrumentation | YES |
| thread_instrumentation | YES |
| statements_digest | YES |
+----------------------------------+---------+
15 rows in set (0.00 sec)
Important: 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.
If certain instruments are not enabled, you will not see the corresponding graphs in the MySQL Performance Schema
Dashboard dashboard. To enable full instrumentation, set the option --performance_schema_instrument
to '%=on' when starting the MySQL server.
$ mysqld --performance-schema-instrument='%=on'
This option can cause additional overhead and should be used with care.
See also:
MySQL Documentation: --performance_schema_instrument option https://dev.mysql.com/doc/refman/
5.7/en/performance-schema-options.html#option_mysqld_performance-schema-instrument
If the instance is already running, configure the QAN agent to collect data from Performance Schema:
1. Open the PMM Query Analytics dashboard.
2. Click the Settings button.
3. Open the Settings section.
4. Select Performance Schema in the Collect from drop-down list.
5. Click Apply to save changes.
If you are adding a new monitoring instance with the pmm-admin tool, use the --query-source perfschema
option:
Run this command as root or by using the sudo command
pmm-admin add mysql --user root --password root --create-user --query-source
˓→perfschema
MySQL 8 (in version 8.0.4) changes the way clients are authenticated by default. The
default_authentication_plugin parameter is set to caching_sha2_password. This change of
the default value implies that MySQL drivers must support the SHA-256 authentication. Also, the communication
channel with MySQL 8 must be encrypted when using caching_sha2_password.
The MySQL driver used with PMM does not yet support the SHA-256 authentication.
With currently supported versions of MySQL, PMM requires that a dedicated MySQL user be set up. This MySQL
user should be authenticated using the mysql_native_password plugin. Although MySQL is configured to
support SSL clients, connections to MySQL Server are not encrypted.
There are two workarounds to be able to add MySQL Server version 8.0.4 or higher as a monitoring service to PMM:
1. Alter the MySQL user that you plan to use with PMM
2. Change the global MySQL configuration
Provided you have already created the MySQL user that you plan to use with PMM, alter this user as follows:
Then, pass this user to pmm-admin add as the value of the --user parameter.
This is a preferred approach as it only weakens the security of one user.
[mysqld]
default_authentication_plugin=mysql_native_password
See also:
Creating a MySQL User for PMM What privileges are required to monitor a MySQL instance?
More information about adding the MySQL query analytics monitoring service Adding MySQL query analytics
service
MySQL Server Blog: MySQL 8.0.4 [New Default Authentication Plugin][caching_sha2_password] https:
//mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/
MySQL Documentation: Authentication Plugins https://dev.mysql.com/doc/refman/8.0/en/
authentication-plugins.html
MySQL Documentation: Native Pluggable Authentication https://dev.mysql.com/doc/refman/8.0/en/
native-pluggable-authentication.html
Not all dashboards in Metrics Monitor are available by default for all MySQL variants and configurations: Oracle‘s
MySQL, Percona Server. or MariaDB. Some graphs require Percona Server, specialized plugins, or additional config-
uration.
Collecting metrics and statistics for graphs increases overhead. You can keep collecting and graphing low-overhead
metrics all the time, and enable high-overhead metrics only when troubleshooting problems.
See also:
More information about PMM dashboards Metrics Monitor
InnoDB metrics provide detailed insight about InnoDB operation. Although you can select to capture only specific
counters, their overhead is low even when they all are enabled all the time. To enable all InnoDB metrics, set the
global variable innodb_monitor_enable to all:
See also:
MySQL Documentation: innodb_monitor_enable variable https://dev.mysql.com/doc/refman/5.7/en/
innodb-parameters.html#sysvar_innodb_monitor_enable
User statistics is a feature of Percona Server and MariaDB. It provides information about user activity, individual table
and index access. In some cases, collecting user statistics can lead to high overhead, so use this feature sparingly.
To enable user statistics, set the userstat variable to 1.
See also:
Percona Server Documentation: userstat https://www.percona.com/doc/percona-server/5.7/diagnostics/user_
stats.html#userstat
MySQL Documentation Setting variables
Query response time distribution is a feature available in Percona Server. It provides information about changes in
query response time for different groups of queries, often allowing to spot performance problems before they lead to
serious issues.
To enable collection of query response time:
1. Install the QUERY_RESPONSE_TIME plugins:
Starting from the version 1.15.0, PMM provides user the ability to take a SQL SELECT statement and turn the result
set into metric series in PMM. The queries are executed at the LOW RESOLUTION level, which by default is every
60 seconds. A key advantage is that you can extend PMM to profile metrics unique to your environment (see users
table example below), or to introduce support for a table that isn’t part of PMM yet. This feature is on by default and
only requires that you edit the configuration file and use vaild YAML syntax. The default configuration file location is
/usr/local/percona/pmm-client/queries-mysqld.yml.
We’re going to take a users table of upvotes and downvotes and turn this into two metric series, with a set of labels.
Labels can also store a value. You can filter against labels.
Lets look at the output so we understand the goal - take data from a MySQL table and store in PMM, then display as
a metric series. Using the Advanced Data Exploration Dashboard you can review your metric series.
MySQL table
Lets assume you have the following users table that includes true/false, string, and integer types.
+----+------+--------------+-----------+------------+-----------+---------------------
˓→+--------+---------+-----------+
We’ll go through a simple example and mention what’s required for each line. The metric series is constructed
based on the first line and appends the column name to form metric series. Therefore the number of metric se-
ries per table will be the count of columns that are of type GAUGE or COUNTER. This metric series will be called
app1_users_metrics_downvotes:
app1_users_metrics: ## leading section of your metric
˓→series.
Each column in the SELECT is named in this example, but that isn’t required, you can use a SELECT * as well.
Notice the format of schema.table for the query is included.
---
app1_users_metrics:
query: "SELECT app,first_name,last_name,logged_in,active_subscription,banned,
˓→upvotes,downvotes FROM app1.users"
metrics:
- app:
usage: "LABEL"
description: "Name of the Application"
- user_type:
usage: "LABEL"
description: "User's privilege level within the Application"
- first_name:
usage: "LABEL"
description: "User's First Name"
- last_name:
usage: "LABEL"
description: "User's Last Name"
- logged_in:
usage: "LABEL"
description: "User's logged in or out status"
- active_subscription:
usage: "LABEL"
description: "Whether User has an active subscription or not"
- banned:
usage: "LABEL"
- downvotes:
usage: "GAUGE"
description: "Count of downvotes the User has earned. Downvotes can be
˓→revoked so the number can increase as well as decrease."
...
This custom query description should be placed in a YAML file (queries-mysqld.yml by default) on the corre-
sponding server with MySQL.
In order to modify the location of the queries file, for example if you have multiple mysqld instances per server, you
need to explicitly identify to the PMM Server MySQL with the pmm-admin add command after the double dash:
EIGHT
Monitoring PostgreSQL metrics with the postgres_exporter is enabled by pmm-admin add postgresql com-
mand. The postgresql alias will set up postgresql:metrics and also linux:metrics on a host (for
more information, see Adding monitoring services).
pmm-admin supports passing PostgreSQL connection information via following flags:
Flag Description
--host PostgreSQL host
--password PostgreSQL password
--port PostgreSQL port
--user PostgreSQL user
An example command line would look like this:
pmm-admin add postgresql --host=localhost --password='secret' --port=5432 --user=pmm_
˓→user
Note: Capturing read and write time statistics is possible only if track_io_timing setting is enabled. This can
be done either in configuration file or with the following query executed on the running system:
ALTER SYSTEM SET track_io_timing=ON;
SELECT pg_reload_conf();
PMM follows postgresql.org EOL policy, and thus supports monitoring PostgreSQL version 9.4 and up. Older versions
may work, but will not be supported. For additional assistance, visit Percona PMM Forums.
Percona recommends that a PostgreSQL user be configured for SUPERUSER level access, in order to gather the
maximum amount of data with a minimum amount of complexity. This can be done with the following command for
the standalone PostgreSQL installation:
CREATE USER pmm_user WITH SUPERUSER ENCRYPTED PASSWORD 'secret';
Note: In case of monitoring a PostgreSQL database running on an Amazon RDS instance, the command should look
as follows:
109
Percona Monitoring and Management Documentation, Release 1.17.0
NINE
In QAN, you can monitor MongoDB metrics and MongoDB queries with the mongodb:metrics or
mongodb:queries monitoring services accordingly. Run the pmm-admin add command to use these moni-
toring services (for more information, see Adding monitoring services).
For mongodb:metrics and mongodb:queries monitoring services to be able work in QAN, you need to set
up the mongodb_exporter user. This user should be assigned the clusterMonitor role for the admin database and
the read role for the local database.
The following example that you can run in the MongoDB shell, adds the mongodb_exporter user and assigns the
appropriate roles.
db.getSiblingDB("admin").createUser({
user: "mongodb_exporter",
pwd: "s3cR#tpa$$worD",
roles: [
{ role: "clusterMonitor", db: "admin" },
{ role: "read", db: "local" }
]
})
Then, you need to pass the user name and password in the value of the --uri option when adding the
mongodb:metrics monitoring service in the pmm-admin add command:
Run this command as root or by using the sudo command.
See also:
Adding a mongodb:metrics monitoring service Adding MongoDB metrics service
111
Percona Monitoring and Management Documentation, Release 1.17.0
Enabling Profiling
For MongoDB to work correctly with QAN, you need to enable profiling in your mongod configuration. When started
without profiling enabled, QAN displays the following warning:
You can enable profiling from command line when you start the mongod server. This command is useful if you start
mongod manually.
Run this command as root or by using the sudo command
Note that you need to specify a path to an existing directory that stores database files with the --dpbath. When the
--profile option is set to 2, mongod collects the profiling data for all operations. To decrease the load, you may
consider setting this option to 1 so that the profiling data are only collected for slow operations.
The --slowms option sets the minimum time for a slow operation. In the given example, any operation which takes
longer than 200 milliseconds is a slow operation.
The --rateLimit option, which is available if you use PSMDB instead of MongoDB, refers to the number of
queries that the MongoDB profiler collects. The lower the rate limit, the less impact on the performance. However,
the accuracy of the collected information decreases as well.
See also:
--rateLimit in PSMDB documentation https://www.percona.com/doc/percona-server-for-mongodb/LATEST/
rate-limit.html
If you run mongod as a service, you need to use the configuration file which by default is /etc/mongod.conf.
In this file, you need to locate the operationProfiling: section and add the following settings:
operationProfiling:
slowOpThresholdMs: 200
mode: slowOp
rateLimit: 100
These settings affect mongod in the same way as the command line options described in section Enabling Profiling
on Command Line. Note that the configuration file is in the YAML format. In this format the indentation of your lines
is important as it defines levels of nesting.
Restart the mongod service to enable the settings. Run this command as root or by using the sudo command
Related Information
MongoDB Documentation: Enabling Profiling https://docs.mongodb.com/manual/tutorial/
manage-the-database-profiler/
MongoDB Documentation: Profiling Mode https://docs.mongodb.com/manual/reference/configuration-options/
#operationProfiling.mode
MongoDB Documentation: SlowOpThresholdMd option https://docs.mongodb.com/manual/reference/
configuration-options/#operationProfiling.slowOpThresholdMs
MongoDB Documentation: Profiler Overhead (from MongoDB documentation) https://docs.mongodb.com/
manual/tutorial/manage-the-database-profiler/#profiler-overhead
Documentation for Percona Server for MongoDB: Profiling Rate Limit https://www.percona.com/doc/
percona-server-for-mongodb/LATEST/rate-limit.html
TEN
You can protect PMM from unauthorized access using the following security features:
• SSL encryption secures traffic between PMM Client and PMM Server
• HTTP password protection adds authentication when accessing the PMM Server web interface
In this chapter
You can encrypt traffic between PMM Client and PMM Server using SSL certificates.
Valid certificates
To use a valid SSL certificate, mount the directory with the certificate files to /srv/nginx/ when running the PMM
Server container.
The directory (/etc/pmm-certs in this example) that you intend to mount must contain the following files:
• certificate.crt
• certificate.key
115
Percona Monitoring and Management Documentation, Release 1.17.0
• ca-certs.pem
• dhparam.pem
Note: To enable SSL encryption, The container publishes port 443 instead of 80.
Alternatively, you can use docker cp to copy the files to an already existing pmm-server container.
This example assumes that you have changed to the directory that contains the certificate files.
Self-signed certificates
The PMM Server images (Docker, OVF, and AMI) already include self-signed certificates. To be able to use them in
your Docker container, make sure to publish the container’s port 443 to the host’s port 443 when running the docker
run command.
$ docker run -d \
-p 443:443 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:latest
Then, you need to enable SSL when connecting a PMM Client to a PMM Server. If you purchased the certificate from
a certificate authority (CA):
You can set the password for accessing the PMM Server web interface by passing the SERVER_PASSWORD environ-
ment variable when creating and running the PMM Server container.
To set the environment variable, use the -e option.
By default, the user name is pmm. You can change it by passing the SERVER_USER environment variable. Note that
the following example uses an insecure port 80 which is typically used for HTTP connections.
Run the following commands as root or by using the sudo command.
PMM Client uses the same credentials to communicate with PMM Server. If you set the user name and password as
described, specify them when connecting a PMM Client to a PMM Server:
You can enable both HTTP password protection and SSL encryption by combining the corresponding options.
The following example shows how you might run the PMM Server container:
The following example shows how you might connect to PMM Server:
To see which security features are enabled, run either pmm-admin ping, pmm-admin config, pmm-admin
info, or pmm-admin list and look at the server address field. For example:
$ pmm-admin ping
OK, PMM server is alive.
ELEVEN
Insight
Home Dashboard
General Information
This section contains links to online resources, such as PMM documentation, releases notes, and blogs.
This section is automatically updated to show the most recent dashboards that you worked with. It also contains the
dashboards that you have bookmarked.
Statistics
This section shows the total number of hosts added to PMM and the total number of database instanced being mon-
itored. This section also current the version number. Use the Check for Updates Manually button to see if you are
using the most recent version of PMM.
Environment Overview
This section lists all added hosts along with essential information about their performance. For each host, you can find
the current values of the following metrics:
• CPU Busy
• Memory Available
• Disk Reads
• Disk Writes
• Network IO
• DB Connections
119
Percona Monitoring and Management Documentation, Release 1.17.0
• DB QPS
• Virtual CPUs
• RAM
• Host Uptime
• DB Uptime
The PMM System Summary dashboard shows detailed infromation about the selected host (the value of the Host field)
and the database server deployed on this host.
The System Summary section contains details about the platform while the Database Summary offers detailed statistics
about the database server.
You can download the current values on this dashboard locally if you click the Download Summary button.
The Advanced Data Exploration dashboard provides detailed information about the progress of a single Prometheus
metric across one or more hosts.
In this section, the values of the selected metric may increase or decrease over time (similar to temperature or memory
usage).
In this section, the values of the selected metric are accummulated over time (useful to count the number of served
requests, for example).
This section presents the values of the selected metric in the tabular form.
See also:
Prometheus Documentation: Metric types https://prometheus.io/docs/concepts/metric_types/
• Load Average
• MySQL Queries
• MySQL Traffic
Load Average
This metric is the average number of processes that are either in a runnable or uninterruptable state. A process in a
runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some
I/O access, eg waiting for disk.
This metric is best used for trends. If you notice the load average rising, it may be due to innefficient queries. In that
case, you may further analyze your queries in QAN.
View all metrics of Cross Server Graphs
See also:
Description of load average in the man page of the uptime command in Debian https://manpages.debian.org/
stretch/procps/uptime.1.en.html
MySQL Queries
This metric is based on the queries reported by the MySQL command SHOW STATUS. It shows the average number
of statements executed by the server. This variable includes statements executed within stored programs, unlike the
Questions variable. It does not count COM_PING or COM_STATISTICS commands.
View all metrics of Cross Server Graphs
See also:
MySQL Server Status Variables: Queries https://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html#
statvar_Queries
MySQL Traffic
This metric shows the network traffic used by the MySQL process.
View all metrics of Cross Server Graphs
Summary Dashboard
• CPU Usage
• Processes
• Network Traffic
• I/O Activity
• Disk Latency
• MySQL Queries
CPU Usage
The CPU Usage graph shows how much of the overall CPU time is used by the server. It has 4 components: system,
user, iowait and softirq.
System The proportion of time the CPU spent inside the Linux kernel for operations like context switching, memory
allocation and queue handling.
User The time spent in the user space. Normally, most of the MySQL CPU time is in user space, a too high value
may indicate an indexing issue.
Iowait The time the CPU spent waiting for disk IO requests to complete. A high value of iowait indicates a disk
bound load.
Softirq The portion of time the CPU spent servicing software interrupts generated by the device drivers. A high value
of softirq may indicates a poorly configured device. The network is generally the main source of high softirq
values. Be aware the graph presents global values, while there may be a lot of unused CPU, a single core may
be saturated. Look for any quantity saturating at 100/(cpu core count).
View all metrics of Summary Dashboard
See also:
Linux CPU Statistics
http://blog.scoutapp.com/articles/2015/02/24/understanding-linuxs-cpu-stats
Processes
The Processes metric shows how many processes/threads are either in the kernel run queue (runnable state) or in the
blocked queue (waiting for I/O).
When the number of process in the runnable state is constantly higher than the number of CPU cores available, the
load is CPU bound.
When the number of process blocked waiting for I/O is large, the load is disk bound.
The running average of the sum of these two quantities is the basis of the loadavg metric.
View all metrics of Summary Dashboard
See also:
More information about Vmstat http://nonfunctionaltestingtools.blogspot.ca/2013/03/vmstat-output-explained.
html
Network Traffic
The Network Traffic graph shows the rate of data transferred over the network. Outbound is the data sent by the server
while Inbound is the data received by the server.
Look for signs of saturation given the capacity of the network devices. If the outbound rate is coffffnstantly high and
close to saturation and you have plenty of available CPU, you should consider activating the compression option on
the MySQL clients and slaves.
View all metrics of Summary Dashboard
I/O Activity
The I/O Activity graph shows the rates of data read from (Page In) and written to (Page Out) the all the disks as
collected from the vmstat bi and bo columns.
View all metrics of Summary Dashboard
Disk Latency
The Disk Latency graph shows the average time to complete read an write operations to the disks.
There is one data series per operation type (Read or Write) per disk mounted to the server.
High latency values, typically more than 15 ms, are an indication of a disk bound workload saturating the storage
subsystem or, a faulty/degraded hardware.
View all metrics of Summary Dashboard
MySQL Queries
The MySQL Queries graph shows the rate of queries processed by MySQL. The rate of queries is a rough indication
of the MySQL Server load.
View all metrics of Summary Dashboard
The InnoDB Row Operations graph shows the rate of rows processed by InnoDB. It is a good indication of the
MySQL Server load. A high value of Rows read, which can easily be above a million, is an indication of poor queries
or deficient indexing.
The amounts of rows inserted, updated and deleted help appreciate the server write load.
View all metrics of Summary Dashboard
The Top MySQL Commands graph shows the rate of the various kind of SQL statements executed on the MySQL
Server.
View all metrics of Summary Dashboard
The Top MySQL Handlers graph shows the rate of the various low level storage engine handler calls. The most
important ones to watch are read_next and read_rnd_next.
A high values for read_rnd_next is an indication there are table scans while a high value of read_next is an indication
of index scans.
Trends Dashboard
The Trends dashboard shows the essential statistics about the selected host. It also includes the essential statistics of
MySQL, such as MySQL questions and InnoDB row reads and row changes.
Note: The MySQL statistics section is empty for hosts other than MySQL.
See also:
MySQL Documentation:
Questions
Metrics
• CPU Usage
• I/O Read Activity
• I/O Write Activity
• MySQL Questions
• InnoDB Rows Read
• InnoDB Rows Changed
CPU Usage
This metric shows the comparison of the percentage of the CPU usage for the current selected range, the previous day
and the previous week. This graph is useful to demonstrate how the CPU usage has changed over time by visually
overlaying time periods.
View all metrics of Trends Dashboard
This metric shows the comparison of I/O Read Activity in terms of bytes read for the current selected range versus
the previous day and the previous week for the same time range. This graph is useful to demonstrate how I/O Read
Activity has changed over time by visually overlaying time periods.
View all metrics of Trends Dashboard
Shows the comparison of I/O Write Activity in terms of byte written for the current selected range versus the previous
day and the previous week for the same time range. This graph is useful to demonstrate how I/O Write Activity has
changed over time by visually overlaying time periods.
View all metrics of Trends Dashboard
MySQL Questions
This metric shows the comparison of the MySQL Questions for the current selected range versus the previous day and
the previous week for the same time range. This graph is useful to demonstrate how MySQL Questions has changed
over time by visually overlaying time periods.
View all metrics of Trends Dashboard
This metric shows the comparison of the InnoDB Rows Read for the current selected range versus the previous day
and the previous week for the same time range. This graph is useful to demonstrate how InnoDB Rows Read has
changed over time by visually overlaying time periods.
View all metrics of Trends Dashboard
This metric shows the comparison of InnoDB Rows Changed for the current selected range versus the previous day
and the previous week for the same time range. This graph is useful to demonstrate how the InnoDB Rows Changed
has fluctuated over time by visually overlaying time periods.
View all metrics of Trends Dashboard
The information in the Network Overview dashboard is grouped into the following sections:
This section reports the inbound speed, outbound speed, traffic errors and drops, and retransmit rate.
View all metrics of Network Overview Dashboard
Network Traffic
This section contains the Network traffic and network utilization hourly metrics.
View all metrics of Network Overview Dashboard
ICMP
• Echos
• Timestamps/Mask Requests
ICMP Errors
InErrors Messages which the entity received but determined as having ICMP-specific errors (bad ICMP checksums,
bad length, etc.)
OutErrors Messages which this entity did not send due to problems discovered within ICMP, such as a lack of buffers
InDestUnreachs Destination Unreachable messages received
OutDestUnreachs Destination Unreachable messages sent
InType3 Destination unreachable
OutType3 Destination unreachable
InCsumErrors Messages with ICMP checksum errors
InTimeExcds Time Exceeded messages received
Messages/Redirects
InMsgs Messages which the entity received. Note that this counter includes all those counted by icmpInErrors
InRedirects Redirect messages received
OutMsgs Messages which this entity attempted to send. Note that this counter includes all those counted by icm-
pOutErrors
OutRedirects Redirect messages sent. For a host, this object will always be zero, since hosts do not send redirects
Echos
Timestamps/Mask Requests
OS Dashboards
The Overall CPU Utilization metric shows how much of the overall CPU time is used by the server. It has 4 compo-
nents:
• system
• user
• iowait
• softirq
In addition, sampling of the Max utilization of a single core is shown.
System
This component the proportion of time the CPUs spent inside the Linux kernel for operations like context
switching, memory allocation and queue handling.
User
This component is the time spent in the user space. Normally, most of the MySQL CPU time is in user
space. A high value of user time indicates a CPU bound workload.
Iowait
This component is the time the CPU spent waiting for disk IO requests to complete. A high value of
iowait indicates a disk bound load.
Softirq
This component is the portion of time the CPU spent servicing software interrupts generated by the device
drivers. A high value of softirq may indicates a poorly configured device. The network devices are
generally the main source of high softirq values.
Be aware that this metric presents global values: while there may be a lot of unused CPU, a single core may be
saturated. Look at the Max Core Utilization to see if any core is reaching close to 100%.
The Current CPU Core Utilization metric shows the total utilization of each CPU core along with the average utilization
of all CPU cores. Watch for any core close to 100% utilization and investigate the root cause.
View all metrics of CPU Utilization Details (Cores)
The All Cores - total graph shows the average distribution of all the CPU times. It has 5 components:
• system
• user
• iowait
• steal
• other
Components
System
This component is the proportion of time the CPUs spent inside the Linux kernel for operations like
context switching, memory allocation and queue handling.
User
This component is the time spent in the user space. Normally, most of the MySQL CPU time is in user
space. A high value of user time indicates a CPU bound workload.
Iowait
This component is the time the CPU spent waiting for disk IO requests to complete. A high value of
iowait indicates a disk bound load. Steal is non zero only in a virtual environment.
Steal
When multiple virtual machines share the same physical host, some virtual machines may be allowed to
use more of their share of CPU and that CPU time is accounted as Steal by the virtual machine from which
the time is taken.
Other
This component is essentially the softirq time which is the portion of time the CPU spent servicing soft-
ware interrupts generated by the device drivers. A high value of softirq may indicates a poorly configured
device. The network devices are generally the main source of high softirq values.
Be aware that this metric presents global values: while there may be a lot of unused CPU, a single core may be
saturated.
View all metrics of CPU Utilization Details (Cores)
Disk space
• Mountpoint Usage
• Mountpoint
Mountpoint Usage
This metric shows the percentage of disk space utilization for every mountpoint defined on the system. It is not good
having some of the mountpoints close to 100% of space utilization, the risk is to have a disk full error that can block
one of the services or even causing a crash of the entire sytem.
In case a mountpoint is close to 100%, consider to cancel unused files or to expand the space allocate to it.
View all metrics of Disk space
Mountpoint
This metric shows information about the disk space usage of the specified mountpoint.
Used Is the amount of space used
Free Is the amount if space not in use
The total disk space allocated to the mountpoint is the sum of Used and Free space.
It is not good having Free close to 0 B. The risk is to have a disk full error that can block one of the services or even
causing a crash of the entire system.
In case Free is close to 0 B, consider to cancel unused files or to expand the space allocated to the mountpoint.
View all metrics of Disk space
The System Overview dashboard provides details about the efficiency of work of the following components. Each
component is represented as a section in the System Overview dashboard.
• CPU
• Memory
• Disk
• Network
The CPU section offers the CPU Usage, CPU Saturation and Max Core Usage, Interrupts and Context Switches, and
Processes metrics.
In the Memory section, you can find the Memory Utilization, Virtual Memory Utilization, Swap Space, and Swap
Activity metrics.
The Disk section contains the I/O Activity, Global File Descriptors Usage, Disk IO Latency, and Disk IO Load metrics.
In the Network section, you can find the Network Traffic, Network Utilization Hourly, Local Network Errors*, and
TCP Retransmission metrics.
The Compare System Parameters dashboard allows to compare wide range of parameters of the servers monitored by
PMM. Same type parameters are shown side by side for all the servers, grouped in the following sections:
• System Information
• CPU
• Memory
• Disk Partitions
• Disk Performance
• Network
The System Information section shows the System Info summary of each server, as well as System Uptime, CPU Cores,
RAM, Saturation Metrics, and Load Average gauges.
The CPU section offers the CPU Usage, Interrupts, and Context Switches metrics.
In the Memory section, you can find the Memory Usage, Swap Usage, and Swap Activity metrics.
The Disk Partitions section encapsulates two metrics, Mountpoint Usage and Free Space.
The Disk Performance section contains the I/O Activity, Disk Operations, Disk Bandwidth, Disk IO Utilization, Disk
Latency, and Disk Load metrics.
Finally, Network section shows Network Traffic, and Network Utilization Hourly metrics.
For each node, this dashboard shows metrics related to Non-uniform memory access (NUMA).
• Memory Usage
• Free Memory Percent
• NUMA Memory Usage Types
• NUMA Allocation Hits
• NUMA Allocation Missed
• Anonymous Memory
• NUMA File (PageCache)
• Shared Memory
• HugePages Statistics
• Local Processes
• Remote Processes
• Slab Memory
..note:
Users who already have General system metrics service monitored and would like to add NUMA metrics
need to remove and re-add linux:metrics on the node:
Memory Usage
Shows the free memory as the ratio to the total available memory.
View all metrics of NUMA Overview Dashboard
Memory missed is allocated on a node despite the process preferring some different node.
Memory foreign is intended for a node, but actually allocated on some different node.
View all metrics of NUMA Overview Dashboard
Anonymous Memory
Active Anonymous memory that has been used more recently and usually not swapped out.
Inactive Anonymous memory that has not been used recently and can be swapped out.
View all metrics of NUMA Overview Dashboard
Active(file) Pagecache memory that has been used more recently and usually not reclaimed until needed.
Inactive(file) Pagecache memory that can be reclaimed without huge performance impact.
View all metrics of NUMA Overview Dashboard
Shared Memory
Shmem Total used shared memory (shared between several processes, thus including RAM disks, SYS-V-IPC and
BSD like SHMEM)
View all metrics of NUMA Overview Dashboard
HugePages Statistics
Total Number of hugepages being allocated by the kernel (Defined with vm.nr_hugepages).
Free The number of hugepages not being allocated by a process
Surp The number of hugepages in the pool above the value in vm.nr_hugepages. The maximum number of surplus
hugepages is controlled by vm.nr_overcommit_hugepages.
View all metrics of NUMA Overview Dashboard
Local Processes
Remote Processes
Memory allocated on a node while a process was running on some other node.
View all metrics of NUMA Overview Dashboard
Slab Memory
Slab Allocation is a memory management mechanism intended for the efficient memory allocation of kernel objects.
SReclaimable The part of the Slab that might be reclaimed (such as caches).
SUnreclaim The part of the Slab that can’t be reclaimed under memory pressure
View all metrics of NUMA Overview Dashboard
Prometheus Dashboards
Prometheus Dashboard
Prometheus overview
This section shows the most essential parameters of the system where Prometheus is running, such as CPU and memory
usage, scrapes performed and the samples ingested in the head block.
Resources
This section provides details about the consumption of CPU and memory by the Prometheus process. This section
contains the following metrics:
• Prometheus Process CPU Usage
• Prometheus Process Memory Usage
Storage (TSDB)
This section includes a collection of metrics related to the usage of storage. It includes the following metrics:
• Data blocks (Number of currently loaded data blocks)
• Total chunks in the head block
• Number of series in the head block
• Current retention period of the head block
• Activity with chunks in the head block
• Reload block data from disk
Scraping
This section contains metrics that help monitor the scraping process. This section contains the following metrics:
• Ingestion
• Prometheus Targets
• Scraped Target by Job
• Scrape Time by Job
• Scraped Target by Instance
• Scraped Time by Instance
• Scrapes by Target Frequency
• Scrape Frequency Versus Target
• Scraping Time Drift
• Prometheus Scrape Interval Variance
• Slowest Jobs
• Largest Samples Jobs
Queries
This section contains metrics that monitor Prometheus queries. This section contains the following metrics:
• Prometheus Queries
• Prometheus Query Execution
• Prometheus Query Execution Latency
• Prometheus Query Execution Load
Network
This section shows the top 10 metrics by time series count and the top 10 hosts by time series count.
Metrics in this section give an overview of the essential system characteristics of PMM Server. This information is
also available from the System Overview dashboard.
This section contains a link to download the logs collected from your PMM Server and further analyze possible
problems. The exported logs are requested when you submit a bug report.
The Prometheus Exporter Status dashboard reports the consumption of resources by the Prometheus exporters used by
PMM. For each exporter, this dashboard reveals the following information:
• CPU usage
• Memory usage
• File descriptors used
• Exporter uptime
See also:
All PMM exporters pmm.list.exporter
Summary information about the usage of Prometheus exporters Prometheus Exporters Overview
The Prometheus Exporters Overview dashboard provides the summary of how exporters are used across the selected
hosts.
See also:
Percona Database Performance Blog
Understand Your Prometheus Exporters with Percona Monitoring and Management (PMM)
Prometheus documentation
This section provides a summary of how exporters are used across the selected hosts. It includes the average usage of
CPU and memory as well as the number of hosts being monitored and the total number of running exporters.
• Avg CPU Usage per Host shows the average CPU usage in percent per host for all exporters.
• Avg Memory Usage per Host shows the Exporters average Memory usage per host.
• Monitored Hosts shows the number of monitored hosts that are running Exporters.
• Exporters Running shows the total number of Exporters running with this PMM Server instance.
Note: The CPU usage and memory usage do not include the additional CPU and memory usage required to produce
metrics by the application or operating system.
This section shows how resources, such as CPU and memory, are being used by the exporters for the selected hosts.
• CPU Usage plots the Exporters’ CPU usage across each monitored host (by default, All hosts).
• Memory Usage plots the Exporters’ Memory usage across each monitored host (by default, All hosts).
This section shows how resources, such as CPU and memory, are being used by the exporters for host types: MySQL,
MongoDB, ProxySQL, and the system.
• CPU Cores Used shows the Exporters’ CPU Cores used for each type of Exporter.
• Memory Usage shows the Exporters’ memory used for each type of Exporter.
List of Hosts
At the bottom, this dashboard shows details for each running host.
• CPU Used show the CPU usage as a percentage for all Exporters.
• Mem Used shows total Memory Used by Exporters.
• Exporters Running shows the number of Exporters running.
• RAM shows the total amount of RAM of the host.
• Virtual CPUs shows the total number of virtual CPUs on the host.
You can click the value of the CPU Used, Memory Used, or Exporters Running column to open the Prometheus
Exporter Status for further analysis.
MySQL Dashboards
This graph shows number of commits which the Amazon Aurora engine performed as well as the average commit
latency. Graph Latency does not always correlates with number of commits performed and can quite high in certain
situations.
This graph shows what statements contribute most load on the system as well as what load corresponds to Amazon
Aurora transaction commit.
• Write Transaction Commit Load: Load in Average Active Sessions per second for COMMIT operations
• UPDATE load: load in Average Active Sessions per second for UPDATE queries
• SELECT load: load in Average Active Sessions per second for SELECT queries
• DELETE load: load in Average Active Sessions per second for DELETE queries
• INSERT load: load in Average Active Sessions per second for INSERT queries
This graph shows how much memory is used by Amazon Aurora lock manager as well as amount of memory used by
Amazon Aurora to store Data Dictionary.
• Aurora Lock Manager Memory: the amount of memory used by the Lock Manager, the module responsible for
handling row lock requests for concurrent transactions.
• Aurora Dictionary Memory: the amount of memory used by the Dictionary, the space that contains metadata
used to keep track of database objects, such as tables and indexes.
This graph shows average latency for most important types of statements. Latency spikes are often indicative of the
instance overload.
• DDL Latency: Average time to execute DDL queries
• DELETE Latency: average time to execute DELETE queries
• UPDATE Latency: average time to execute UPDATE queries
• SELECT Latency: average time to execute SELECT queries
• INSERT Latency: average time to execute INSERT queries
Amazon Aurora MySQL allows a number of commands which are not available from standard MySQL. This graph
shows usage of such commands. Regular unit_test calls can be seen in default Amazon Aurora install, the rest
will depend on your workload.
show_volume_status The number of executions per second of the command SHOW VOLUME STATUS. The SHOW
VOLUME STATUS query returns two server status variables: Disks and Nodes. These variables represent the
total number of logical blocks of data and storage nodes, respectively, for the DB cluster volume.
awslambda The number of AWS Lambda calls per second. AWS Lambda is an event-drive, serverless computing
platform provided by AWS. It is a compute service that run codes in response to an event. You can run any kind
of code from Aurora invoking Lambda from a stored procedure or a trigger.
alter_system The number of executions per second of the special query ALTER SYSTEM, that is a special query to
simulate an instance crash, a disk failure, a disk congestion or a replica failure. It is a useful query for testing
the system.
This metric shows different kinds of internal Amazon Aurora MySQL problems which should be zero in case of
normal operation.
• Reserved mem Exceeded Incidents
• Missing History on Replica Incidents
• Thread deadlocks: number of deadlocks per second
This dashboard shows server status variables. On this dashboard, you may select multiple servers and compare their
counters simultaneously.
Server status variables appear in two sections: Commands and Handlers. Choose one or more variables in the Com-
mand and Handler fields in the top menu to select the variables which will appear in the COMMANDS or HANDLERS
section for each host. Your comparison may include from one up to three hosts.
By default or if no item is selected in the menu, PMM displays each command or handler respectively.
See also:
MySQL Documentation: Server Status Variables https://dev.mysql.com/doc/refman/8.0/en/
server-status-variables.html
The level of zlib compression to use for InnoDB compressed tables and indexes.
The maximum percentage that can be reserved as free space within each compressed page, allowing room to reorganize
the data and modification log within the page when a compressed table or index is updated and the data might be
recompressed.
Specifies whether images of re-compressed pages are written to the redo log. Re-compression may occur when changes
are made to compressed data.
Compress Attempts
Number of compression operations attempted. Pages are compressed whenever an empty page is created or the space
for the uncompressed modification log runs out.
Uncompressed Attempts
Number of uncompression operations performed. Compressed InnoDB pages are uncompressed whenever compres-
sion fails, or the first time a compressed page is accessed in the buffer pool and the uncompressed page does not
exist.
This dashboard contains metrics that help analyze how the InnoDB engine performs.
The maximum checkpoint age is determined by the total length of all transaction log files (innodb_log_file_size).
When the checkpoint age reaches the maximum checkpoint age, blocks are flushed syncronously. The rules of the
thumb is to keep one hour of traffic in those logs and let the checkpointing perform its work as smooth as possible. If
you don’t do this, InnoDB will do synchronous flushing at the worst possible time, i.e. when you are busiest.
View all metrics of MySQL InnoDB Metrics
InnoDB Transactions
InnoDB is an MVCC storage engine, which means you can start a transaction and continue to see a consistent snapshot
even as the data changes. This is implemented by keeping old versions of rows as they are modified.
The InnoDB History List is the undo logs which are used to store these modifications. They are a fundamental part of
the InnoDB transactional architecture.
If the history length is rising regularly, do not let open connections linger for a long period as this can affect the
performance of InnoDB considerably. It is also a good idea to look for long running queries in QAN.
View all metrics of MySQL InnoDB Metrics
This metric allows you to see which operations occur and the number of rows affected per operation. A metric like
Queries Per Second will give you an idea of queries, but one query could effect millions of rows.
View all metrics of MySQL InnoDB Metrics
When data is locked, then that means that another session cannot update that data until the lock is released (which
unlocks the data and allows other users to update that data. Locks are usually released by either a ROLLBACK or
COMMIT SQL statement.
InnoDB implements standard row-level locking where there are two types of locks, shared (S) locks and exclusive (X)
locks.
A shared (S) lock permits the transaction that holds the lock to read a row. An exclusive (X) lock permits the transaction
that holds the lock to update or delete a row. Average Row Lock Wait Time is the row lock wait time divided by the
number of row locks.
Row Lock Waits indicates how many times a transaction waited on a row lock per second.
Row Lock Wait Load is a rolling 5 minute average of Row Lock Waits.
View all metrics of MySQL InnoDB Metrics
See also:
MySQL Server Documentation: Shared lock https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_
shared_lock
MySQL Server Documentation: Exclusive lock https://dev.mysql.com/doc/refman/5.7/en/glossary.html#glos_
exclusive_lock
MySQL Server Documentation: InnoDB locking https://dev.mysql.com/doc/refman/5.7/en/innodb-locking.html
InnoDB I/O
Along with the buffer pool size, innodb_log_file_size is the most important setting when we are working with InnoDB.
This graph shows how much data was written to InnoDB’s redo logs over each hour. When the InnoDB log files are
full, InnoDB needs to flush the modified pages from memory to disk.
The rules of the thumb is to keep one hour of traffic in those logs and let the checkpointing perform its work as smooth
as possible. If you don’t do this, InnoDB will do synchronous flushing at the worst possible time, ie when you are
busiest.
This graph can help guide you in setting the correct innodb_log_file_size.
View all metrics of MySQL InnoDB Metrics
See also:
Percona Database Performance Blog: Calculating a good InnoDB log file size https://www.percona.com/blog/
2008/11/21/how-to-calculate-a-good-innodb-log-file-size/
Percona Server Documentation: Improved InnoDB I/O scalability http://www.percona.com/doc/percona-server/
5.5/scalability/innodb_io_55.html#innodb_log_file_size
InnoDB Deadlocks
A deadlock in MySQL happens when two or more transactions mutually hold and request for locks, creating a cycle of
dependencies. In a transaction system, deadlocks are a fact of life and not completely avoidable. InnoDB automatically
detects transaction deadlocks, rollbacks a transaction immediately and returns an error.
View all metrics of MySQL InnoDB Metrics
See also:
Index Condition Pushdown (ICP) is an optimization for the case where MySQL retrieves rows from a table using an
index.
Without ICP, the storage engine traverses the index to locate rows in the base table and returns them to the MySQL
server which evaluates the WHERE condition for the rows. With ICP enabled, and if parts of the WHERE condition can
be evaluated by using only columns from the index, the MySQL server pushes this part of the WHERE condition down
to the storage engine. The storage engine then evaluates the pushed index condition by using the index entry and only
if this is satisfied is the row read from the table.
ICP can reduce the number of times the storage engine must access the base table and the number of times the MySQL
server must access the storage engine.
View all metrics of MySQL InnoDB Metrics
See also:
MySQL Server Documentation: Index Condition Pushdown optimisation https://dev.mysql.com/doc/refman/5.
7/en/index-condition-pushdown-optimization.html
Percona Database Performance Blog: ICP counters and how to interpret them https://www.percona.com/blog/
2017/05/09/mariadb-handler_icp_-counters-what-they-are-and-how-to-use-them/
Other Metrics
The MySQL InnoDB Metrics (Advanced) dashboard contains metrics that provide detailed information about the
performance of the InnoDB storage engine on the selected MySQL host. This dashboard contains the following
metrics:
Important: If you do not see any metric, try running the following command in the MySQL client:
This metric shows the activity on the InnoDB change buffer. The InnoDB change buffer records updates to non-unique
secondary keys when the destination page is not in the buffer pool. The updates are applied when the page is loaded
in the buffer pool, prior to its use by a query. The merge ratio is the number of insert buffer changes done per page,
the higher the ratio the better is the efficiency of the change buffer.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Log Buffer Performance graph shows the efficiency of the InnoDB log buffer. The InnoDB log buffer
size is defined by the innodb_log_buffer_size parameter and illustrated on the graph by the Size graph. Used
is the amount of the buffer space that is used. If the Used graph is too high and gets close to Size, additional log writes
will be required.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Page Splits graph shows the InnoDB page maintenance activity related to splitting and merging pages.
When an InnoDB page, other than the top most leaf page, has too much data to accept a row update or a row insert,
it has to be split in two. Similarly, if an InnoDB page, after a row update or delete operation, ends up being less
than half full, an attempt is made to merge the page with a neighbor page. If the resulting page size is larger than
the InnoDB page size, the operation fails. If your workload causes a large number of page splits, try lowering the
innodb_fill_factor variable (5.7+).
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Page Reorgs graph shows information about the page reorganization operations. When a page receives
an update or an insert that affect the offset of other rows in the page, a reorganization is needed. If the reorganization
process finds out there is not enough room in the page, the page will be split. Page reorganization can only fail for
compressed pages.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Purge Performance graph shows metrics about the page purging process. The purge process removed the
undo entries from the history list and cleanup the pages of the old versions of modified rows and effectively remove
deleted rows.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
InnoDB Locking
The InnoDB Locking graph shows the row level lock activity inside InnoDB.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Main Thread Utilization graph shows the portion of time the InnoDB main thread spent at various task.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Transactions Information graph shows details about the recent transactions. Transaction IDs Assigned
represents the total number of transactions initiated by InnoDB. RW Transaction Commits are the number of trans-
actions not read-only. Insert-Update Transactions Commits are transactions on the Undo entries. Non Locking RO
Transaction Commits are transactions commit from select statement in auto-commit mode or transactions explicitly
started with “start transaction read only”.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Undo Space Usage graph shows the amount of space used by the Undo segment. If the amount of space
grows too much, look for long running transactions holding read views opened in the InnoDB status.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
InnoDB Activity
The InnoDB Acitivity graph shows a measure of the activity of the InnoDB threads.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Contention - OS Waits graph shows the number of time an OS wait operation was required while waiting
to get the lock. This happens once the spin rounds are exhausted.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Contention - Spin Rounds metric shows the number of spin rounds executed in order to get a lock. A
spin round is a fast retry to get the lock in a loop.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Group Commit Batch Size metric shows how many bytes were written to the InnoDB log files per attempt
to write. If many threads are committing at the same time, one of them will write the log entries of all the waiting
threads and flush the file. Such process reduces the number of disk operations needed and enlarge the batch size.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Purge Throttling graph shows the evolution of the purge lag and the max purge lag currently set. Under
heavy write load, the purge operation may start to lag behind and when the max purge lag is reached, a delay, propor-
tional to the value defined by innodb_max_purge_lag_delay (in microseconds) is added to all update, insert and delete
statements. This helps prevents flushing stalls.
https://dev.mysql.com/doc/refman/5.6/en/innodb-parameters.html#sysvar_innodb_max_purge_lag
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB AHI Usage graph shows the search operations on the InnoDB adaptive hash index and its efficiency. The
adaptive hash index is a search hash designed to speed access to InnoDB pages in memory. If the Hit Ratio is small,
the working data set is larger than the buffer pool, the AHI should likely be disabled.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB AHI Maintenance graph shows the maintenance operation of the InnoDB adaptive hash index. The adap-
tive hash index is a search hash to speed access to InnoDB pages in memory. A constant high number of rows/pages
added and removed can be an indication of an ineffective AHI.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The InnoDB Online DDL graph shows the state of the online DDL (alter table) operations in InnoDB. The progress
metric is estimate of the percentage of the rows processed by the online DDL.
InnoDB Defragmentation
The InnoDB Defragmentation graph shows the status information related to the InnoDB online defragmentation feature
of MariaDB for the optimize table command. To enable this feature, the variable innodb-defragment must be set to 1
in the configuration file.
View all metrics of MySQL InnoDB Metrics (Advanced) Dashboard
The MySQL MyISAM Aria Metrics dashboard describes the specific features of MariaDB MySQL server: Aria
storage engine, Online DDL (online alter table),
and InnoDB defragmentation patch. This dashboard contains the following metrics:
Aria storage is specific for MariaDB Server. Aria has most of the same variables that MyISAM has, but with an Aria
prefix. If you use Aria instead of MyISAM, then you should make key_buffer_size smaller and aria-pagecache-
buffer-size bigger.
This graph is similar to InnoDB buffer pool reads and writes. aria-pagecache-buffer-size is the main cache
for aria storage engine. If you see high reads and writes (physical IO), i.e. reads is close to read requests or writes are
close to write requests you may need to increase the aria-pagecache-buffer-size (you may need to decrease
other buffers: key_buffer_size, innodb_buffer_pool_size etc)
This graphs shows the utilization for the aria pagecache. This is similar to InnoDB buffer pool graph. If you see all
blocks are used you may consider increasing aria-pagecache-buffer-size (you may need to decrease other
buffers: key_buffer_size, innodb_buffer_pool_size etc)
This metric is similar to InnoDB log file syncs. If you see lots of log syncs and want to relax the durability settings
you can change (in seconds) from 30 (default) to a higher number. It is good to look at the disk IO dashboard as well.
See also:
List of Aria system variables
https://mariadb.com/kb/en/library/aria-system-variables/
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. RocksDB 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 information for this
dashboard comes from the Information Schema tables.
See also:
Information schema https://github.com/facebook/mysql-5.6/wiki/MyRocks-Information-Schema
Metrics
• MyRocks cache
MySQL Overview
• MySQL Uptime
• Current QPS
• InnoDB Buffer Pool Size
• Buffer Pool Size % of Total RAM
• MySQL Connections
• MySQL Active Threads
• MySQL Questions
• MySQL Thread Cache
• MySQL Select Types
• MySQL Sorts
• MySQL Slow Queries
• Aborted Connections
• Table Locks
• MySQL Network Traffic
• MySQL Network Usage Hourly
• MySQL Internal Memory Overview
• Top Command Counters and Top Command Counters Hourly
• MySQL Handlers
• MySQL Query Cache Memory and MySQL Query Cache Activity
• MySQL Open Tables, MySQL Table Open Cache Status, and MySQL Table Definition Cache
MySQL Uptime
The amount of time since the MySQL server process was started.
View all metrics of MySQL Overview
Current QPS
Based on the queries reported by MySQL‘s SHOW STATUS command, this metric shows the number of queries
executed by the server during the last second.n This metric includes statements executed within stored programs.
This variable does not include the following commands:
• COM_PING
• COM_STATISTICS
View all metrics of MySQL Overview
See also:
MySQL Server Status Variables: Queries https://dev.mysql.com/doc/refman/5.6/en/server-status-variables.html#
statvar_Queries
Absolute value of the InnoDB buffer pool used for caching data and indexes in memory.
The goal is to keep the working set in memory. In most cases, this should be between 60%-90% of available memory
on a dedicated database host, but depends on many factors.
View all metrics of MySQL Overview
The ratio between InnoDB buffer pool size and total memory. In most cases, the InnoDB buffer pool should be
between 60% and 90% of available memory on a dedicated database host, but it depends on many factors.
View all metrics of MySQL Overview
MySQL Connections
Max Connections The maximum permitted number of simultaneous client connections. This is the value of the
max_connections variable.
Max Used Connections The maximum number of connections that have been in use simultaneously since the server
was started.
Connections The number of connection attempts (successful or not) to the MySQL server.
MySQL Questions
The number of queries sent to the server by clients, excluding those executed within stored programs.
This variable does not count the following commands:
View all metrics of MySQL Overview
• COM_PING
• COM_STATISTICS
• COM_STMT_PREPARE
• COM_STMT_CLOSE
• COM_STMT_RESET
View all metrics of MySQL Overview
The thread_cache_size metric informs how many threads the server should cache to reuse. When a client disconnects,
the client’s threads are put in the cache if the cache is not full. It is autosized in MySQL 5.6.8 and above (capped to
100).
Requests for threads are satisfied by reusing threads taken from the cache if possible, and only when the cache is
empty is a new thread created.
• Threads_created: The number of threads created to handle connections.
• Threads_cached: The number of threads in the thread cache.
View all metrics of MySQL Overview
See also:
MySQL Server status variables: thread_cache_size https://dev.mysql.com/doc/refman/5.6/en/
server-system-variables.html#sysvar_thread_cache_size
As with most relational databases, selecting based on indexes is more efficient than scanning the data of an entire table.
Here, we see the counters for selects not done with indexes.
• Select Scan is how many queries caused full table scans, in which all the data in the table had to be read and
either discarded or returned.
• Select Range is how many queries used a range scan, which means MySQL scanned all rows in a given range.
• Select Full Join is the number of joins that are not joined on an index, this is usually a huge performance hit.
View all metrics of MySQL Overview
MySQL Sorts
Due to a query’s structure, order, or other requirements, MySQL sorts the rows before returning them. For example, if
a table is ordered 1 to 10 but you want the results reversed, MySQL then has to sort the rows to return 10 to 1.
This graph also shows when sorts had to scan a whole table or a given range of a table in order to return the results
and which could not have been sorted via an index.
View all metrics of MySQL Overview
Slow queries are defined as queries being slower than the long_query_time setting. For example, if you have
long_query_time set to 3, all queries that take longer than 3 seconds to complete will show on this graph.
View all metrics of MySQL Overview
Aborted Connections
When a given host connects to MySQL and the connection is interrupted in the middle (for example due to bad
credentials), MySQL keeps that info in a system table (since 5.6 this table is exposed in performance_schema).
If the amount of failed requests without a successful connection reaches the value of max_connect_errors, mysqld
assumes that something is wrong and blocks the host from further connections.
To allow connections from that host again, you need to issue the FLUSH HOSTS statement.
View all metrics of MySQL Overview
Table Locks
MySQL takes a number of different locks for varying reasons. In this graph we see how many Table level locks
MySQL has requested from the storage engine. In the case of InnoDB, many times the locks could actually be row
locks as it only takes table level locks in a few specific cases.
It is most useful to compare Locks Immediate and Locks Waited. If Locks Waited is rising, it means you have lock
contention. Otherwise, Locks Immediate rising and falling is normal activity.
View all metrics of MySQL Overview
This metric shows how much network traffic is generated by MySQL. Outbound is network traffic sent from MySQL
and Inbound is the network traffic that MySQL has received.
View all metrics of MySQL Overview
This metric shows how much network traffic is generated by MySQL per hour. You can use the bar graph to compare
data sent by MySQL and data received by MySQL.
View all metrics of MySQL Overview
The MySQL InnoDB log buffer allows transactions to run without having to write the log to disk before
the transactions commit. The size of this buffer is configured with the innodb_log_buffer_size variable.
View all metrics of MySQL Overview
See https://dev.mysql.com/doc/refman/5.7/en/server-status-variables.html#statvar_Com_xxx
View all metrics of MySQL Overview
MySQL Handlers
Handler statistics are internal statistics on how MySQL is selecting, updating, inserting, and modifying rows, tables,
and indexes.
This is in fact the layer between the Storage Engine and MySQL.
• read_rnd_next is incremented when the server performs a full table scan and this is a counter you don’t really
want to see with a high value.
• read_key is incremented when a read is done with an index.
• read_next is incremented when the storage engine is asked to ‘read the next index entry’. A high value means a
lot of index scans are being done.
View all metrics of MySQL Overview
The query cache has huge scalability problems in that only one thread can do an operation in the query cache at the
same time. This serialization is true not only for SELECT, but also for INSERT, UPDATE, and DELETE.
This also means that the larger the query_cache_size is set to, the slower those operations become. In concurrent
environments, the MySQL Query Cache quickly becomes a contention point, decreasing performance. MariaDB and
Amazon Aurora have done work to try and eliminate the query cache contention in their flavors of MySQL, while
MySQL 8.0 has eliminated the query cache feature.
The recommended settings for most environments is to set:
query_cache_type=0
query_cache_size=0
Note: While you can dynamically change these values, to completely remove the contention point you have to restart
the database.
MySQL Open Tables, MySQL Table Open Cache Status, and MySQL Table Definition Cache
The recommendation is to set the table_open_cache_instances to a loose correlation to virtual CPUs, keeping in mind
that more instances means the cache is split more times. If you have a cache set to 500 but it has 10 instances, each
cache will only have 50 cached.
The table_definition_cache and table_open_cache can be left as default as they are autosized MySQL 5.6 and above
(do not set them to any value).
View all metrics of MySQL Overview
See also:
Configuring MySQL for PMM Settings for Dashboards
MySQL Documentation: InnoDB buffer pool https://dev.mysql.com/doc/refman/5.7/en/innodb-buffer-pool.html
Percona Server Documentation: Running TokuDB in Production https://www.percona.com/doc/percona-server/
LATEST/tokudb/tokudb_quickstart.html#considerations-to-run-tokudb-in-production
Blog post: Adaptive Hash Index in InnoDB https://www.percona.com/blog/2016/04/12/
is-adaptive-hash-index-in-innodb-right-for-my-workload/
MySQL Server System Variables: key_buffer_size https://dev.mysql.com/doc/refman/5.7/en/
server-system-variables.html#sysvar_key_buffer_size
MySQL Server System Variables: table_open_cache http://dev.mysql.com/doc/refman/5.6/en/
server-system-variables.html#sysvar_table_open_cache
The MySQL Performance Schema dashboard helps determine the efficiency of communicating with Performance
Schema. This dashboard contains the following metrics:
• Performance Schema file IO (events)
• Performance Schema file IO (load)
• Performance Schema file IO (Bytes)
• Performance Schema waits (events)
• Performance Schema waits (load)
• Index access operations (load)
• Table access operations (load)
• Performance Schema SQL and external locks (events)
• Performance Schema SQL and external locks (seconds)
See also:
MySQL Documentation: Performance Schema
https://dev.mysql.com/doc/refman/5.7/en/performance-schema.html
This dashboard helps to analyse Performance Schema wait events. It plots the following metrics for the chosen (one
or more) wait events:
• Count - Performance Schema Waits
• Load - Performance Schema Waits
• Avg Wait Time - Performance Schema Waits
See also:
MySQL Documentation: Performance Schema
https://dev.mysql.com/doc/refman/5.7/en/performance-schema.html
The Average Query Response Time graph shows information collected using the Response Time Distribution plugin
sourced from table INFORMATION_SCHEMA.QUERY_RESPONSE_TIME. It computes this value across all queries
by taking the sum of seconds divided by the count of seconds.
View all metrics of MySQL Query Response Time
See also:
Percona Server Documentation: QUERY_RESPONSE_TIME table https://www.percona.com/doc/
percona-server/5.7/diagnostics/response_time_distribution.html#QUERY_RESPONSE_TIME
Shows how many fast, neutral, and slow queries are executed per second.
Query response time counts (operations) are grouped into three buckets:
• 100ms - 1s
• 1s - 10s
• > 10s
View all metrics of MySQL Query Response Time
Available only in Percona Server for MySQL, this metric provides visibility of the split of READ vs WRITE query
response time.
View all metrics of MySQL Query Response Time
See also:
Percona Server Documentation: Logging queries in separate READ and WRITE tables https:
//www.percona.com/doc/percona-server/5.7/diagnostics/response_time_distribution.html#
logging-the-queries-in-separate-read-and-write-tables
Percona Server Documentation: QUERY_RESPONSE_TIME_READ https://www.percona.com/doc/
percona-server/5.7/diagnostics/response_time_distribution.html#QUERY_RESPONSE_TIME_READ
Available only in Percona Server for MySQL, illustrates READ query response time counts (operations) grouped into
three buckets:
• 100ms - 1s
• 1s - 10s
• > 10s
View all metrics of MySQL Query Response Time
See also:
Percona Server Documentation: QUERY_RESPONSE_TIME_READ https://www.percona.com/doc/
percona-server/5.7/diagnostics/response_time_distribution.html#QUERY_RESPONSE_TIME_READ
Available only in Percona Server for MySQL, illustrates WRITE query response time counts (operations) grouped into
three buckets:
• 100ms - 1s
• 1s - 10s
• > 10s
View all metrics of MySQL Query Response Time
See also:
Configuring MySQL for PMM Percona Server Query Response Time Distribution
Percona Server Documentation: QUERY_RESPONSE_TIME_WRITE https://www.percona.com/doc/
percona-server/5.7/diagnostics/response_time_distribution.html#QUERY_RESPONSE_TIME_WRITE
MySQL Replication
• IO Thread Running
• SQL Thread Running
• Replication Error No
• Read only
• MySQL Replication Delay
• Binlog Size
• Binlog Data Written Hourly
• Binlog Count
• Binlogs Created Hourly
IO Thread Running
This metric shows if the IO Thread is runnig or not. It only applies to a slave host.
SQL Thread is a process that runs on a slave host in the replication environment. It reads the events from the local
relay log file and applies them to the slave server.
Depending on the format of the binary log it can read query statements in plain text and re-execute them or it can read
raw data and apply them to the local host.
Possible values
Yes
The thread is running and is connected to a replication master
No
The thread is not running because it is not lauched yet or because an error has occured connecting to the
master host
Connecting
The thread is running but is not connected to a replication master
No value
The host is not configured to be a replication slave
IO Thread Running is one of the parameters that the command SHOW SLAVE STATUS returns.
See also:
MySQL Documentation
• Replication
• SHOW SLAVE STATUS Syntax
• IO Thread states
View all metrics of MySQL Replication
This metric shows if the SQL thread is running or not. It only applies to a slave host.
SQL Thread is a process that runs on a slave host in the replication environment. It reads the events from the local
relay log file and applies them to the slave server.
Depending on the format of the binary log it can read query statements in plain text and re-execute them or it can read
raw data and apply them to the local host.
Possibile values
Yes
SQL Thread is running and is applying events from the realy log to the local slave host
No
SQL Thread is not running because it is not launched yet or because of an errror occurred while applying
an event to the local slave host
See also:
MySQL Documentation:
• Replication
• SHOW SLAVE STATUS Syntax
• SQL Thread states
View all metrics of MySQL Replication
Replication Error No
This metric shows the number of the last error in the SQL Thread encountered which caused replication to stop.
One of the more common errors is Error: 1022 Duplicate Key Entry. In such a case replication is attempting to update
a row that already exists on the slave. The SQL Thread will stop replication in order to avoid data corruption.
See also:
MySQL Documentation:
A complete list of error codes
View all metrics of MySQL Replication
Read only
This metric indicates whether the host is configured to be in Read Only mode or not.
Possible values
Yes
The slave host permits no client updates except from users who have the SUPER privilege or the REPLI-
CATION SLAVE privilege.
This kind of configuration is tipically used for slave hosts in a replication environment to avoid a user can
inadvertently or voluntarily modify data causing inconsistencies and stopping the replication process.
No
The slave host is not configured in Read Only mode.
See also:
MySQL Documentation:
Replication
This metric shows the number of seconds the slave host is delayed in replication applying events compared to when
the Master host applied them, denoted by the Seconds_Behind_Master value, and only applies to a slave host.
Since the replication process applies the data modifications on the slave asyncronously, it could happen that the slave
replicates events after some time. The main reasons are:
• Network round trip time - high latency links will lead to non-zero replication lag values.
• Single threaded nature of replication channels - master servers have the advantage of applying changes in
parallel, whereas slave ones are only able to apply changes in serial, thus limiting their throughput. In some
cases Group Commit can help but is not always applicable.
• High number of changed rows or computationally expensive SQL - depending on the replication format
(ROW vs STATEMENT), significant changes to the database through high volume of rows modified, or expensive
CPU will all contribute to slave servers lagging behind the master.
Generally adding more CPU or Disk resources can alleviate replication lag issues, up to a point.
Ideally a value of 0 is desired, but be aware that Seconds_Behind_Master is an integer value and thus rounding
is a factor. If you desire greater precision, consider the Percona Toolkit tool pt-heartbeat, as this graph will
automatically take into account this tool and then show you greater resolution in the milliseconds.
See also:
Related metrics:
• Relay Log Space
MySQL Documentation
• SHOW SLAVE STATUS Syntax
• Improving replication performance
• Replication Slave Options and Variables
View all metrics of MySQL Replication
Binlog Size
This metric shows the overall size of the binary log files, which can exist on both master and slave servers. The binary
log (also known as the binlog) contains events that describe database changes: CREATE TABLE, ALTER TABLE,
updates, inserts, deletes and other statements or database changes. The binlog is the file that is read by slaves via
their IO Thread process in order to replicate database changes modification on the data and on the table structures.
There can be more than one binlog file present depending on the binlog rotation policy adopted (for example using the
configuration variables max_binlog_size and expire_logs_days).
There can be more binlog files depending on the rotation policy adopted (for example using the configuration variables
max_binlog_size and expire_logs_days) or even because of server reboots.
When planning the disk space, take care of the overall dimension of binlog files and adopt a good rotation policy or
think about having a separate mount point or disk to store the binlog data.
See also:
MySQL Documentation:
• The binary log
• Configuring replication
View all metrics of MySQL Replication
This metric shows the amount of data written hourly to the binlog files during the last 24 hours. This metric can give
you an idea of how big is your application in terms of data writes (creation, modification, deletion).
View all metrics of MySQL Replication
Binlog Count
This metric shows the overall count of binary log files, on both master and slave servers.
There can be more binlog files depending on the rotation policy adopted (for example using the configuration variables
max_binlog_size and expire_logs_days) or even because of server reboots.
When planning the disk space, take care of the overall dimension of binlog files and adopt a good rotation policy or
think about having a separate mount point or disk to store the binlog data.
See also:
MySQL Documentation:
• The binary log
• Configuring replication
View all metrics of MySQL Replication
This metric shows the number of binlog files created hourly during the last 24 hours.
There can be more binlog files depending on the rotation policy adopted (for example using the configuration variables
max_binlog_size and expire_logs_days) or even because of server reboots.
When planning the disk space, take care of the overall dimension of binlog files and adopt a good rotation policy or
think about having a separate mount point or disk to store the binlog data.
View all metrics of MySQL Replication
This metric shows the overall size of the relay log files. It only applies to a slave host.
The relay log consists of a set of numbered files containing the events to be executed on the slave host in order to
replicate database changes.
The relay log has the same format as the binlog.
There can be multiple relay log files depending on the rotation policy adopted (using the configuration variable
max_relay_log_size).
As soon as the SQL thread completes to execute all events in the relay log file, the file is deleted.
If this metric contains a high value, the variable max_relay_log_file is high too. Generally, this not a serious
issue. If the value of this metric is constantly increased, the slave is delaying too much in applying the events.
Treat this metric in the same way as the MySQL Replication Delay metric.
See also:
MySQL Documentation:
• The Slave Relay Log
View all metrics of MySQL Replication
This metric shows the amount of data written hourly into relay log files during the last 24 hours.
View all metrics of MySQL Replication
• Largest Tables
• Pie
• Table Activity
• Rows read
• Rows Changed
• Auto Increment Usage
Largest Tables
Largest Tables by Row Count The estimated number of rows in the table from information_schema.
tables.
Largest Tables by Size The size of the table components from information_schema.tables.
Pie
Total Database Size The total size of the database: as data + index size, so freeble one.
Most Fragmented Tables by Freeable Size The list of 5 most fragmented tables ordered by their freeable size
Table Activity
The next two graphs are available only for Percona Server and MariaDB and require userstat variable turned on.
Rows read
The number of rows read from the table, shown for the top 5 tables.
Rows Changed
The number of rows changed in the table, shown for the top 5 tables.
The current value of an auto_increment column from information_schema, shown for the top 10 tables.
Note: This dashboard requires Percona Server for MySQL 5.1+ or MariaDB 10.1/10.2 with XtraDB. Also
userstat should be enabled, for example with the SET GLOBAL userstat=1 statement. See Configuring
MySQL for Best Results for further instructions.
MongoDB Dashboards
The MongoDB Cluster Summary dashboard shows the statistics on the selected MongoDB cluster. Namely, it reports
the following information:
• Unsharded DBs
• Sharded DBs
• Sharded collections
• Shards
• Chunks
• Balancer enabled
• Chunks balanced
• Mongos operations
• Mongos connections
• Mongos cursors
• Chunk split events
• Change log events
• Operations per shard
• Chunks by shard
• Connections per shard
• Cursors per shard
The MongoDB inMemory dashboard shows statistics on the In-Memory storage engine for the selected MongoDB
instances. This dashboard contains the following metrics:
• InMemory data size
• InMemory max data size
• InMemory available
• InMemory dirty pages
• InMemory transactions
• InMemory capacity
• InMemory sessions
• InMemory pages
• InMemory concurrency tickets
• Queued operations
• Document changes
• InMemory cache eviction
• Scanned and moved objects
• Page faults
The MongoDB MMAPv1 dashboard contains metrics that describe the performance of the MMAPv1 storage engine
for MongoDB. This dashboard includes the following metrics:
• MMAPv1 lock wait ratio
• MMAPv1 write lock time
• Memory cached
• Memory available
• Document activity
• MMAPv1 lock ratios
• MMAPv1 lock wait time
• MMAPv1 page faults
• MMAPv1 journal write activity
• MMAPv1 journal commit activity
• MMAPv1 journaling time
• MMAPv1 journaling time - 99th percentile
• MMAPv1 background flushing time
• Queued operations
• Client operations
• Scanned and moved objects
• MMAPv1 memory usage
• MMAPv1 memory dirty pages
MongoDB Overview
Command Operations
Shows how many times a command is executed per second on average during the selected interval.
Look for peaks and drops and correlate them with other graphs.
View all metrics of MongoDB Overview
Connections
Keep in mind the hard limit on the maximum number of connections set by your distribution.
Anything over 5,000 should be a concern, because the application may not close connections correctly.
View all metrics of MongoDB Overview
Cursors
Helps identify why connections are increasing. Shows active cursors compared to cursors being automatically killed
after 10 minutes due to an application not closing the connection.
View all metrics of MongoDB Overview
Document Operations
When used in combination with Command Operations, this graph can help identify write aplification. For exam-
ple, when one insert or update command actually inserts or updates hundreds, thousands, or even millions of
documents.
View all metrics of MongoDB Overview
Queued Operations
Any number of queued operations for long periods of time is an indication of possible issues. Find the cause and fix it
before requests get stuck in the queue.
View all metrics of MongoDB Overview
This is useful for write-heavy workloads to understand how long it takes to verify writes and how many concurrent
writes are occurring.
View all metrics of MongoDB Overview
Asserts
Asserts are not important by themselves, but you can correlate spikes with other graphs.
View all metrics of MongoDB Overview
Memory Faults
Memory faults indicate that requests are processed from disk either because an index is missing or there is not enough
memory for the data set. Consider increasing memory or sharding out.
View all metrics of MongoDB Overview
MongoDB ReplSet
This dashboard provides information about replica sets and their members.
• Replication Operations
• ReplSet State
• ReplSet Members
• ReplSet Last Election
• ReplSet Lag
• Storage Engine
• Oplog Insert Time
• Oplog Recovery Window
• Replication Lag
• Elections
• Member State Uptime
• Max Heartbeat Time
• Max Member Ping Time
Replication Operations
This metric provides an overview of database replication operations by type and makes it possible to analyze the load
on the replica in more granular manner. These values only appear when the current host has replication enabled.
ReplSet State
This metric shows the role of the selected member instance (PRIMARY or SECONDARY).
View all metrics of MongoDB ReplSet
ReplSet Members
ReplSet Lag
This metric shows the current replication lag for the selected member.
View all metrics of MongoDB ReplSet
Storage Engine
This metric shows how long it takes to write to the oplog. Without it the write will not be successful.
This is more useful in mixed replica sets (where instances run different storage engines).
View all metrics of MongoDB ReplSet
This metric shows the time range in the oplog and the oldest backed up operation.
For example, if you take backups every 24 hours, each one should contain at least 36 hours of backed up operations,
giving you 12 hours of restore window.
View all metrics of MongoDB ReplSet
Replication Lag
This metric shows the delay between an operation occurring on the primary and that same operation getting applied
on the selected member
View all metrics of MongoDB ReplSet
Elections
Elections happen when a primary becomes unavailable. Look at this graph over longer periods (weeks or months) to
determine patterns and correlate elections with other events.
View all metrics of MongoDB ReplSet
This metric shows how long various members were in PRIMARY and SECONDARY roles.
View all metrics of MongoDB ReplSet
This metric shows the heartbeat return times sent by the current member to other members in the replica set.
Long heartbeat times can indicate network issues or that the server is too busy.
View all metrics of MongoDB ReplSet
This metric can show a correlation with the replication lag value.
View all metrics of MongoDB ReplSet
The MongoDB RocksDB daskboard contains metrics that describe the performance of the RocksDB storage engine
for the selected MongoDB host instance. This dashboard contains the following metrics:
• RocksDB Memtable used
• RocksDB block cache used
• Memory cached
• Document activity
• RocksDB cache usage
• RocksDB Memtable entries
• RocksDB block cache hit ratio
• RocksDB write acitivity
• RocksDB read activity
• RocksDB Level0 read latency
• RocksDB LevelN read average latency
• RocksDB LevelN 99th percentile read latency
• RocksDB LevelN maximum read latency
• RocksDB compaction time
• RocksDB compaction write amplification
• RocksDB compaction read rate
• RocksDB compaction write rate
• RocksDB compaction key rate
• RocksDB compaction threads
• RocksDB compaction level files
• RocksDB compaction level size
• RocksDB write ahead log rate
• RocksDB write ahead log sync size
• RocksDB flush rate
• RocksDB pending operations
• RocksDB stall time
• RocksDB stalls
• Client operations
• Queued operations
• Scanned and moved objects
• Page faults
The MongoDB WiredTiger dashboard contains statistics on the WiredTiger storage engine for the selected MongoDB
host. This dashboard contains the following statistics:
• WiredTiger cache usage
• WiredTiger max cache size
• Memory cached
• Memory available
• WiredTiger transactions
• WiredTiger cache activity
• WiredTiger block activity
• WiredTiger sessions
• WiredTiger concurrency tickets available
• Queued operations
• WiredTiger checkpoint time
• WiredTiger cache eviction
• WiredTiger cache capacity
• WiredTiger cache pages
• WiredTiger log operations
• WiredTiger log records
• Document changes
• Scanned and moved objects
• Page faults
PostgreSQL Dashboards
PostgreSQL Overview
• Connected
• Version
• Shared Buffers
• Disk-Page Buffers
• Memory Size for each Sort
• Disk Cache Size
• Autovacuum
• PostgreSQL Connections
• PostgreSQL Tuples
• PostgreSQL Transactions
• Temp Files
• Conflicts and Locks
• Buffers and Blocks Operations
• Canceled Queries
• Cache Hit Ratio
• Checkpoint Stats
• PostgreSQL Settings
• System Summary
Connected
Version
Shared Buffers
Defines the amount of memory the database server uses for shared memory buffers. Default is 128MB. Guidance on
tuning is 25% of RAM, but generally doesn’t exceed 40%.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL Server status variables: shared_buffers https://www.postgresql.org/docs/current/static/
runtime-config-resource.html#GUC-SHARED-BUFFERS
Disk-Page Buffers
The setting wal_buffers defines how much memory is used for caching the write-ahead log entries. Generally this
value is small (3% of shared_buffers value), but it may need to be modified for heavily loaded servers.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL Server status variables: wal_buffers https://www.postgresql.org/docs/current/static/
runtime-config-wal.html#GUC-WAL-BUFFERS
PostgreSQL Server status variables: shared_buffers https://www.postgresql.org/docs/current/static/
runtime-config-resource.html#GUC-SHARED-BUFFERS
The parameter work_mem defines the amount of memory assigned for internal sort operations and hash tables before
writing to temporary disk files. The default is 4MB.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL‘s effective_cache_size variable tunes how much RAM you expect to be available for disk
caching. Generally adding Linux free+cached will give you a good idea. This value is used by the query planner
whether plans will fit in memory, and when defined too low, can lead to some plans rejecting certain indexes.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL Server status variables: effective_cache_size https://www.postgresql.org/docs/current/static/
runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
Autovacuum
Whether autovacuum process is enabled or not. Generally the solution is to vacuum more often, not less.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL Server status variables: autovacuum https://www.postgresql.org/docs/current/static/
routine-vacuuming.html#AUTOVACUUM
PostgreSQL Connections
Max Connections The maximum number of client connections allowed. Change this value with care as there are
some memory resources that are allocated on a per-client basis, so setting max_connections higher will
generally increase overall PostgreSQL memory usage.
Connections The number of connection attempts (successful or not) to the PostgreSQL server.
Active Connections The number of open connections to the PostgreSQL server.
View all metrics of PostgreSQL Overview
See also:
PostgreSQL Server status variables: max_connections https://www.postgresql.org/docs/current/static/
runtime-config-connection.html#GUC-MAX-CONNECTIONS
PostgreSQL Tuples
Tuples The total number of rows processed by PostgreSQL server: fetched, returned, inserted, updated, and deleted.
Read Tuple Activity The number of rows read from the database: as returned so fetched ones.
Tuples Changed per 5min The number of rows changed in the last 5 minutes: inserted, updated, and deleted ones.
View all metrics of PostgreSQL Overview
PostgreSQL Transactions
Transactions The total number of transactions that have been either been committed or rolled back.
Duration of Transactions Maximum duration in seconds any active transaction has been running.
View all metrics of PostgreSQL Overview
Temp Files
Note: All temporary files are taken into account by these two gauges, regardless of why the temporary file was created
(e.g., sorting or hashing), and regardless of the log_temp_files setting.
Conflicts/Deadlocks The number of queries canceled due to conflicts with recovery in the database (due to dropped
tablespaces, lock timeouts, old snapshots, pinned buffers, or deadlocks).
Number of Locks The number of deadlocks detected by PostgreSQL.
View all metrics of PostgreSQL Overview
Operations with Blocks The time spent reading and writing data file blocks by backends, in milliseconds.
Note: Capturing read and write time statistics is possible only if track_io_timing setting is enabled. This can
be done either in configuration file or with the following query executed on the running system:
Canceled Queries
The number of queries that have been canceled due to dropped tablespaces, lock timeouts, old snapshots, pinned
buffers, and deadlocks.
Note: Data shown by this gauge are based on the pg_stat_database_conflicts view.
The number of times disk blocks were found already in the buffer cache, so that a read was not necessary.
Note: This only includes hits in the PostgreSQL buffer cache, not the operating system’s file system cache.
Checkpoint Stats
The total amount of time that has been spent in the portion of checkpoint processing where files are either written or
synchronized to disk, in milliseconds.
View all metrics of PostgreSQL Overview
PostgreSQL Settings
System Summary
This section contains the following system parameters of the PostgreSQL server: CPU Usage, CPU Saturation and
Max Core Usage, Disk I/O Activity, and Network Traffic.
View all metrics of PostgreSQL Overview
See also:
Configuring PostgreSQL for Monitoring Configuring PostgreSQL for Monitoring
PostgreSQL Server status variables: wal_buffers https://www.postgresql.org/docs/current/static/
runtime-config-wal.html#GUC-WAL-BUFFERS
PostgreSQL Server status variables: shared_buffers https://www.postgresql.org/docs/current/static/
runtime-config-resource.html#GUC-SHARED-BUFFERS
PostgreSQL Server status variables: work_mem https://www.postgresql.org/docs/current/static/
runtime-config-resource.html#GUC-WORK-MEM
PostgreSQL Server status variables: effective_cache_size https://www.postgresql.org/docs/current/static/
runtime-config-query.html#GUC-EFFECTIVE-CACHE-SIZE
PostgreSQL Server status variables: autovacuum https://www.postgresql.org/docs/current/static/
routine-vacuuming.html#AUTOVACUUM
PostgreSQL Server status variables: max_connections https://www.postgresql.org/docs/current/static/
runtime-config-connection.html#GUC-MAX-CONNECTIONS
HA Dashboards
Reference
177
CHAPTER
TWELVE
Dashboard Improvements
We updated five Dashboards with improved Tooltips - If you haven’t seen this before, hover your mouse over the i
icon in the top left of most graph elements, and you’ll see a new box appear. This box provides a brief description of
what the graph displays, along with links to related documentation resources so you can learn further. We hope you
find the content useful!
The Dashboards we’re updating are:
1. MySQL Amazon Aurora Metrics
2. MySQL MyISAM/Aria Metrics
3. MySQL Replication
4. Prometheus Exporters Overview
5. Trends
We hope you enjoy this release, and we welcome your feedback via the Percona PMM Forums!
• PMM-3272: Adhere to Amazon naming standards for RDS - should be Amazon RDS
• PMM-2081: Implement Tooltips for Dashboard Prometheus_Exporters_Overview – credits to Corrado Pandiani
for texts
• PMM-1363: Implement Tooltips for Dashboard MySQL_Amazon_Aurora_Metrics – credits to Corrado Pandi-
ani for texts
179
Percona Monitoring and Management Documentation, Release 1.17.0
• PMM-1359: Implement Tooltips for Dashboard Trends_Dashboard – credits to Corrado Pandiani for texts
• PMM-1357: Implement Tooltips for Dashboard MySQL_Replication – credits to Corrado Pandiani for texts
• PMM-1348: Implement Tooltips for Dashboard MySQL_MyISAM/Aria_Metrics – credits to Alexander Rubin
for texts
Fixed Bugs
You’re now able to connect PMM Server to your MySQL and PostgreSQL instances, whether they run in a cloud
DBaaS environment, or you simply want Database metrics without the OS metrics. This can help you get up and
running with PMM using minimal configuration and zero client installation, however be aware there are limitations –
there won’t be any host-level dashboards populated for these nodes since we don’t attempt to connect to the provider’s
API nor are we granted access to the instance in order to deploy an exporter.
How to use
Using the PMM Add Instance screen, you can now add instances from any cloud provider (AWS RDS and Aurora,
Google Cloud SQL for MySQL, Azure Database for MySQL) and benefit from the same dashboards that you are
already accustomed to. You’ll be able to collect Metrics and Queries from MySQL, and Metrics from PostgreSQL.
You can add remote instances by selecting the PMM Add Instance item in a PMM Dropdown group of the system
menu:
where you will then have the opportunity to add a Remote MySQL or Remote PostgreSQL instance:
You’ll add the instance by supplying just the Hostname, database Username and Password (and optional Port and
Name):
Also new as part of this release is the ability to display nodes you’ve added, on screen RDS and Remote Instances:
The Query Analytics dashboard now shows a summary of the selected host and database activity metrics in addition
to the top ten queries listed in a summary table. This brings a view of System Activity (CPU, Disk, and Network) and
Database Server Activity (Connections, Queries per Second, and Threads Running) to help you better pinpoint query
pileups and other bottlenecks:
While PMM provides an excellent solution for system monitoring, sometimes you may have the need for a metric
that’s not present in the list of node_exporter metrics out of the box. There is a simple method to extend the list of
available metrics without modifying the node_exporter code. It is based on the textfile collector. We’ve enabled
this collector as on by default, and is deployed as part of linux:metrics in PMM Client.
The default directory for reading text files with the metrics is /usr/local/percona/pmm-client/
textfile-collector, and the exporter reads files from it with the .prom extension. By default it contains
an example file example.prom which has commented contents and can be used as a template.
You are responsible for running a cronjob or other regular process to generate the metric series data and write it to this
directory.
This example will show you how to collect the number of running and stopped docker containers on a host. It uses a
crontab task, set with the following lines in the cron configuration file (e.g. in /etc/crontab):
˓→prom;
˓→docker_running.prom;
The result of the commands is placed into the docker_all.prom and docker_running.prom files and
read by exporter and will create two new metric series named node_docker_containers_total and
node_docker_containers_running_total, which we’ll then plot on a graph:
Fixed Bugs
• PMM-3038: Error adding MySQL queries when options for mysqld_exporters are used
• PMM-3028: Mark points are hidden if an annotation isn’t added in advance
• PMM-3027: Number of vCPUs for RDS is displayed incorrectly – report and proposal from Janos Ruszo
• PMM-2762: Page refresh makes Search condition lost and shows all queries
• PMM-2483: LVM in the PMM Server AMI is poorly configured/documented – reported by Olivier Mignault
and lot of people involved. Special thanks to Chris Schneider for checking with fix options
• PMM-2003: Delete all info related to external exporters on pmm-admin list output
In 1.15 we are introducing the ability to take a SQL SELECT statement and turn the result set into metric series
in PMM. The queries are executed at the LOW RESOLUTION level, which by default is every 60 seconds. A key
advantage is that you can extend PMM to profile metrics unique to your environment (see users table example), or
to introduce support for a table that isn’t part of PMM yet. This feature is on by default and only requires that
you edit the configuration file and use vaild YAML syntax. The configuration file is in /usr/local/percona/
pmm-client/queries-mysqld.yml.
We’re going to take a fictional MySQL users table that also tracks the number of upvotes and downvotes, and we’ll
convert this into two metric series, with a set of seven labels, where each label can also store a value.
Lets look at the output so we understand the goal - take data from a MySQL table and store in PMM, then display as
a metric series. Using the Advanced Data Exploration Dashboard you can review your metric series. Exploring the
metric series app1_users_metrics_downvotes we see the following:
MySQL table
Lets assume you have the following users table that includes true/false, string, and integer types.
SELECT * FROM `users`
+----+------+--------------+-----------+------------+-----------+---------------------
˓→+--------+---------+-----------+
+----+------+--------------+-----------+------------+-----------+---------------------
˓→+--------+---------+-----------+
We’ll go through a simple example and mention what’s required for each line. The metric series is constructed
based on the first line and appends the column name to form metric series. Therefore the number of metric se-
ries per table will be the count of columns that are of type GAUGE or COUNTER. This metric series will be called
app1_users_metrics_downvotes:
app1_users_metrics: ## leading section of your metric
˓→series.
Each column in the SELECT is named in this example, but that isn’t required, you can use a SELECT * as well.
Notice the format of schema.table for the query is included.
---
app1_users_metrics:
query: "SELECT app,first_name,last_name,logged_in,active_subscription,banned,
˓→upvotes,downvotes FROM app1.users"
metrics:
- app:
usage: "LABEL"
description: "Name of the Application"
- user_type:
usage: "LABEL"
description: "User's privilege level within the Application"
- first_name:
usage: "LABEL"
description: "User's First Name"
- last_name:
usage: "LABEL"
description: "User's Last Name"
- logged_in:
usage: "LABEL"
description: "User's logged in or out status"
- active_subscription:
usage: "LABEL"
description: "Whether User has an active subscription or not"
- banned:
usage: "LABEL"
description: "Whether user is banned or not"
- upvotes:
usage: "COUNTER"
description: "Count of upvotes the User has earned. Upvotes once granted
˓→cannot be revoked, so the number can only increase."
- downvotes:
usage: "GAUGE"
description: "Count of downvotes the User has earned. Downvotes can be
˓→revoked so the number can increase as well as decrease."
...
We hope you enjoy this feature, and we welcome your feedback via the Percona forums!
We’ve enhanced the volume of data collected from both the Server and Client perspectives. Each service provides a
set of files designed to be shared with Percona Support while you work on an issue.
Server
• Prometheus targets
• Consul nodes, QAN API instances
• Amazon RDS and Aurora instances
• Version
• Server configuration
• Percona Toolkit commands
You retrieve the link from your PMM server using this format:
https://pmmdemo.percona.com/managed/logs.zip
Client
On the Client side we’ve added a new action called summary which fetches logs, network, and Percona Toolkit output
in order to share with Percona Support. To initiate a Client side collection, execute:
pmm-admin summary
The output will be a file you can use to attach to your Support ticket. The single file will look something like this:
summary__2018_10_10_16_20_00.tar.gz
• PMM-2913: Provide ability to execute Custom Queries against MySQL - Credit to wrouesnel for the framework
of this feature in wrouesnel/postgres_exporter!
• PMM-2904: Improve PMM Server Diagnostics for Support
• PMM-2860: Improve pmm-client Diagnostics for Support
• PMM-1754: Provide functionality to easily select query and copy it to clipboard in QAN
• PMM-1855: Add swap to AMI
• PMM-3013: Rename PXC Overview graph Sequence numbers of transactions to IST Progress
• PMM-2726: Abort data collection in Exporters based on Prometheus Timeout - MySQLd Exporter
• PMM-3003: PostgreSQL Overview Dashboard Tooltip fixes
• PMM-2936: Some improvements for Query Analytics Settings screen
• PMM-3029: PostgreSQL Dashboard Improvements
Fixed Bugs
• PMM-2976: Upgrading to PMM 1.14.x fails if dashboards from Grafana 4.x are present on an installation
• PMM-2969: rds_exporter becomes throttled by CloudWatch API
• PMM-1443: The credentials for a secured server are exposed without explicit request
• PMM-3006: Monitoring over 1000 instances is displayed imperfectly on the label
• PMM-3011: PMM’s default MongoDB DSN is localhost, which is not resolved to IPv4 on modern systems
A folder or dashboard in the general folder with the same name already exists
• PMM-2958 - Grafana did not update to 5.1 when upgrading from versions older than 1.11
– We identified a niche case where PMM installations that were upgraded from < 1.11 would fail to upgrade
Grafana to correct release 5.1 (Users were left on Grafana 5.0)
The PMM team is very proud to bring you native support for PostgreSQL! We’ve shipped a new dashboard called
PostgreSQL Overview, and we now provide the ability to add PostgreSQL instances as native, first-class citizens as
part of PMM. This means you can add PostgreSQL + Linux monitoring capabilities through the standard pmm-admin
add postgresql syntax, see our documentation links for more details!
A long-awaited feature is the ability to visually identify new queries that have appeared in Query Analytics - those
queries who’s first seen time is within the selected time range. New queries will be highlighted in a soft blue band for
quick identification, and we’ve provided a button called First Seen which you can toggle to display only those newly
seen queries. A common use case for this feature is potentially during code release / deployments, where you want to
review which new queries have been deployed and to review their performance characteristics.
We’ve introduced a new dashboard to let you compare System Parameters across multiple servers so at a glance you
can understand provisioning or configuration differences. This might be of help when comparing a pool of identical
slaves or other logical groups of instances.
We’ve added a new dashboard that lets you drill down into great detail on one or several PERFORMANCE_SCHEMA
wait event categories in order to visualize them over time.
At long last we’ve addressed the sprawl of the long list of 30+ Dashboards, and grouped them into categories which
match the pre-existing right-side navigation system. This should leave you with a more organized, less cluttered list
of Dashboards.
Lastly, we’ve delivered on a feature request from a Percona Customer to optionally disable SSL between PMM Server
and Exporters, with the advantage that if you do not need encrypted traffic for your metric series, you can reduce the
CPU overhead on PMM Server. We’d love to hear your feedback on this feature!
• PMM-1362: Update descriptions on MySQL InnoDB Metrics (Advanced) Dashboard - thanks to Yves Trudeau
• PMM-2304: New Dashboard: Compare System Parameters
• PMM-2331: Advanced Data Exploration: add graph for showing exporter scrapers over time intervals
Fixed Bugs
Prometheus 2
The long awaited Prometheus 2 release is here! By upgrading to PMM release 1.13, Percona’s internal testing has
shown you will achieve a 3x-10x reduction in CPU usage, which translates into PMM Server being able to handle
more instances than you could in 1.12. You won’t see any gaps in graphs since internally PMM Server will run two
instances of Prometheus and leverage remote_read in order to provide consistent graphs!
Our Engineering teams have worked very hard to make this upgrade as transparent as possible - hats off to them for
their efforts!!
Lastly on Prometheus 2, we also included a new set of graphs to the Prometheus Dashboard to help you better under-
stand when your PMM Server may run out of space. We hope you find this useful!
We’re introducing a new dashboard that focuses on all things Networking - we placed a Last Hour panel highlighting
high-level network metrics, and then drill into Network Traffic + Details, then focus on TCP, UDP, and ICMP behavior.
Of most interest to current Percona Customers, we’ve clarified the instructions on how to take a snapshot of a Dash-
board in order to highlight that you are securely sharing with Percona. We’ve also configured the sharing timeout to
30 seconds (up from 4 seconds) so that we more reliably share useful data to Percona Support Engineers, as shorter
timeout led to incomplete graphs being shared.
Packed into this feature is also a change to how we report installed version, latest version, and what’s new information:
Lastly, we modified the behavior of the docker environment option DISABLE_UPDATES to remove the Update
button. As a reminder, you can choose to disable update reporting for environments where you want tighter control
over (i.e. lock down) who can initiate an update by launching the PMM docker container along with the environment
variable as follows:
System Overview Dashboard Improvements We’ve updated our System Overview Dashboard to focus on the four
criteria of CPU, Memory, Disk, and Network, while also presenting a single panel row of high level information
(uptime, count of CPUs, load average, etc)
Our last feature we’re introducing in 1.13 is a fix to SingleStat panels where the percentage value is reflected in the
level of the trend line in the background. For example, if you have a stat panel at 20% and 86%, the line in the
background should fill the respective amount of the box:Improved SingleStat for percentages.
Bug fixes
• PMM-1977: after upgrade pmm-client (1.6.1-1) can’t start mysql:metrics - can’t find .my.cnf
• PMM-2379: Invert colours for Memory Available graph
• PMM-2413: Charts on MySQL InnoDB metrics are not fully displayed
• PMM-2427: Information loss in CPU Graph with Grafana 5 upgrade
• PMM-2476: AWS PMM is broken on C5/M5 instances
• PMM-2576: Error in logs for MySQL 8 instance on CentOS
• PMM-2612: Wrong information in PMM Scrapes Task
• PMM-2639: mysql:metrics does not work on Ubuntu 18.04
• PMM-2643: Socket detection and MySQL 8
• PMM-2698: Misleading Graphs for Rare Events
• PMM-2701: MySQL 8 - Innodb Checkpoint Age
• PMM-2722: Memory auto-configuration for Prometheus evaluates to minimum of 128MB in entrypoint.sh
We’re working on substantial changes to Query Analytics and the first part to roll out is something that users of
Percona Toolkit may recognize – we’ve introduced a new element called Visual Explain based on pt-visual-explain.
This functionality transforms MySQL EXPLAIN output into a left-deep tree representation of a query plan, in order to
mimic how the plan is represented inside MySQL. This is of primary benefit when investigating tables that are joined
in some logical way so that you can understand in what order the loops are executed by the MySQL query optimizer.
In this example we are demonstrating the output of a single table lookup vs two table join:
A great feature of MySQL’s InnoDB storage engine includes compression of data that is transparently handled by the
database, saving you space on disk, while reducing the amount of I/O to disk as fewer disk blocks are required to
store the same amount of data, thus allowing you to reduce your storage costs. We’ve deployed a new dashboard that
helps you understand the most important characteristics of InnoDB’s Compression. Here’s a sample of visualizing
Compression and Decompression attempts, alongside the overall Compression Success Ratio graph:
We have introduced a new dashboard that lets you do side-by-side comparison of Command (Com_*) and Handler
statistics. A common use case would be to compare servers that share a similar workload, for example across MySQL
instances in a pool of replicated slaves. In this example I am comparing two servers under identical sysbench load, but
exhibiting slightly different performance characteristics:
The number of servers you can select for comparison is unbounded, but depending on the screen resolution you might
want to limit to 3 at a time for a 1080 screen size.
Bug fixes
Known Issues
We spent some time this release going over how we handle MySQL’s Slow Log rotation logic. Query Analytics
requires that slow logging be enabled (either to file, or to PERFORMANCE_SCHEMA) and what we found was
that Users of Percona Server for MySQL overwhelmingly choose logging to a file in order to take advantage of
log_slow_verbosity which provides enhanced InnoDB Usage information. The challenge however with MySQL’s
Slow Log is that it is very verbose and thus the number one concern is disk space - PMM strives to Do No Harm and
so doing MySQL Slow Log Rotation was a natural fit, but until this release we were very strict and hadn’t enabled any
configuration of these parameters.
Percona Server for MySQL Users have long known about Slow Query Log Rotation and Expiration, but until now had
no way of using the in-built Percona Server feature while ensuring that PMM wasn’t missing any queries from the
Slow Log during file rotation. Or perhaps your use case is that you want to do Slow Log Rotation using logrotate or
some other facility. Today with Release 1.11 this is now possible!
We have made two significant changes:
• You can now specify the number of Slow Log files to remain on disk, and let PMM handle deleting the oldest
files first. Default remains unchanged - 1 Slow Log to remain on disk.
• Slow Log rotation can now be disabled, for example if you want to manage rotation using logrotate or Per-
cona Server for MySQL Slow Query Log Rotation and Expiration. Default remains unchanged - Slow Log
Rotation is ON.
You specify each of these two new controls when setting up the MySQL service. The following example specifies that
5 Slow Log files should remain on disk:
While the following example specifies that Slow Log rotation is to be disabled (flag value of false), with the assumption
that you will perform your own Slow Log Rotation:
We do not currently support modifying option parameters for an existing service definition. This means you must
remove, then re-add the service and including the new options.
We are including a logrotate script in this post to get you started, and it is designed to keep 30 copies of Slow Logs at
1GB each. Note that you will need to update the Slow Log location, and ensure a MySQL User Account with SUPER,
RELOAD are used for this script to successfully execute.
Example logrotate
/var/mysql/mysql-slow.log {
nocompress
create 660 mysql mysql
size 1G
dateext
missingok
notifempty
sharedscripts
postrotate
/bin/mysql -e 'SELECT @@global.long_query_time INTO @LQT_SAVE; SET
˓→GLOBAL long_query_time=2000; SELECT SLEEP(2); FLUSH SLOW LOGS; SELECT SLEEP(2); SET
˓→GLOBAL long_query_time=@LQT_SAVE;'
endscript
rotate 30
}
Predictable Graphs
We’ve updated the logic on 4 Dashboards to better handle predictability and also zooming to look at shorter time
ranges. For example, refreshing PXC/Galera Graphs prior to 1.11 led to graphs spiking at different points during
the metric series. We’ve reviewed each of these Graphs and their corresponding queries and added in <aggrega-
tion>_over_time() functions so that Graphs display a consistent view of the metric series. This also improves your
ability to drill in on the Dashboards, so that no matter how short your time range, you will still observe the same spikes
and troughs in your metric series. The four Dashboards affected by this improvement are:
• Home Dashboard
• PXC/Galera Graphs Dashboard
• MySQL Overview Dashboard
• MySQL InnoDB Metrics Dashboard
• MySQL Exporter Parsing of my.cnf
In earlier releases, the MySQL Exporter expected only key=value type flags and would ignore options without values
(i.e. disable-auto-rehash), and could sometimes read the wrong section of the my.cnf file. We’ve updated the parsing
engine to be more MySQL compatible.
Annotation Improvements
Annotations permit the display of an event on all dashboards in PMM. Users reported that passing more than one string
to pmm-admin annotate would generate an error, so we updated the parsing logic to assume all strings passed during
Annotation creation generates a single Annotation event. Previously you needed to enclose your strings in quotes so
that it would be parsed as a single string.
Bug fixes
Annotations
Application events are one of the contributors to changes in database performance characteristics, and in this re-
lease PMM now supports receiving events and displaying them as Annotations using the new command pmm-admin
annotate. A recent Percona survey reveals that database and DevOps engineers highly value visibility into the ap-
plication layer. By displaying application events on top of your PMM graphs, engineers can now correlate application
events to database events (common cases: application deploys, outages, and upgrades) against Database and System
level metric changes.
Usage
For example, you have an application deployment that just completed to version 1.2, and it affects the UI only, so you
want to set tags for the version and interface impacted:
Using the optional --tags option allows you to filter which Annotations are displayed on the dashboard via a toggle
option. Read more about Annotations utilization in the PMM documentation.
Grafana 5.0
We’re extremely pleased to see Grafana ship 5.0 and we were fortunate enough to be at Grafanacon, including Per-
cona‘s very own @Dimitri Vanoverbeke (Dim0) who presented What we Learned Integrating Grafana and Prometheus!
Included in Grafana 5.0 are a number of dramatic improvements, which in future PMM releases we plan to extend
our usage of each feature, and the one we like best is the virtually unlimited way you can size and shape graphs. No
longer are you bound by panel constraints to keep all objects at the same fixed height! This improvement indirectly
addresses the visualization error in PMM Server where some graphs would appear to be on two lines and ended up
wasting screen space.
PMM now allows you to navigate between dashboards while maintaining the same host under observation, so that for
example you can start on MySQL Overview looking at host serverA, switch to MySQL InnoDB Advanced dashboard
and continue looking at serverA, thus saving you a few clicks in the interface.
We have added new PXC Replication Latency graphs on our PXC Galera Cluster Overview dashboard so that you can
compare latency across all members in a cluster in one view.
• PMM-2293: Add the Galera Replication Latency graph to the PXC/Galera Cluster overview dashboard.
• PMM-2295: Improve colour selection on the PXC/Galera Cluster Overview dashboard
• PMM-2330: Application Annotations
• PMM-2332: Grafana 5 update
Bug fixes
• PMM-2359: Trim leading and trailing whitespaces for all fields on AWS/OVF Installation wizard
• PMM-2360: Include a “What’s new?” link for Update widget
• PMM-2346: Arithmetic on InnoDB AHI Graphs are invalid
• PMM-2364: QPS are wrong in QAN
• PMM-2388: Query Analytics does not render fingerprint section in some cases
• PMM-2371: Pass host when switching between Dashboards
See also:
How to get PMM
Deploying Percona Monitoring and Management
The corrected version of QAN in PMM 1.9.1 shows that queries are now counted per second. The total number of
queries is 60 * 60 greater than the value of QPS, as should be expected for the chosen time range.
Query Analytics in PMM version 1.9.1.
Bug fixes
AWS Improvements
Since we are already consuming Amazon Cloudwatch metrics and persisting them in Prometheus, we have improved
6 node-specific dashboards to now display Amazon RDS node-level metrics:
• Cross_Server (Network Traffic)
We have changed our AWS add instance interface and workflow to be more clear on information needed to add an
Amazon Aurora MySQL or Amazon RDS MySQL instance. We have provided some clarity on how to locate your
AWS credentials.
AWS Settings
We have improved our documentation to highlight connectivity best practices, and authentication options - IAM Role
or IAM User Access Key.
Credentials Screen
You can now run PMM Server on instances with memory as low as 512MB RAM, which means you can deploy to the
free tier of many cloud providers if you want to experiment with PMM. Our memory calculation is now:
Snapshots are a way of sharing PMM dashboards via a link to individuals who do not normally have access to your
PMM Server. If you are a Percona Customer you can now securely share your dashboards with Percona Engineers. We
have replaced the button for sharing to the Grafana publicly hosted platform onto one administered by Percona. Your
dashboard will be written to Percona snapshots and only Percona Engineers will be able to retrieve the data. We will
be expiring old snapshots automatically at 90 days, but when sharing you will have the option to configure a shorter
retention period.
In this release, the logs from PMM Server can be exported using single button-click, avoiding the need to log in
manually to the docker container. This simplifies the troubleshooting process of a PMM Server, and especially for
Percona Customers, this feature will provide a more consistent data gathering task that you will perform on behalf of
requests from Percona Engineers.
In version 1.8.0, the index page was redesigned to reveal more useful information about the performance of your
hosts as well an immediate access to essential components of PMM, however the index page had to load much data
dynamically resulting in a noticeably longer load time. In this release we enabled gzip and HTTP2 to improve the
load time of the index page. The following screenshots demonstrate the results of our tests on webpagetest.org where
we reduce page load time by half. We will continue to look for opportunities to improve the performance of the index
page and expect that when we upgrade to Prometheus 2 we will see another improvement.
New Features
• PMM-781: Plot new PXC 5.7.17, 5.7.18 status variables on new graphs for PXC Galera, PXC Overview dash-
boards
• PMM-1274: Export PMM Server logs as zip file to the browser
Improvements
• PMM-1587: Use mongodb_up variable for the MongoDB Overview dashboard to identify if a host is Mon-
goDB.
• PMM-1788: AWS Credentials form changes
• PMM-1823: AWS Install wizard improvements
• PMM-2010: System dashboards update to be compatible with RDS nodes
• PMM-2118: Update grafana config for metric series that will not go above 1.0
• PMM-2215: PMM Web speed improvements
• PMM-2216: PMM can now be started on systems without memory limit capabilities in the kernel
• PMM-2217: PMM Server can now run in Docker with 512 Mb memory
• PMM-2252: Better handling of variables in the navigation menu
Bug fixes
This release contains bug fixes only and supersedes Percona Monitoring and Management 1.8.0.
Improvements
• PMM-2051: The ProxySQL Overview dashboard enables selecting more than one host group in the Hostgroup
field.
• PMM-2163: Dashboards based on the rds_exporter now use the node_cpu_average metric instead of node_cpu
Bug fixes
The home page has been removed in favor of the Home dashboard to make the look and feel of PMM web interface
more consistent. The Home dashboard gives a general overview of your system and provides links to useful resources.
You can immediately go to a dashboard of your choice either by using the conventional Dashboard Dropdown at the
top of the page or the new dashboard menu.
The new dashboard menu provides a convenient grouping of dashboards making the switching between dashboards
easy: select a group, such as MySQL or OS, and choose from a short list in the menu that opens. The new dashboard
menu is available from every dashboard in PMM.
This release also features improved memory usage on the host system in PMM Server. By default, PMM now au-
tomatically scales its use with system size rather than using static amount of memory, unless you explicitly set the
maximum value (by using the METRICS_MEMORY in Docker, for example).
New Features
• PMM-1145: Move Percona dashboards to Grafana plugin. We have updated the Percona dashboards to use the
Grafana plugin system in order to simplify upgrades.
• PMM-1470: Implement a custom Prometheus rds_exporter to collect Amazon Cloudwatch metrics. You can
now explore Amazon Cloudwatch metrics from Prometheus, for example using the Advanced Data Exploration
dashboard. In prior versions we were using Amazon Cloudwatch API calls directly.
• PMM-2046: Configure memory consumption automatically for PMM Server. In this release we improved
memory usage in PMM Server. By default, PMM now automatically scales its use with system size rather than
using a static amount of memory. You can override this behaviour (for example, if you need to share resources
with other containers) by using the METRICS_MEMORY option in Docker. You can use the old static size of
memory by running:
Improvements
• PMM-1425: Replace the Home page with the Home dashboard. The home page has been removed in favor of
the Home dashboard to make the look and feel of PMM web interface more consistent. The Home dashboard
gives a general overview of your system and provides links to useful resources. You can immediately go to a
dashboard of your choice either by using the conventional Dashboard Dropdown at the top of the page or the
new dashboard menu.
• PMM-1738: Add the Dashboard menu to make the discovery of dashboards easier.
• PMM-1976: Apply consistent rules for computing CPU metrics. We updated the query that generates CPU
utilization for the MySQL Overview, Summary and System Overview dashboards as before we were being in-
consistent in our determination of CPU.
• PMM-2007: Squash new Docker layers for a smaller total size We reduced the size of the Docker container
from ~475 MB to ~350 MB
• PMM-1711: Add SQL and External Locks graphs to the MySQL Performance Schema dashboard. Added new
graph to the MySQL Performance Schema dashboard to show locks from perspective of count of events and
from time.
• PMM-1763: Update the forked Prometheus exporter mysqld_exporter to the latest upstream version to include
recent bug fixes.
• PMM-2004: Add the /ping alias to nginx to enable a basic health check URL to the PMM Server API.
• PMM-1365: Provide descriptions of all metrics in the Cross Server Graphs dashboard. We have added met-
ric descriptions in order to improve the understanding of the displayed metric series and to provide links to
documentation and blog articles, beginning with the Cross Server Graphs.
Bug fixes
• PMM-2124: The number of the new version is missing in the notification of the successful update of PMM
• PMM-1453: mysqld_exporter wrong mapping of innodb_buffer_pool_pages
• PMM-2029: Deadlock when adding external exporter
• PMM-1908: RDS MySQL nodes do not display Current QPS
• PMM-2100: rds_exporter crashed after running for several minutes
• PMM-1511: PXC cluster is not recognized correctly when MariaDB nodes are monitored
• PMM-1715: MongoDB QAN: Wrong Per Query Stats
• PMM-1892: Cannot detect tables in the Information Schema query
• PMM-1893: In QAN, the Tables element can be empty
• PMM-1941: Fingerprint storage bug
New Features
Improvements
• PMM-1712: Improve external exporters to let you easily add data monitoring from an arbitrary Prometheus
exporter you have running on your host.
• PMM-1510: Rename swap in and swap out labels to be more specific and help clearly see the direction of data
flow for Swap In and Swap Out. The new labels are Swap In (Reads) and Swap Out (Writes) accordingly.
• PMM-1966: Remove Grafana from list of exporters on dashboard to eliminate confusion with existing Grafana
in the list of exporters on the current version of the dashboard.
• PMM-1974: Add the mongodb_up in the Exporter Status dashboard. The new graph is added to maintain
consistency of information about exporters. This is done based on new metrics implemented in PMM-1586.
Bug fixes
Bug fixes
• PMM-1660: QAN for MongoDB would not display data when authentication was enabled.
• PMM-1822: In Metrics Monitor, some tag names were incorrect in dashboards.
• PMM-1832: After upgrading to 1.5.2, it was not possible to disable an RDS instance on the Add RDS instance
dashboard of Metrics Monitor.
• PMM-1907: In Metrics Monitor, the tooltip of the Engine Uptime metric referred to an incorrect unit of measure.
• PMM-1964: The same value of the Exporter Uptime metric could appear in different colors in different contexts.
• PMM-1965: In the Prometheus Exporters Overview dashboard of Metrics Monitor, the drill down links of some
metrics could direct to a wrong host.
New Features
• PMM-1773: PMM Grafana specific metrics have been added to the Advanced Data Exploration dashboard.
Improvements
• PMM-1485: Updated MyRocks integration: MyRocks data is now collected entirely from SHOW GLOBAL
STATUS and we have eliminated SHOW ENGINE ROCKSDB STATUS as a data source in mysqld_exporter.
• PMM-1895: Update Grafana to version 4.6.3:
– Alert list: Now shows alert state changes even after adding manual annotations on dashboard #9951
– Alerting: Fixes bug where rules evaluated as firing when all conditions was false and using OR operator.
#9318
• PMM-1586: The mongodb_exporter exporter exposes two new metrics: mongodb_up informing if the Mon-
goDB server is running and mongodb_scrape_errors_total informing the total number of times an error oc-
curred when scraping MongoDB.
• PMM-1764: Various small mongodb_exporter improvements
• PMM-1942: Improved the consistency of using labels in all Prometheus related dashboards.
• PMM-1936: Updated the Prometheus dashboard in Metrics Monitor
• PMM-1937: Added the CPU Utilization Details (Cores) dashboard to Metrics Monitor.
• PMM-1887: Improved the help text for pmm-admin to provide more information about exporter options.
• PMM-1939: In Metrics Monitor, two new dashboards have been added to provide more information about
Prometheus exporters. The Prometheus Exporters Overview dashboard provides a summary of how ex-
porters utilize system resources and the Prometheus Exporter Status dashboard tracks the performance of each
Prometheus exporter.
Bug fixes
Improvements
• PMM-1874: The read timeout of the proxy server (/prometheus) has been increased from the default of 60
seconds to avoid nxginx gateway timeout error when loading data rich dashboards.
• PMM-1863: We improved our handling of temporary Grafana credentials
Bug fixes
• PMM-1828: On CentOS 6.9, pmm-admin list incorrectly reported that no monitoring services were run-
ning.
• PMM-1842: It was not possible to restart the mysql:queries monitoring service after PMM Client was
upgraded from version 1.0.4.
• PMM-1797: It was not possible to update the CloudWatch data source credentials.
• PMM-1829: When the user clicked a link in the Query Abstract column, an outdated version of QAN would
open.
• PMM-1836: PMM Server installed in a Docker container could not be started if the updating procedure had
been temporarily interrupted.
• PMM-1871: In some cases, RDS instances could not be discovered.
• PMM-1845: Converted FLUSH SLOW LOGS to FLUSH NO_WRITE_TO_BINLOG SLOW LOGS so that
GTID event isn’t created
• PMM-1816: Fixed a rendering error in Firefox.
Bug fixes
• PMM-1790: QAN would display query metrics even for a host that was not configured for mysql:queries
or mongodb:queries. We have fixed the behaviour to display an appropriate warning message when there
are no query metrics for the selected host.
• PMM-1826: If PMM Server 1.5.0 is deployed via Docker, the Update button would not upgrade the instance to
a later release.
• PMM-1830: If PMM Server 1.5.0 is deployed via AMI instance, the Update button would not upgrade the
instance to a later release.
Bug fixes
• PMM-1771: When upgrading PMM to 1.5.0 using Docker commands, PMM System Summary, PMM Add
Instance, PMM Query Analytics dashboards were not available.
• PMM-1761: The PMM Query Analytics dashboard did not display the list of hosts correctly.
• PMM-1769: It was possible to add an Amazon RDS instance providing invalid credentials on the PMM Add
Instance dashboard.
Other bug fixes: PMM-1767, PMM-1762
QAN is now integrated into Metrics Monitor and appears as a separate dashboard known as PMM.
With this release, Percona Monitoring and Management introduces a new deployment option via AWS Marketplace.
This is in addition to our distribution method of Amazon Machine Images (AMI).
In this release, Grafana and Prometheus have been upgraded. PMM now includes Grafana 4.6.1. One of the most
prominent features that the upgraded Grafana offers is the support of annotations. You can mark a point or select a
region in a graph and give it a meaningful description. For more information, see the release highlights.
Prometheus version 1.8.2, shipped with this release, offers a number of bug fixes. For more information, see the
Prometheus change log.
New features
• PMM-434: PMM enables monitoring of Amazon RDS and Amazon Aurora metrics
• PMM-1133: PMM Query Analytics is available from Grafana as a dashboard
• PMM-1470: Cloudwatch metrics have been integrated into Prometheus
• PMM-699: AWS RDS and Amazon Aurora metrics were combined into one dashboard
• PMM-722: The MariaDB dashboard graph elements were distributed among other existing dashboards and
MariaDB dashboard was removed; further the MyISAM dashboard was renamed to MyISAM/Aria Metrics
• PMM-1258: The DISABLE_UPDATES option enables preventing manual updates when PMM Server is run
from a Docker container.
• PMM-1500: Added InnoDB Buffer Disk Reads to graph InnoDB Buffer Pool Requests to better understand
missed InnoDB BP cache hits
Improvements
Bug fixes
• PMM-1082: The CPU Usage graph on the Trends dashboard showed incorrect spikes
• PMM-1549: The authentication of the mongodb:queries monitoring service did not work properly when the
name of the database to authenticate was not provided.
• PMM-1673: Fixed display issue with Microsoft Internet Explorer 11
Improvements
• PMM-1567: The btrfs file system has been replaced with XFS in AMI and OVF images to meet the requirements
of AWS Marketplace.
• PMM-1594: In Metrics Monitor, the Prometheus dashboard has been updated to show more information about
the running Prometheus jobs and help estimate their efficiency.
Bug fixes
• PMM-1620: In some cases, PMM could not be upgraded to version 1.4.0 by using the Update button on the
landing page.
• PMM-1633: QAN would show error List of Tables is Empty for instances having been upgraded from earlier
releases of PMM, due to incorrect values being stored in the database. This has been addressed to identify the
incorrect values and replace with accurate schema and table information.
• PMM-1634: The Advanced Data Exploration dashboard did not always display data points from
external:metrics monitoring services due to a too restrictive Grafana Template filter.
• PMM-1636: Special characters prevented the removal of external:metrics services using the
pmm-admin remove command.
Listing 12.1: Example of JSON output of the pmm-admin list --json command. It also contains an external
monitoring service in the value of the ExternalServices element.
{"Version":"1.4.0",
"ServerAddress":"127.0.0.1:80",
"ServerSecurity":"",
"ClientName":"percona",
"ClientAddress":"172.17.0.1",
"ClientBindAddress":"",
"Platform":"linux-systemd",
"Err":"",
"Services":[{"Type":"linux:metrics","Name":"percona","Port":"42000","Running":true,
˓→"DSN":"-","Options":"","SSL":"","Password":""}],
"ExternalErr":"",
"ExternalServices":[{"JobName":"postgres","ScrapeInterval":1000000000,"ScrapeTimeout
˓→":1000000000,"MetricsPath":"/metrics","Scheme":"http","StaticTargets":["127.0.0.
˓→1:5432"]}]}
The list of attached monitoring services is now available not only in the tabular format but also as a JSON file to
enable automatic verification of your configuration. To view the list of monitoring services in the JSON format run
• Query inspector which provides detailed information about the query. The primary goal of graph inspector
is to enable analyzing a graph which does not display data as expected.
The complete list of new features in Grafana 4.5.0 is available from What’s New in Grafana v4.5.
For install and upgrade instructions, see Deploying Percona Monitoring and Management.
New features
Bug fixes
• PMM-1172: In some cases, the TABLES section of a query in QAN could contain no data and display the List of
tables is empty error. The Query and Explain sections had the relevant values.
• PMM-1519: A Prometheus instance could be forced to shut down if it contained too many targets (more than
50). When started the next time, Prometheus initiated a time consuming crash recovery routine which took long
on large installations.
Percona announces the release of Percona Monitoring and Management 1.3.2. This release only contains bug fixes
related to usability.
For install and upgrade instructions, see Deploying Percona Monitoring and Management.
Bug fixes
• PMM-1529: When the user selected “Today”, “This week”, “This month”, or “This year” range in Metrics
Monitor and clicked the Query Analytics button, the QAN page opened reporting no data for the selected range
even if the data were available.
• PMM-1528: In some cases, the page not found error could appear instead of the QAN page after upgrading by
using the Upgrade button.
• PMM-1498: In some cases, it was not possible to shutdown the virtual machine containing the PMM Server
imported as an OVA image.
Other bug fixes in this release: PMM-913, PMM-1215, PMM-1481, PMM-1483, PMM-1507
Bug fixes
• PMM-1271: In QAN, when the user selected a database host with no queries, the query monitor could still show
metrics.
• PMM-1512: When reached from Grafana, QAN would open its home page. Now, QAN opens and automati-
cally selects the database host and time range active in Grafana.
• PMM-1523: User defined Prometheus memory settings were not honored, potentially causing performance
issues in high load environments.
Other bug fixes in this release: PMM-1452, PMM-1515.
New Features
• PMM-1290: Basic support for the metrics of the MyRocks storage engine in MySQL via the mysqld-exporter.
• PMM-1312: Metrics Monitor now features a MyRocks dashboard.
• PMM-1330: Basic telemetry data are collected from PMM Servers.
• PMM-1417: A new dashboard titled Advanced Data Exploration Dashboard in Metrics Monitor enables ex-
ploring any data in Prometheus
• PMM-1437: pmm-admin allows passing parameters to exporters.
• PMM-685: The EXPLAIN command is now supported for MongoDB queries in QAN.
Improvements
Bug fixes
• PMM-1298: In QAN, the query abstract could be empty for MySQL hosts for low ranking queries. This bug is
fixed to contain Low Ranking Queries as the value of the query abstract.
• PMM-1314: The selected time range in QAN could be applied incorrectly. This problem is not observed in the
new design of QAN.
• PMM-1398: The Prometheus server was not restarted after PMM was upgraded. This bug is now fixed.
• PMM-1427: The CPU Usage/Load graph in the MySQL Overview dashboard was displayed with slightly incor-
rect dimensions. This bug is now solved.
• PMM-1439: If the EXPLAIN command was not supported for the selected query, there could appear a
JavaScript error.
• PMM-1472: In some cases, the monitoring of queries for MongoDB with replication could not be enabled.
• PMM-943: InnoDB AHI Usage Graph had incorrect naming and hit ratio computation.
Other bug fixes in this release: PMM-1479
Bug fixes
• PMM-927: The error “Cannot read property ‘hasOwnProperty’ of undefined” was displayed on the QAN page
for mongodb.
After enabling monitoring and generating data for mongodb, the PMM client showed the following error mes-
sage on the QAN page: “Cannot read property ‘hasOwnProperty’ of undefined”. This bug is now fixed.
• PMM-949: Percona Server was not detected properly, the log_slow_* variables were not properly detected.
• PMM-1081: Performance Schema Monitor treated queries that didn’t show up in every snapshot as new queries
reporting a wrong number of counts between snapshots.
• PMM-1272: mongodb‘: the query empty abstract. This bug is now fixed.
• PMM-1277: The QPS Graph had inappropriate prometheus query. This bug is now fixed.
• PMM-1279: The MongoDB summary did not work in QAN2 if mongodb authentication was activated. This
bug is now fixed.
• PMM-1284: Dashboards pointed to QAN2 instead of QAN. This bug is now fixed.
Improvements
For install and upgrade instructions, see Deploying Percona Monitoring and Management.
This hotfix release improves memory consumption
Bug fixes
Improvements
Updated Components
• Consul 0.8.5
• Grafana 4.3.2
• Orchestrator 2.1.5
• Prometheus 1.7.1
New Features
UI Fixes
• PMM-707: Fixed QPS metric in MySQL Overview dashboard to always show queries per second regardless
of the selected interval.
• PMM-708: Fixed tooltips for graphs that displayed incorrectly.
• PMM-739, PMM-797: Fixed PMM Server update feature on landing page.
• PMM-823: Fixed arrow padding for collapsible blocks in QAN.
• PMM-887: Disabled the Add button when no table is specified for showing query info in QAN.
• PMM-888: Disabled the Apply button in QAN settings when nothing is changed.
• PMM-889: Fixed the switch between UTC and local time zone in the QAN time range selector.
• PMM-909: Added message No query example when no example for query is available in QAN.
• PMM-933: Fixed empty tooltips for Per Query Stats column in the query details section of QAN.
• PMM-937: Removed the percentage of total query time in query details for the TOTAL entry in QAN (because
it is 100% by definition).
• PMM-951: Fixed the InnoDB Page Splits graph formula in the MySQL InnoDB Metrics Advanced dash-
board.
• PMM-953: Enabled stacking for graphs in MySQL Performance Schema dashboard.
• PMM-954: Renamed Top Users by Connections graph in MySQL User Statistics dashboard to Top Users by
Connections Created and added the Connections/sec label to the Y-axis.
• PMM-957: Refined titles for Client Connections and Client Questions graphs in ProxySQL Overview dash-
board to mentioned that they show metrics for all host groups (not only the selected one).
• PMM-961: Fixed the formula for Client Connections graph in ProxySQL Overview dashboard.
• PMM-964: Fixed the gaps for high zoom levels in MySQL Connections graph on the MySQL Overview
dashboard.
• PMM-976: Fixed Orchestrator hadling by supervisorctl.
• PMM-1129: Updated the MySQL Replication dashboard to support new connection_name label intro-
duced in mysqld_exporter for multi-source replication monitoring.
• PMM-1054: Fixed typo in the tooltip for the Settings button in QAN.
• PMM-1055: Fixed link to Query Analytics from Metrics Monitor when running PMM Server as a virtual appli-
ance.
• PMM-1086: Removed HTML code that showed up in the QAN time range selector.
Bug Fixes
• PMM-547: Added warning page to Query Analytics app when there are no PMM Clients running the QAN
service.
• PMM-799: Fixed Orchestrator to show correct version.
• PMM-1031: Fixed initialization of Query Profile section in QAN that broke after upgrading Angular.
• PMM-1087: Fixed QAN package building.
Other Improvements
New Features
Bug Fixes
Other Improvements
• PMM-783: Directed mongodb_exporter log messages to stderr and excluded many generic messages
from the default INFO logging level.
• PMM-756: Merged upstream node_exporter version 0.14.0.
Several collectors were deprecated in this release:
– gmond - Out of scope.
– megacli - Requires forking, to be moved to textfile collection.
– ntp - Out of scope.
It also introduced the following breaking change:
• PMM-667: Fixed the Latency graph in the ProxySQL Overview dashboard to plot microsecond values instead
of milliseconds.
• PMM-800: Fixed the InnoDB Page Splits graph in the MySQL InnoDB Metrics Advanced dashboard to show
correct page merge success ratio.
• PMM-1007: Added links to Query Analytics from MySQL Overview and MongoDB Overview dashboards. The
links also pass selected host and time period values.
Note: These links currently open QAN2, which is still considered experimental.
• PMM-931: Fixed pmm-admin script when adding MongoDB metrics monitoring for secondary in replica set.
To enable MongoDB query analytics, use the mongodb:queries alias when adding the service. As an experimental
feature, it also requires the --dev-enable option:
Note: Currently, it monitors only collections that are present when you enable MongoDB query analytics. Query data
for collections that you add later is not gathered. This is a known issue and it will be fixed in the future.
The QAN web interface was updated for better usability and functionality (including the new MongoDB query ana-
lytics data). The new UI is experimental and available by specifying /qan2 after the URL of PMM Server.
Note: The button on the main landing page still points to the old QAN interface.
• PMM-724: Added the Index Condition Pushdown (ICP) graph to the MySQL InnoDB Metrics dashboard.
• PMM-734: Fixed the MySQL Active Threads graph in the MySQL Overview dashboard.
• PMM-807: Fixed the MySQL Connections graph in the MySQL Overview dashboard.
• PMM-850: Updated the MongoDB RocksDB and MongoDB WiredTiger dashboards.
• PMM-890: and PMM-891: Removed the InnoDB Deadlocks and Index Collection Pushdown graphs from the
MariaDB dashboard. Both graphs are available in the MySQL InnoDB Metrics dashboard.
• PMM-928: Added tooltips with descriptions for graphs in the MySQL Query Response Time dashboard. Similar
tooltips will be gradually added to all graphs.
• PMM-649: Added the InnoDB Page Splits and InnoDB Page Reorgs graphs to the MySQL InnoDB Metrics
Advanced dashboard.
• Added the following graphs to the MongoDB ReplSet dashboard:
– Oplog Getmore Time
– Oplog Operations
– Oplog Processing Time
– Oplog Buffered Operations
– Oplog Buffer Capacity
• Added descriptions for graphs in the following dashboards:
– MongoDB Overview
– MongoDB ReplSet
– PMM Demo
Note: If you want to start, stop, or restart a specific service, connection to PMM Server is still required.
PMM Server
[mysqld]
• PMM-676: Added descriptions for graphs in Disk Performance and Galera dashboards.
PMM Client
Note: These images are experimental and not recommended for production. It is best to run PMM Server using
Docker.
There are no changes compared to previous 1.1.0 Beta release, except small fixes for MongoDB metrics dashboards.
Note: This beta release is highly experimental with features that are not ready for production. Do not upgrade to it
from previous versions. Use it only in a test environment.
Changes
Introduced Amazon Machine Image (AMI) and VirtualBox images for PMM Server:
• OVA image for VirtualBox is available from the testing download area.
• Public Amazon Machine Image (AMI) is ami-9a0acb8c.
New in PMM Server:
• Grafana 4.1.1
• Prometheus 1.5.0
• Consul 0.7.3
• Updated the MongoDB ReplSet dashboard to show the storage engine used by the instance
• PMM-551: Fixed QAN changing query format when a time-based filter was applied to the digest
New in PMM Client:
• PMM-530: Fixed pmm-admin to support special characters in passwords
• Added displaying of original error message in pmm-admin config output
Known Issues:
• Several of the MongoDB metrics related to MongoRocks engine do not display correctly. This issue will be
resolved in the GA production release.
Upgrading
docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:1.0.7
3. Install new PMM Client version on all hosts that you are monitoring. If you previously installed using Percona
repositories, you can upgade the package as follows:
• For Debian-based distributions:
Changes
Note: This assumes you configure NAT and port forwarding between those addresses.
• Added the show-passwords command to display the current HTTP authentication credentials and password
of the last created user on MySQL (this is useful for replication setups).
• Fixed slow log rotation for mysql:queries service with MySQL 5.1.
• Exposed PXC/Galera gcache size as a metric.
• Amended output of systemv service status if run ad-hoc (requires re-adding the services).
• Added automatic generation of self-signed SSL certificate to protect metric services with HTTPS/TLS by default
(requires re-adding services, see check-network output).
• Enabled basic HTTP authentication for metric services when defined on PMM Server and configured on PMM
Client to achieve client-side protection (requires re-adding services, see check-network output).
• Removed MongoDB connection string from being passed in command-line arguments and hidden password
from the process list (requires re-adding the mongodb:metrics service).
• Removed network port listening by mysql:queries service (percona-qan-agent process) as there is
no need for it.
• Replaced emojis with terminal colors for output of the check-network and list commands.
Upgrading
docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:1.0.6
3. Install new PMM Client version on all hosts that you are monitoring. If you previously installed using Percona
repositories, you can upgade the package as follows:
• For Debian-based distributions:
Changes
Upgrading
Note: All custom Grafana dashboards and settings in Metrics Monitor will be reset when you upgrade PMM Server.
Back it up and restore after the upgrade. Starting from version 1.0.5, it is possible to preserve this data, but you will
have to recreate the data container with -v /var/lib/grafana. If you choose to recreate the data container, all
previously collected data will be lost.
2. If you also want to recreate the pmm-data container with support for custom Grafana dashboards and settings:
docker rm pmm-data
3. If you removed pmm-data container, create it with the new version tag:
docker create \
-v /opt/prometheus/data \
-v /opt/consul-data \
-v /var/lib/mysql \
-v /var/lib/grafana \
--name pmm-data \
percona/pmm-server:1.0.5 /bin/true
docker run -d \
-p 80:80 \
--volumes-from pmm-data \
--name pmm-server \
--restart always \
percona/pmm-server:1.0.5
5. Install new PMM Client version. If you previously installed using Percona repositories, you can upgade the
package as follows:
• For Debian-based distributions:
Changes
Note: 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.
• MySQL Query Analytics data is now preserved when you remove and then add a mysql:queries instance
with the same name using pmm-admin.
• Fixed rare issue when Nginx tries to use IPv6 for localhost connections.
• Improvements and fixes to Query Analytics.
• Various dashboard improvements.
PMM Client changes:
• Added check for orphaned local and remote services.
• Added repair command to remove orphaned services.
• Added proxysql:metrics service and proxysql_exporter.
• Amended check-network output.
• Disabled inital client configuration with a name that is already in use.
• Changed the threshold for automatically disabling table stats when adding mysql:metrics service to 1000
tables on the server. Table stats were previously automatically disabled only if there were over 10 000 tables.
You can still manually disable table stats using pmm-admin add mysql --disable-tablestats. For
more information, see What are common performance considerations?.
• Fixes for mysql:queries service:
– Improved registration and detection of orphaned setup
– PID file “” is no longer created on Amazon Linux (requires to re-add mysql:queries service)
– Fixed support for MySQL using a timezone different than UTC
– Corrected detection of slow log rotation and also perform its own rotation when used as a query source
– RELOAD privilege is now required to flush the slow log
Upgrading
Note: This release introduces major changes and requires you to completely remove any previous versions of all
PMM components. This means you will lose all previously collected data and start from scratch.
Changes
Upgrading
Note: This beta release introduces minor changes to both PMM Client and PMM Server.
Note: There is no need to stop monitoring instances and remove PMM Client. You can simply run the
install script from the new client tarball, or manually copy ./bin/pmm-admin from the new tarball
to /usr/local/percona/pmm-client/.
Changes
Upgrading
Note: This beta release introduces major changes to PMM Client and simplifies Docker commands for PMM Server.
If you want to preserve Metrics Monitor data, do not remove the pmm-data container. However, previous QAN data
will be lost anyway.
3. If you removed the pmm-data container, create it as described in Creating the pmm-data Container
4. Create and run the PMM Server container
5. Install PMM Client on all your monitored hosts
Changes
– --disable-per-table-stats: Disable per table metrics (for MySQL servers with a huge number
of tables)
For more information, see What are common performance considerations?
• When using the --create-user option to add a QAN or MySQL metrics monitoring instance, the password
generated for the new user now conforms with MySQL 5.7 default password policy.
Other changes related to PMM Client:
• Eliminated intermediate percona-prom-pm process. All monitoring services are now created dynamically
via the platform service manager (systemd, upstart, or systemv).
• Added the ability to monitor multiple instances of MySQL and MongoDB on the same node
• Cleaned up and improved the installation and uninstallation scripts
Upgrading
Note: This beta release introduces changes to the pmm-data container, which is used for storing collected data. To
upgrade, you will need to remove and re-create this container, losing all your collected data.
New Features
• Grafana 3.0: PMM now includes the latest version of Grafana for visualizing collected metrics data.
• MongoDB Metrics: With the addition of mongodb_exporter for Prometheus and MongoDB dashboards
for Grafana, you can now use PMM for monitoring MongoDB metrics.
• Consul: Instead of prom-config-api, PMM now uses Consul to provide an API service for communication
between PMM Client and Prometheus.
• Nginx: PMM now uses Nginx, instead of a custom web server.
• Server Summary: Aggregated query metrics are now available in QAN.
• MySQL InnoDB Metrics Advanced: New dashboard for MySQL metrics.
THIRTEEN
Percona Monitoring and Management is an open source product. We provide ways for anyone to contact developers
and experts directly, submit bug reports and feature requests, and contribute to source code directly.
Contacting Developers
Use the community forum to ask questions about using PMM. Developers and experts will try to help with problems
that you experience.
Reporting Bugs
Use the PMM project in JIRA to report bugs and request features. Please register and search for similar issues before
submitting a bug or feature request.
Use the GitHub repository to explore source code and suggest contributions. You can fork and clone any Percona
repositories, but to have your source code patches accepted please sign the Contributor License Agreement (CLA).
259
Percona Monitoring and Management Documentation, Release 1.17.0
FOURTEEN
The best place to discuss PMM with developers and other community members is the community forum.
If you would like to report a bug, use the PMM project in JIRA.
261
Percona Monitoring and Management Documentation, Release 1.17.0
PMM Server
Note: By default, retention is set to 30 days for Metrics Monitor and to 8 days for Query Analytics. Also consider
disabling table statistics, which can greatly decrease Prometheus database size.
Minimum memory is 2 GB for one monitored database node, but it is not linear when you add more nodes. For
example, data from 20 nodes should be easily handled with 16 GB.
PMM Client
Any modern 64-bit Linux distribution. It is tested on the latest versions of Debian, Ubuntu, CentOS, and Red Hat
Enterprise Linux.
Minimum 100 MB of storage is required for installing the PMM Client package. With good constant connection to
PMM Server, additional storage is not required. However, the client needs to store any collected data that it is not able
to send over immediately, so additional storage may be required if connection is unstable or throughput is too low.
Prometheus 1.x.x, shipped with PMM up to version 1.13.0, used by default 768 MB of memory for storing the most
recently used data chunks.
If you haven’t upgraded to a version 1.13.0 or higher, you may require a higher limit, depending on the amount of data
coming into Prometheus, to avoid throttling data ingestion, or to allow less memory consumption by Prometheus.
Important: Starting with version 1.13.0, PMM uses Prometheus 2. Due to optimizations in Prometheus, setting the
metrics memory by passing the METRICS_MEMORY option is a deprecated practice.
For compatibility reasons PMM 1.13.0 and above is still supporting Prometheus 1.x, but with substantially de-
creased resources: now it uses only 15% of available memory and its connections amount limit is managed by the
MAX_CONNECTIONS environment variable, set to 15 by default.
By default, Prometheus stores time-series data for 30 days, and QAN stores query data for 8 days.
Depending on available disk space and your requirements, you may need to adjust data retention time.
You can control data retention by passing the METRICS_RETENTION and QUERIES_RETENTION environment
variables when creating and running the PMM Server container. To set environment variables, use the -e option.
The value is passed as a combination of hours, minutes, and seconds. For example, the default value of 30 days for
METRICS_RETENTION> is 720h0m0s. You probably do not need to be more precise than the number hours, so
you can discard the minutes and seconds. For example, to decrease the retention period for Prometheus to 8 days:
-e METRICS_RETENTION=192h
See also:
Metrics retention METRICS_RETENTION
Queries retention QUERIES_RETENTION
When you add a monitoring instance using the pmm-admin tool, it creates a corresponding service. The name of the
service has the following syntax:
pmm-<type>-<port>
For example: pmm-mysql-metrics-42002.
The location of the services depends on the service manager:
Service manager Service location
systemd /etc/systemd/system/
upstart /etc/init/
systemv /etc/init.d/
To see which service manager is used on your system, run as root pmm-admin info.
Every service created by pmm-admin when you add a monitoring instance gets a DSN from the credentials provided,
auto-detected, or created (when adding the instance with the --create-user option).
For MySQL and MongoDB metrics instances (mysql:metrics and mongodb:metrics services), the DSN is
stored with the corresponding service files. For more information, see Where are the services created by PMM Client?.
For QAN instances (mysql:queries service), the DSN is stored in local configuration files under /usr/local/
percona/qan-agent.
Also, a sanitized copy of DSN (without the passowrd) is stored in Consul API for information purposes (used by the
pmm-admin list command).
Every service created by pmm-admin when you add a monitoring instance has a separate log file located in /var/
log/. The file names have the following syntax: pmm-<type>-<port>.log.
For example, the log file for the MySQL QAN monitoring service is /var/log/pmm-mysql-queries-0.log.
You can view all available monitoring instance types and corresponding ports using the pmm-admin list com-
mand. For more information, see Listing monitoring services.
PMM Server runs logrotate to rotate nginx logs on a daily basis and keep up to 10 latest log files.
If a MySQL server has a lot of schemas or tables, it is recommended to disable per table metrics when adding the
instance:
$ sudo pmm-admin add mysql --disable-tablestats
Note: Table statistics are disabled automatically if there are over 1 000 tables.
Yes, you can use pmm-admin to start and stop either individual services that correspond to the added monitoring
instances, or all of them at once.
To stop all services:
$ sudo pmm-admin stop --all
Yes, you can add multiple MySQL instances to be monitored from one PMM Client. In this case, you will need to
provide a distinct port and socket for each instance using the --port and --socket parameters, and specify a
unique name for each instance (by default, it uses the name of the PMM Client host).
For example, if you are adding complete MySQL monitoring for two local MySQL servers, the commands could look
similar to the following:
$ sudo pmm-admin add mysql --user root --password root --create-user --port 3001
˓→instance-01
$ sudo pmm-admin add mysql --user root --password root --create-user --port 3002
˓→instance-02
You can remove any monitoring instance as described in Removing monitoring services and then add it back with a
different name.
When you remove a monitoring service, previously collected data remains available in Grafana. However, the metrics
are tied to the instance name. So if you add the same instance back with a different name, it will be considered a new
instance with a new set of metrics. So if you are re-adding an instance and want to keep its previous data, add it with
the same name.
When you add an instance with the pmm-admin tool, it creates a corresponding service that listens on a predefined
client port:
General OS metrics linux:metrics 42000
MySQL metrics mysql:metrics 42002
MongoDB metrics mongodb:metrics 42003
ProxySQL metrics proxysql:metrics 42004
If a default port for the service is not available, pmm-admin automatically chooses a different port.
If you want to assign a different port, use the --service-port option when adding instances.
There is a pmm-admin check-network command, which checks connectivity between PMM Client and PMM
Server and presents the summary of this check in a human readable form.
Broken network connectivity may be caused by rather wide set of reasons. Particularly, when using Docker, the
container is constrained by the host-level routing and firewall rules. For example, your hosting provider might have
default iptables rules on their hosts that block communication between PMM Server and PMM Client, resulting in
DOWN targets in Prometheus. If this happens, check firewall and routing settings on the Docker host.
Also PMM is able to generate a set of diagnostics data which can be examined and/or shared with Percona Support to
solve an issue faster. See details on how to get collected logs from PMM Server and from PMM Client.
The mysql:metrics service collects metrics with different resolutions (1 second, 5 seconds, and 60 seconds)
The linux:metrics and mongodb:metrics services are set up to collect metrics with 1 second resolution.
In case of bad network connectivity between PMM Server and PMM Client or between PMM Client and the database
server it is monitoring, scraping every second may not be possible when latency is higher than 1 second. You can
change the minimum resolution for metrics by passing the METRICS_RESOLUTION environment variable when
creating and running the PMM Server container. To set this environment variable, use the -e option. The values can
be between 1s (default) and 5s. If you set a higher value, Prometheus will not start.
Note: Consider increasing minimum resolution when PMM Server and PMM Client are on different networks, or
when Adding an Amazon RDS DB instance to PMM.
You need to create Orchestrator’s topology user on MySQL according to this section.
How to set the root password when PMM Server is installed as a vir-
tual appliance
With your virtual appliance set up, you need to set the root password for your PMM Server. By default, the virtual
machine is configured to enforce changing the default password upon the first login.
Run your virtual machine and when requested to log in, use the following credentials:
User root
Password percona
The system immediately requests that you change your password. Note that, for the sake of security, your password
must not be trivial and pass at least the dictionary check. If you do not provide your password within sixty seconds
you are automatically logged out. In this case use the default credentials to log in again.
Fig. 14.2: Set a new password and have full access to your system
After the new password is set you control this system as a superuser and can make whaterver changes required.
Important: You cannot access the root account if you access PMM Server using SSH or via the Web interface.
If you would like to experiment with the latest development version using Docker, you may use the dev-latest
image. This version, however, is not intended to be used in a production environment.
If you would like to experiment with the latest development version of PMM Server VirtualBox image, download the
development version as follows:
$ wget "http://percona-vm.s3-website-us-east-1.amazonaws.com/PMM-Server-dev-latest.ova
˓→"
Important: This is a development version which is not designed for a production environment.
See also:
Setting up PMM Server via Docker setup procedure
Setting up PMM Server via VirtualBox VirtualBox Using the Command Line
FIFTEEN
GLOSSARIES
This glossary contains the addtional parameters that you may pass when starting PMM Server.
If you use Docker to run the server, use the -e flag followed by the parameter. Use this flag in front of each parameter
that you pass to PMM Server.
Here, we pass more than one option to PMM Server along with the docker run command. Run this command as
root or by using the sudo command.
DISABLE_TELEMETRY With telemetry enabled, your PMM Server sends some statistics to v.percona.com every
24 hours. This statistics includes the following details:
• PMM Server unique ID
• PMM version
• The name and version of the operating system
• MySQL version
• Perl version
If you do not want your PMM Server to send this information, disable telemetry when running your Docker
container:
DISABLE_UPDATES To update your PMM from web interface you only need to click the Update on the home
page. The DISABLE_UPDATES option is useful if updating is not desirable. Set it to true when running PMM
in the Docker container.
Run this command as root or by using the sudo command.
269
Percona Monitoring and Management Documentation, Release 1.17.0
The DISABLE_UPDATES option removes the Update button from the interface and prevents the system from
being updated manually.
METRICS_MEMORY By default, Prometheus in PMM Server uses all available memory for storing the most
recently used data chunks. Depending on the amount of data coming into Prometheus, you may require to allow
less memory consumption if it is needed for other processes.
Important: Starting with version 1.13.0, PMM uses Prometheus 2. Due to optimizations in Prometheus,
setting the metrics memory by passing the METRICS_MEMORY option is a deprecated practice.
If you are still using a version of PMM prior to 1.13 you might need to set the metrics memory by passing the
METRICS_MEMORY environment variable along with the docker run command.
Run this command as root or by using the sudo command. The value must be passed in kilobytes. For example,
to set the limit to 4 GB of memory run the following command:
See also:
Docker documentation: Controlling memory usage in a Docker container https://docs.docker.com/config/
containers/resource_constraints/
METRICS_RESOLUTION This environment variable sets the minimum resolution for checking metrics. You
should set it if the latency is higher than 1 second.
Run this command as root or by using the sudo command.
METRICS_RETENTION This option determines how long metrics are stored at PMM Server. The value is passed
as a combination of hours, minutes, and seconds, such as 720h0m0s. The minutes (a number followed by m)
and seconds (a number followed by s) are optional.
To set the METRICS_RETENTION> option to 8 days, set this option to 192h.
Run this command as root or by using the sudo command
See also:
Data retention in PMM Data retention
Queries retention QUERIES_RETENTION
ORCHESTRATOR_ENABLED This option enables Orchestrator (See Orchestrator). By default it is disabled. It
is also desabled if this option contains false.
See also:
Orchestrator Orchestrator
Orchestrator Credentials
• ORCHESTRATOR_USER
• ORCHESTRATOR_PASSWORD
ORCHESTRATOR_PASSWORD Pass this option, when running your PMM Server via Docker to set the orches-
trator password.
This option has no effect if the ORCHESTRATOR_ENABLED option is set to false.
See also:
ORCHESTRATOR_ENABLED
ORCHESTRATOR_USER Pass this option, when running your PMM Server via Docker to set the orchestrator
user. You only need this parameter (along with ORCHESTRATOR_PASSWORD if you have set up a custom
Orchestrator user.
This option has no effect if the ORCHESTRATOR_ENABLED option is set to false.
QUERIES_RETENTION This option determines how many days queries are stored at PMM Server.
See also:
Metrics retention METRICS_RETENTION
Data retention in PMM Data retention
SERVER_PASSWORD Set the password to access the PMM Server web interface.
Run this command as root or by using the sudo command.
By default, the user name is pmm. You can change it by passing the SERVER_USER variable.
SERVER_USER By default, the user name is pmm. Use this option to use another user name.
Run this command as root or by using the sudo command.
Terminology Reference
On the PMM home page, you can also find the version number and a button to update your PMM Server (see
PMM Version).
PMM Server Aggregates data collected by PMM Client and presents it in the form of tables, dashboards, and graphs
in a web interface.
PMM Server combines the backend API and storage for collected data with a frontend for viewing time-based
graphs and performing thorough analysis of your MySQL and MongoDB hosts through a web interface.
Run PMM Server on a host that you will use to access this data.
See also:
PMM Architecture
Overview of Percona Monitoring and Management Architecture
PMM Server Version If PMM Server is installed via Docker, you can check the current PMM Server version by
running docker exec:
Run this command as root or by using the sudo command
PMM user permissions for AWS When creating a IAM user for Amazon RDS DB instance that you intend to
monitor in PMM, you need to set all required permissions properly. For this, you may copy the following JSON
for your IAM user:
{ "Version": "2012-10-17",
"Statement": [{ "Sid": "Stmt1508404837000",
"Effect": "Allow",
"Action": [ "rds:DescribeDBInstances",
"cloudwatch:GetMetricStatistics",
"cloudwatch:ListMetrics"],
"Resource": ["*"] },
{ "Sid": "Stmt1508410723001",
"Effect": "Allow",
"Action": [ "logs:DescribeLogStreams",
"logs:GetLogEvents",
"logs:FilterLogEvents" ],
"Resource": [ "arn:aws:logs:*:*:log-
˓→group:RDSOSMetrics:*" ]}
]
}
See also:
Creating an IAM user Creating an IAM user
PMM Version The version of PMM appears at the bottom of the PMM server home page.
See also:
Checking the version of PMM Server
PMM Server Version
pmm-admin A program which changes the configuration of the PMM Client. See detailed documentation in the
Managing PMM Client section.
Ports The following ports must be open to enable communication between the PMM Server and PMM clients.
PMM Server should keep ports 80 or 443 ports open for computers where PMM Client is installed to access the
PMM web interface.
42000 For PMM to collect genenal system metrics.
42001 This port is used by a service which collects query performance data and makes it available to QAN.
42002 For PMM to collect MySQL server metrics.
42003 For PMM to collect MongoDB server metrics.
42004 For PMM to collect ProxySQL server metrics.
See also:
Setting up a firewall on CentOS https://www.digitalocean.com/community/tutorials/
how-to-set-up-a-firewall-using-firewalld-on-centos-7
Setting up a firewall on Ubuntu https://www.digitalocean.com/community/tutorials/
how-to-set-up-a-firewall-with-ufw-on-ubuntu-16-04
QAN See Query Analytics (QAN)
Query Abstract Query pattern with placeholders. This term appears in QAN as an attribute of queries.
Query Analytics (QAN) Component of PMM Server that enables you to analyze MySQL query performance over
periods of time.
Query Fingerprint See Query Abstract
Query ID A query fingerprint which groups similar queries.
Query Load The percentage of time that the MySQL server spent executing a specific query.
Query Metrics Summary Table An element of Query Analytics (QAN) which displays the available metrics for the
selected query.
Query Metrics Table A tool within QAN which lists metrics applicable to the query selected in the query summary
table.
Query Summary Table A tool within QAN which lists the queries which were run on the selected database server
during the selected time or date range.
Quick ranges Predefined time periods which are used by QAN to collect metrics for queries. The following quick
ranges are available:
• last hour
• last three hours
• last five hours
• last twelve hours
• last twenty four hours
• last five days
Selected Time or Date Range A predefined time period (see Quick ranges), such as 1 hour, or a range of dates that
QAN uses to collects metrics.
Telemetry Percona may collect some statistics about the machine where PMM is running.
This statistics includes the following information:
• PMM Server unique ID
• PMM version
• The name and version of the operating system, AMI or virtual appliance
• MySQL version
• Perl version
You may disable telemetry by passing an additional parameter to Docker.
Version A database server attribute found on the QAN page. it informs the full version of the monitored database
server, as well as the product name, revision and release number.
P
PMM, 272
PMM annotation, 272
PMM Client, 272
PMM Docker Image, 272
PMM Home Page, 272
PMM Server, 273
PMM Server Version, 273
PMM user permissions for AWS, 273
PMM Version, 273
pmm-admin, 273
277