是否有任何用于监视MySQL性能的开源软件? [英] Any open source software for monitoring MySQL performance?
问题描述
我正在努力提高MySQL服务器的性能.我正在寻找一些东西来监视MySQL的性能(以每秒查询的速度),以便可以衡量我所做的任何改进.
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?
谢谢.
推荐答案
我喜欢工具 mytop .就像* nix世界中的top
一样,但是对于MySQL本身.它基本上可以完全满足您的要求...
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...
至于其他优化技术,我个人真的很喜欢使用 Apache Bench 来测试MySQL查询.基本上,我创建了一个简单的脚本,除了执行我要改进的查询外,什么也不做.然后,我使用不同的并发设置对其运行AB.好处是您可以了解查询的扩展方式,而不只是查询的运行速度.谁在乎一次查询是否快速.您真正关心的是带负载运行的速度.所以:
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');
然后,使用AB:
ab -c 10 -n 10000 http://localhost/path/to/my/test.php
然后,通过调整并发参数(-c 10
),您可以测试不同的并发负载.这样,您就可以真正查看自己的调整如何影响确切的查询,而不是通过其他指标进行猜测.
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.
这篇关于是否有任何用于监视MySQL性能的开源软件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!