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.
我正在努力提高MySQL服务器的性能。我正在寻找一些东西来监控MySQL的性能(作为每秒查询)随着时间的推移,以便我可以衡量我所做的任何改进。
Are their any easy to use open source software that does this?
他们的任何易于使用的开源软件都可以做到这一点吗?
Thank you.
谢谢。
3 个解决方案
#1
6
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...
我喜欢工具mytop。它就像* nix世界中的*,但对于MySQL本身而言。它基本上完全符合你的要求......
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:
至于其他优化技术,我个人非常喜欢使用Apache Bench来测试MySQL查询。基本上,我创建了一个简单的脚本,除了执行我想要改进的查询之外什么都不做。然后,我使用不同的并发设置在其上运行AB。好处是您可以了解查询如何扩展,而不仅仅是它运行的速度。谁在乎单个运行的查询是否快速。你真正关心的是负载运行的速度有多快。所以:
<?php
$my = new MySQLi($host, $user, $pass);
$my->query('SELECT foo');
Then, using AB:
然后,使用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.
然后,通过调整并发参数(-c 10),您可以测试不同的并发负载。这样,您可以真正了解您的调整如何影响确切的查询,而不是猜测其他指标。
#3
0
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.
我知道你很久以前就问过你的问题了 - 但我刚发生了这件事,想和你分享另一个工具。 Percona的Baron Schwartz开始使用innotop,这是下一代的mytop。它在服务器状态和查询分析之上添加了先进的InnoDB监控功能。如果您正在运行CentOS,它将包含在EPEL存储库中。
#1
6
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...
我喜欢工具mytop。它就像* nix世界中的*,但对于MySQL本身而言。它基本上完全符合你的要求......
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:
至于其他优化技术,我个人非常喜欢使用Apache Bench来测试MySQL查询。基本上,我创建了一个简单的脚本,除了执行我想要改进的查询之外什么都不做。然后,我使用不同的并发设置在其上运行AB。好处是您可以了解查询如何扩展,而不仅仅是它运行的速度。谁在乎单个运行的查询是否快速。你真正关心的是负载运行的速度有多快。所以:
<?php
$my = new MySQLi($host, $user, $pass);
$my->query('SELECT foo');
Then, using AB:
然后,使用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.
然后,通过调整并发参数(-c 10),您可以测试不同的并发负载。这样,您可以真正了解您的调整如何影响确切的查询,而不是猜测其他指标。
#2
#3
0
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.
我知道你很久以前就问过你的问题了 - 但我刚发生了这件事,想和你分享另一个工具。 Percona的Baron Schwartz开始使用innotop,这是下一代的mytop。它在服务器状态和查询分析之上添加了先进的InnoDB监控功能。如果您正在运行CentOS,它将包含在EPEL存储库中。