Percona Toolkit

Sivaraman Viswanathan
2 min readJan 27, 2018

--

For the past couple of months or so, I was using MySQL on and off. I had setup MySQL, MariaDB and Percona SQL Server with the same data.

After some days when I looked at the slow query logs, I saw that the size of the file is around 300 MB. Now analyzing the file is going to be a time consuming work. That’s where Percona toolkit helped. The toolkit can work against MySQL, MariaDB or Percona SQL Server. There are a bunch of commands within it, but I just one of it to analyze the slow query and report the results.

around 300 MB of slow_query_log

ow, the slow query log is around 278 MB in size. Its going to take a lot of effort to scroll through them and find out what happened in them. Thats where percona toolkit helps a lot.

the ‘pt-query-digest’ command of percona-toolkit takes the slow query log and outputs a summary which is more or less similar to mysql.

pt-query-digest /var/log/mysql/slow_query_log

This takes in the file and produces a report which is inline with the ADDM report that we get in Oracle.

A summary of the analysis of the 300 MB odd file is given below:

It all boils down to 6 queries which needs our attention. Also, in the 6, the first two of them itself will give almost 90% improvement.

So if you are running a MySQL based database, percona-toolkit is a must have tool.

I just used this single command out of necessity. Do browse the other commands given in the link here

--

--

No responses yet