# Analyze MySQL load with Percona toolkit pt-query-digest

**URL:** <https://forums.percona.com/t/analyze-mysql-load-with-percona-toolkit-pt-query-digest/32571>\
**Category:** Percona Toolkit\
**Tags:** mysql\
**Created:** [August 25, 2024, 1:18pm UTC](https://forums.percona.com/t/analyze-mysql-load-with-percona-toolkit-pt-query-digest/32571 "2024-08-25T13:18:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Idan\_Ahal](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/idan_ahal/32/13477_2.png) [@Idan\_Ahal](https://forums.percona.com/u/Idan_Ahal)\
**Post date:** [August 25, 2024, 1:18pm UTC](https://forums.percona.com/t/analyze-mysql-load-with-percona-toolkit-pt-query-digest/32571/1 "2024-08-25T13:18:49Z")

</div>

We have a problem when sometimes we have a lot of load on the MySQL but the cause is a lot of small queries and not slow ones.

I had an idea to use the slow log and log all queries \> 0 (Meaning all) for several minutes and then analyze this file with pt-query-digest. This way if there is a very short query that happens a ton of times it will be aggregated and I can find it as the problem (Or the problematic user).

Am I missing something? Does pt-query-digest can do that?

---

<div class="post-metadata">

**Author:** ![kedarpercona](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kedarpercona/32/809_2.png) [@kedarpercona](https://forums.percona.com/u/kedarpercona)\
**Post date:** [August 25, 2024, 5:54pm UTC](https://forums.percona.com/t/analyze-mysql-load-with-percona-toolkit-pt-query-digest/32571/3 "2024-08-25T17:54:00Z")

</div>

Responded on Original question

> [@Percona toolkit find where load is coming from](https://forums.percona.com/t/percona-toolkit-find-where-load-is-coming-from/32468/4):
>
> Hi @Idan_Ahal, If you want to log all the queries consider adjusting the long query time. set global long\_query\_time=0 # or 0.1 Collect the log for the desired period, ensure performance / disk usage are acceptable. You can rotate your slow log to easily parse them directly with the digest OR you can use the --since and --until options to parse required information. The digest will not tell you what resource a query is using but you can get the stats for sure. Thanks, K

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 26, 2024, 2:49pm UTC](https://forums.percona.com/t/analyze-mysql-load-with-percona-toolkit-pt-query-digest/32571/4 "2024-08-26T14:49:23Z")

</div>

@Idan_Ahal I would recommend you install/setup [Database Monitoring Tools for MySQL, MongoDB, PostgreSQL & More | Percona](https://www.percona.com/software/database-tools/percona-monitoring-and-management)

PMM is effectively a constant "pt-query-digest’. It watches your slow log for new queries, processes them live, and updates the dashboards. The UI is far easier than pt-query-digest.
