#我们下载mysql的压力测试软件sysbench
root@mysql_test ~]# wget https://downloads.mysql.com/source/sysbench-0.4.12.14.tar.gz
#解压安装
[root@mysql_test ~]# tar xf sysbench-0.4.12.14.tar.gz -C /usr/local/src/
[root@mysql_test ~]# cd !$
cd /usr/local/src/
#安装依赖,然后编译
[root@mysql_test src]# yum install gcc gcc-c++ make -y
[root@mysql_test src]# cd sysbench-0.4.12.14/
[root@mysql_test src]# ./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-
libs=/usr/local/mysql/lib
[root@mysql_test sysbench-0.4.12.14]# make -j8 && make install
[root@mysql_test sysbench-0.4.12.14]# cd sysbench/
[root@mysql_test sysbench]# ln -s sysbench /usr/bin/
#我们现在来测试一下不同的参数的情况下tps性能对比情况,
mysql> show variables like "%query_cache_size%";
+------------------+---------+
| Variable_name | Value |
+------------------+---------+
| query_cache_size | 1048576 |
+------------------+---------+
1 row in set (0.01 sec)
mysql> set global query_cache_size=0;
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> show variables like "%query_cache_size%";
+------------------+-------+
| Variable_name | Value |
+------------------+-------+
| query_cache_size | 0 |
+------------------+-------+
1 row in set (0.00 sec)