Category Archives: Uncategorized

Re-visit of warming up a cache with pt-query-digest

IMG_5175The only thing I do NOT like about the percona toolkit is that they willy nilly change the arguments you can give it. AND I can never find what to use instead. Really, Percona this is annoying. I’ll start this post with the DETS on server and version of pt-query-digest:
Server: Ubuntu 14.04.1 LTS
pt-query-digest version:   2.2.13

pt-query-digest –user myuser–password SECRET–processlist  h=10.1.0.118 –filter ‘$event->{arg} =~ m/^select/i’ –no-report  –interval 0.01 –run-time 10m –output=slowlog | mysql -f

What’s changed:

  1. filter – fingerprint in this syntax was incorrect and {arg} works. Double checked and the output is only SELECTS
  2. New args: interval, run-time,output

    – interval is great for grabbing the faster queries.
    – run-time can let you choose how long to grab those queries and tailor the time to warm up your cache. I’m not sure at my current place how long this will take but at previous places it took 30min
    – output is what’s used instead of PRINT! output allows you to choose your output format. I use slowlog as it’s the format to run against a cold server.

whew that was painful.