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= –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.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s