# mk/pt-query-digest

**URL:** <https://forums.percona.com/t/mk-pt-query-digest/2405>\
**Category:** Other Tools\
**Created:** [June 19, 2012, 4:50am UTC](https://forums.percona.com/t/mk-pt-query-digest/2405 "2012-06-19T04:50:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robs](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@robs](https://forums.percona.com/u/robs)\
**Post date:** [June 19, 2012, 4:50am UTC](https://forums.percona.com/t/mk-pt-query-digest/2405/1 "2012-06-19T04:50:12Z")

</div>

Hi All,

I’m using the query-digest tool to gather some statistics on a number of busy servers. Currently the problem I have is that pt-query-digest’s memory usage continuously grows, heres how I’m using it.

/usr/sbin/tcpdump -i eth0 port 3306 -s 65535 -x -n -q -tttt |/usr/bin/pt-query-digest --type tcpdump --review u=dbUser,p=dbPass,h=dbHost,D=mk\_query\_digest,t=query\_review --create-review-table --review-history u=dbUser,p=dbPass,h=dbHost,D=mk\_query\_digest,t=query\_review\_history --create-review-history-table --run-time-mode clock --run-time 1m --iterations 0 --noreport

I was hoping that after each run specified by --run-time that pt-query-digest would write out the statistics to my query\_review database and this would keep the memory usage to 1m’s worth of run time rather than wait until Ctrl-C or iterations is reached.

Any ideas if this is possible and if so how?

Cheers,  
Rob

---

<div class="post-metadata">

**Author:** ![robs](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@robs](https://forums.percona.com/u/robs)\
**Post date:** [June 20, 2012, 9:46pm UTC](https://forums.percona.com/t/mk-pt-query-digest/2405/2 "2012-06-20T21:46:27Z")

</div>

For anybody else who might be interested I decided to run pt-query-digest under Upstart with,

–run-time-mode clock --run-time 1m --iterations 1

and have Upstart respawn each time.

Cheers,  
Rob
