Reputation: 13040
I'm working on improving the performance of a MySQL server. I'm looking for something to monitor the performance of MySQL (as query per second) over time so that I can measure any improvements I make.
Are their any easy to use open source software that does this?
Thank you.
Upvotes: 5
Views: 9275
Reputation: 47
I know you asked your question a long time ago - but I just happened across it and wanted to share another tool with you. Baron Schwartz of Percona started innotop, which is a next generation mytop. It adds advanced InnoDB monitoring on top of server status and query analysis. If you are running CentOS, it is included in the EPEL repository.
Upvotes: 0
Reputation: 165193
I like the tool mytop. It's just like top
in the *nix world, but for MySQL itself. And it basically does exactly what you are asking...
As far as other optimization techniques, I personally really like using Apache Bench for testing MySQL queries. Basically, I create a simple script that does nothing but execute the query I want to improve. Then, I run AB on it with different concurrency settings. The benefit is that you get an idea on how the query scales, not just how fast it runs. Who cares if a query is fast for a single run. What you really care about is how fast in runs with load. So:
<?php
$my = new MySQLi($host, $user, $pass);
$my->query('SELECT foo');
Then, using AB:
ab -c 10 -n 10000 http://localhost/path/to/my/test.php
Then, by adjusting the concurrency parameter (-c 10
) you can test for different concurrent load. That way, you can really look at how your tweaks effect the exact query rather than guessing with other metrics.
Upvotes: 6