Checking for MySQL optimizations via scripts

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, July 02, 2011

Follow me on Twitter as @mattiasgeniar

There are a few handy perl/python/bash scripts out there that can analyze a running MySQL system (via the SHOW STATUS and SHOW VARIABLES queries) and suggest improvements. Here are some of them.

Of course you shouldn’t just blindly accept them, as your environment can vary on what these suggest. However, they do some of the handy math-work for you (like calculating the maximum used memory in MySQL according to your current configuration), it’ll just make things easier for you.

  • RackerHackers mysqltuner: offers some good guidelines, easily downloaded via “wget mysqltuner.pl” at the CLI because of handy usage of the .PL TLD.
  • At day32.com, there’s a “Tuning Primer Script": it iterates the most used variables and offers confirmation of a good config or improvements for problematic configs.

If there are any other scripts out there that offer a nice overview of a given MySQL configuration I’d love to hear about them!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.