Member Sign In
Not a member?

A Wired.com user account lets you create, edit and comment on Webmonkey articles. You will also be able to contribute to the Wired How-To Wiki and comment on news stories at Wired.com.


It's fast and free.

Sign in with OpenID
Sign In
Webmonkey is a property of Wired Digital.
processing...
Join Webmonkey

Please send me occasional e-mail updates about new features and special offers from Wired/Webmonkey.
Yes No

Please send occasional e-mail offers from Wired/Webmonkey affiliated web sites and publications, and carefully selected companies.
Yes No

I understand and agree that registration on or use of this site constitutes agreement to Webmonkey's User Agreement and Privacy Policy.
Webmonkey is a property of Wired Digital.
processing...

Retrieve Sign In

Please enter your e-mail address or username below. Your username and password will be sent to the e-mail address you provided us.

or
Webmonkey is a property of Wired Digital.
processing...

Welcome to Webmonkey

A private profile page has been created for you.
As a member of Webmonkey, you can now:
  • edit articles
  • add to the code library
  • design and write a tutorial
  • comment on any Webmonkey article
Close
Webmonkey is a property of Wired Digital.

Sign In Information Sent

An e-mail has been sent to the e-mail address registered in this account.
If you cannot find it in your in-box, please check your bulk or junk folders.
Sign In
Webmonkey is a property of Wired Digital.

Watch Your Database Threads

Mytop

Image from http://jeremy.zawodny.com/mysql/mytop/

You’ve probably used top to monitor running processes on a server. It’s tremendously handy when you’re wondering where all that RAM went.

For web applications, the bottlenecks we deal with are more typically bandwidth and database issues. To keep an eye on a MySQL database, install mytop, a command-line tool that looks like top, but monitors database threads instead of system processes.


After it’s installed, you can run it from the command line, specifying which database you want it to look at, or keep those parameters in a .mytop file. The display shows queries per second, activity in the key buffer, and the status of active threads.

You can kill particular threads, filter by hostname or database, and more.

Innotop is another tool with a similar purpose, possibly more powerful, but mytop is what I’m familiar with.

See Also:

Post Comment Comments Permalink Print
Reddit Digg

 
Subscribe now

Special Offer For Webmonkey Users

WIRED magazine:
The first word on how technology is changing our world.

Subscribe for just $10 a year