Appendix B. mytop

This appendix is a basic reference for Version 1.4 of mytop, a tool you can use to monitor various aspects of MySQL. mytop began as a simple Perl script that Jeremy wrote back in 2000 after getting sick of repeatedly running SHOW FULL PROCESSLIST and SHOW STATUS in an attempt to get a handle on what a MySQL was doing. After a bit of hacking on it, he realized that it would be useful it the tool felt a bit like the Unix top utility. Since then it has evolved to become quite a bit more popular and powerful. It is especially useful when tracking down problematic queries or trying to figure out what’s keeping your server so busy.

mytop is an evolving piece of software. Be sure to check the mytop web site (http://jeremy.zawodny.com/mysql/mytop/) for mytop news, downloads, and information about the mailing list. It’s likely that new features have been added since Version 1.4.

Note that when discussing “queries” in this chapter (and many other places in the book), we’re doing so in a general sense: SELECT, INSERT, UPDATE, and DELETE.

Overview

mytop does much of the hard work involved in summarizing MySQL performance data. There are three primary display modes in mytop. The default, thread view (or top view), closely resembles the Unix top command, as seen in Figure B-1. It produces a multiline summary at the top of the screen followed by a listing of threads in MySQL. The command view aggregates the data from MySQL’s Com_* command counters (see Appendix A), as seen in ...

Get High Performance MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.