15 Jan 2012

Query-Digest on Windows

The best way to run pt-query-digest is by making absolutely sure it is not running on any server that is even slightly important to production.

I recently had a case where pt-query-digest took up all the memory and swap on a (linux) development server. I think the reason was that the slow log had blob data in it.
Even though it wasn't a production server, it managed to upset some people.


So I:
  1. Installed strawberry perl on my windows computer
  2. Downloaded the gzip'd slow log file (using WinSCP)
  3. Unzip'd it
  4. Saved percon.com/get/pt-query-digest to a .pl file on my laptop
  5. Went to start menu
  6. In the run part I typed cmd
  7. In the new command window, I typed pt-query-digest.pl slow.log > digest.txt


And walla!
My laptop was a bit hot for a few hours, but nothing crashed and no one was upset.

1 comment:

  1. You have a typo: percon.com/get/pt-query-digest -> percona.com/get/pt-query-digest on point 4.
    Interesting article but in my opinion this is easier on linux.

    ReplyDelete