In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the installation of sysbench and MySQL stress test handouts, which involves things, from theoretical knowledge to learn, there are many books, literature for everyone to refer to, from a practical point of view, accumulated years of practical experience can be shared with you.
1. Install sysbench
[root@benchserver ~]# yum install sysbench
[root@benchserver ~]# rpm -ql sysbench-1.0.17-2.el7.x86_64 | grep lua$
sysbench is written using lua scripts, so the final tests all call lua scripts.
[root@benchserver ~]# sysbench --help
There are not many parameters in actual use, and the core parameters are as follows:
General options:
--config-file=FILENAME File containing command line options
--threads=N number of threads to use [1]
--time=N limit for total execution time in seconds [10]
--report-interval=N periodically report intermediate statistics with a specified interval in seconds.
--db-driver=STRING specifies database driver to use [mysql]
Compiled-in database drivers:
mysql - MySQL driver
pgsql - PostgreSQL driver
mysql options:
--mysql-host=[LIST,...] MySQL server host [localhost]
--mysql-port=[LIST,...] MySQL server port [3306]
--mysql-user=STRING MySQL user [sbtest]
--mysql-password=STRING MySQL password []
--mysql-db=STRING MySQL database name [sbtest]
2. MySQL database Create an account for stress testing
(root@localhost 18:38) [(none)]> create user 'admin'@'10.9.82.187' identified by 'oracle';
(root@localhost 18:39) [(none)]> flush privileges;
(root@localhost 18:39) [(none)]> create database sbtest;
(root@localhost 18:39) [(none)]> grant all on sbtest.* to 'admin'@'10.9.82.187';
3. Pressure Test Host Test Remote Login
[root@benchserver ~]# mysql -h 10.9.59.32 -u admin -poracle -D sbtest
4. Create a stress test script
[root@benchserver ~]# mkdir sysbench
[root@benchserver ~]# cd sysbench/
[root@benchserver sysbench]# vi mysql_config
mysql-host=10.9.59.32
mysql-port=3306
mysql-user=admin
mysql-password=oracle
mysql-db=sbtest
time=6000
threads=8
report-interval=1
db-driver=mysql
5. data initialization
[root@benchserver sysbench]# sysbench --config-file=mysql_config oltp_point_select --tables=16 --table-size=100000 prepare
prepare for initialization test
6. stress tests
[root@benchserver sysbench]# sysbench --config-file=mysql_config oltp_point_select --tables=16 --table-size=100000 run | tee oltp_point_select.rpt
run is the actual pressure test
Initializing worker threads...
Threads started!
[ 1s ] thds: 16 tps: 25021.07 qps: 25021.07 (r/w/o: 25021.07/0.00/0.00) lat (ms,95%): 0.90 err/s: 0.00 reconn/s: 0.00
[ 24s ] thds: 16 tps: 26823.29 qps: 26823.29 (r/w/o: 26823.29/0.00/0.00) lat (ms,95%): 0.84 err/s: 0.00 reconn/s: 0.00
Read the above installation sysbench and MySQL stress test handout introduction, I hope to give you some help in the actual application. Due to the limited space of this article, it is inevitable that there will be deficiencies and needs to be supplemented. You can continue to pay attention to the industry information section and regularly update the industry news and knowledge. If you need more professional answers, you can contact our 24-hour pre-sales service on the official website to help you answer questions at any time.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.