Tip of the Day — Your Toolkit
As a DBA you will develop a “bag of tools” that you use on a day-in and day-out basis. I will outline some of the tools I use every day:
mytop (http://jeremy.zawodny.com/mysql/mytop/) - this is a tool that is very similar in use to the “top” tool of the Unix world. In almost real time it provides information such as what queries are running, how many queries per second and how many threads are being utilized.
bash (for shell programming) - while there are many choices I use tried and true bash for scripting mysql server installs and the hundred other tasks a DBA ends up having to script to automate tasks and make life easier.
maatkit (http://maatkit.sourceforge.net) - If I had to have one tool in my bag — this would be it. The collection of utilities is astonishing and cover everything from a dump and restore utility that runs multiple threads to a table sync tool that compares tables on two servers and can correct any problems between them. The complete list of utilities is too long to list here. Do yourself a favor and download it if you don’t have it already.
nagios (http://www.nagios.org) - I don’t enjoy getting paged at 2:00 a.m. but sometimes it is necessary. Nagios can monitor everything from disk space to cpu usage and there are many plug ins written specifically for MySQL. To keep on top of things you need monitoring. Nagios is among the best for that task.
ganglia (http://ganglia.sourceforge.net/) - ganglia is also a monitoring system, but it is of a slightly different bent. Ganglia produces nice graphs that you can use to track various system statistics over time and see how your system loads are changing.
That’s all for now. I am sure if you have been a DBA for a while you might have some more. Feel free to comment. If you aren’t using these tools already give them a try.
3 Comments so far
Leave a reply
Excellent list of tools.
I have one other in my bag that is useful for evaluating performace, mysqlreport.
Makes a nice report utilizing MySQL status values and can help identify issues without constantly calling SHOW STATUS.
http://hackmysql.com/mysqlreport
Try innotop (http://innotop.sourceforge.net/) instead of mytop, it’s in more active development, has quite a bit more features, very customizable, very suitable for transaction/InnoDB setups.
I’ve played with quite a few monitoring systems to keep an eye on the performance of my machines and Munin (http://munin.projects.linpro.no/) is the system that has stuck. It’s really easy to setup, very easy to extend.
I agree with mysqlreport, and actually I like hackmysql.com’s “mysqlsla” WAY better than mysqldumpslow — you can sort by many things, including # of times the query appeared and average time the slow query took.