ITPub博客

首页 > 数据库 > MySQL > Mysql 性能调优 一 2

Mysql 性能调优 一 2

原创 MySQL 作者:Michael_DD 时间:2014-12-25 10:29:32 0 删除 编辑
Mysql 性能调优 一   2


查看mysql性能状态开源工具

1. dim_STAT

2. mysqlreport

3. mytop

4. mysqlresource

5. mysql

6. maatkit

7. linux系统自带参数
--iostat
--vmstat
--sar
--top


Mysql压力测试工具

1. mysqlslap 使用办法

mysql> create database mysqlslap;
[root@test1 ~]# mysqlslap -uroot -p123456 --query "select count(*) from mysql.user" -i 20 -c 300
Warning: Using a password on the command line interface can be insecure.
Benchmark
        Average number of seconds to run all queries: 0.287 seconds
        Minimum number of seconds to run all queries: 0.061 seconds
        Maximum number of seconds to run all queries: 1.701 seconds
        Number of clients running queries: 300
        Average number of queries per client: 1

[root@test1 ~]#




mysql> show status like '%connect%';
+-----------------------------------------------+-------+
| Variable_name                                 | Value |
+-----------------------------------------------+-------+
| Aborted_connects                              | 132   |
| Connection_errors_accept                      | 0     |
| Connection_errors_internal                    | 0     |
| Connection_errors_max_connections             | 0     |
| Connection_errors_peer_address                | 0     |
| Connection_errors_select                      | 0     |
| Connection_errors_tcpwrap                     | 0     |
| Connections                                   | 14579 |
| Max_used_connections                          | 75    |
| Performance_schema_session_connect_attrs_lost | 0     |
| Ssl_client_connects                           | 0     |
| Ssl_connect_renegotiates                      | 0     |
| Ssl_finished_connects                         | 0     |
| Threads_connected                             | 1     |
+-----------------------------------------------+-------+
14 rows in set (0.07 sec)

mysql>

最大连接数75.。。。。


 mysql> select * from emp limit 2;

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29500582/viewspace-1379433/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-02-22

  • 博文量
    326
  • 访问量
    2671972