Mysql 效能調優 一 2

Michael_DD發表於2014-12-25
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部落格 ” ,連結:http://blog.itpub.net/29500582/viewspace-1379433/,如需轉載,請註明出處,否則將追究法律責任。

相關文章