Imagine having a tool that can automatically detect JPA and Hibernate performance issues.
Hypersistence Optimizer is that tool!
This article is a beginner’s guide for the Percona Monitoring and Management (PMM), a tool that’s very handy when it comes to analyzing a given database system.
PMM was released in 2016, and initially, it was available for MySQL. However, since 2018, it supports monitoring PostgreSQL as well, so once you learn it you can use it with the two most popular open-source relational database systems.
What is PMM
PMM is an open-source tool, written in Go and hosted on GitHub, that allows you to monitor a relational database system via a pmm-client that sends the database usage metrics to a pmm-server that aggregates all the data and provides it to you via a Grafana dashboard UI.
You can use PMM to monitor the resource usage of a given database system, like CPU, RAM, Network, or Disk IO, and you can also analyze queries and spot slow-running queries or queries that are fast but which are executed more than necessary, like N+1 query issues.
How to install PMM
The easiest way to install PMM is to use Docker since the image is hosted on Docker Hub.
The first thing we need to do is pull the Docker image using the following command:
docker pull percona/pmm-server:2
Now, you need to create a pmm-data persistent storage that is required to be mounted to the /srv path.