« Previous 1 2
Tune your databases
Spick and Span
Tweaking Queries
An important PMM feature is the Query Analytics dashboard that shows how queries are executed and where they spend their time by helping you analyze database queries over time, optimize database performance, and find and remedy the source of problems. To get started, select the Query Analytics option in the main menu, which brings up all the database queries running across all deployed servers in the Overview panel (Figure 4). By default, the queries are sorted by database load. You can sort by other parameters to find the queries that run most frequently or that take the longest to complete.
In addition to Query , you can also view the metrics for other object types such as Database , Schema , Client Host , and so on by selecting them from the pull-down menu. When you select an item in the Overview panel, it opens the Details panel at the bottom (Figure 5), which gives a breakdown of the selected item.
To further help you make sense of and use the metrics for optimizing. database performance, the Query Analytics dashboard uses filters to drill down into the data. The filters are logically categorized for easier navigation and display the corresponding load to help you make more sense of the data.
For instance, the filters will point you to the nodes and schemas that are responsible for generating the maximum load. You can then continue drilling down to the particular query that's responsible for generating a majority of that load. Clicking on that query will bring up details to help you analyze the factors that make that particular query inefficient. Perhaps the query hasn't been written properly and is scanning more rows than it must.
Although the interface might sound cumbersome, it's actually pretty intuitive once you get the hang of it. If you work with databases, PMM is a valuable tool that will help you reign in inefficient queries and ensure you are making best use of the available hardware.
Infos
- PMM: https://www.percona.com/software/database-tools/percona-monitoring-and-management
- Install PMM: https://www.percona.com/doc/percona-monitoring-and-management/2.x/install/index-server.html
- Connect PostgreSQL server: https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/conf-postgres.html
- Connect MongoDB server: https://www.percona.com/doc/percona-monitoring-and-management/2.x/manage/client-mongodb-ssl.html
- Grafana alerting feature: https://www.percona.com/blog/2017/02/02/pmm-alerting-with-grafana-working-with-templated-dashboards/
- Prometheus Alertmanager: https://www.percona.com/doc/percona-monitoring-and-management/2.x/faq.html#how-do-i-set-up-alerting-in-pmm
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy ADMIN Magazine
Subscribe to our ADMIN Newsletters
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Most Popular
Support Our Work
ADMIN content is made possible with support from readers like you. Please consider contributing when you've found an article to be beneficial.