Databases 6 min read

Understanding Percona QAN: Architecture, Slow‑Log Processing, and Performance Metrics

This article introduces Percona QAN, explains its three‑component architecture (QAN‑Agent, QAN‑API, QAN‑APP), describes the MySQL slow‑log format and key fields, and details the web UI metrics such as Load, Count, Latency, and additional diagnostic information for database performance analysis.

Aikesheng Open Source Community
Aikesheng Open Source Community
Aikesheng Open Source Community
Understanding Percona QAN: Architecture, Slow‑Log Processing, and Performance Metrics

Percona QAN (Query Analytics) is a component of Percona Monitoring and Management (PMM) that visualizes MySQL and MongoDB slow‑query logs, helping DBAs and developers identify performance problems.

QAN consists of three parts: QAN‑Agent (client) collects slow‑log data, QAN‑API (server) stores the data and provides query interfaces, and QAN‑APP (a Grafana plugin) displays the information.

The data flow follows: slow‑log → QAN‑Agent → QAN‑API ↔ QAN‑APP (grafana) .

Architecture diagrams for PMM 1 and PMM 2 illustrate the deployment topology.

The MySQL slow‑log records statements whose execution time exceeds long_query_time (default 10 s). Example entries include timestamps, user/host, Query_time , Lock_time , Rows_sent , Rows_examined , and a preceding SET timestamp statement. Sample log lines:

# Time: 2020-04-25T05:29:35.954373Z
# User@Host: root[root] @ localhost []  Id: 9
# Query_time: 5.000901  Lock_time: 0.000000 Rows_sent: 1  Rows_examined: 0
SET timestamp=1587792575;
select sleep(5);

Key fields explained:

Query_time – execution time in seconds.

Lock_time – time spent acquiring locks.

Rows_sent – rows returned to the client.

Rows_examined – rows examined by the engine.

SET timestamp – records when the slow query was logged.

The QAN UI provides several pages:

Query Analysis

The default view shows the top‑10 slow queries with three metrics: Load, Count, and Latency.

Load

Represents the proportion of query execution time within the selected interval, calculated as query_time / (end_time - start_time) .

Count

Shows the total number of executions of the query during the interval.

Latency

Displays average, maximum, minimum, and 95th‑percentile execution times for the query.

Metrics

Selecting a query reveals detailed metrics (Query_time, Lock_time, Rows_sent, Rows_examined) directly extracted from the slow‑log.

Additional Information

The UI also provides related data such as EXPLAIN output, CREATE TABLE statements, and index information to aid rapid troubleshooting.

In summary, Percona QAN is a free, open‑source solution that forms a core part of the 爱可生 database management platform’s diagnostic toolkit.

MySQLPerconaperformance analysisslow queryDatabase MonitoringQAN
Aikesheng Open Source Community
Written by

Aikesheng Open Source Community

The Aikesheng Open Source Community provides stable, enterprise‑grade MySQL open‑source tools and services, releases a premium open‑source component each year (1024), and continuously operates and maintains them.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.