龙空技术网

sysbench使用

智明杂谈 400

前言:

此刻你们对“mysql报错1265”都比较看重,姐妹们都需要知道一些“mysql报错1265”的相关内容。那么小编同时在网上收集了一些有关“mysql报错1265””的相关资讯,希望你们能喜欢,同学们快快来学习一下吧!

1 安装

curl -s 复制内容到一个脚本中,然后执行脚本[root@db01 ~]# sh sysbench.sh 然后执行[root@db01 ~]# yum -y install sysbench
2 使用

语法:

sysbench [options]... [testname] [command]

查看对应的lua脚本

[root@db01 ~]# ll /usr/local/share/sysbench/总用量 60-rwxr-xr-x 1 root root  1452 10月 29 2020 bulk_insert.lua-rw-r--r-- 1 root root 14369 10月 29 2020 oltp_common.lua-rwxr-xr-x 1 root root  1290 10月 29 2020 oltp_delete.lua-rwxr-xr-x 1 root root  2415 10月 29 2020 oltp_insert.lua-rwxr-xr-x 1 root root  1265 10月 29 2020 oltp_point_select.lua-rwxr-xr-x 1 root root  1649 10月 29 2020 oltp_read_only.lua-rwxr-xr-x 1 root root  1824 10月 29 2020 oltp_read_write.lua-rwxr-xr-x 1 root root  1118 10月 29 2020 oltp_update_index.lua-rwxr-xr-x 1 root root  1127 10月 29 2020 oltp_update_non_index.lua-rwxr-xr-x 1 root root  1440 10月 29 2020 oltp_write_only.lua-rwxr-xr-x 1 root root  1919 10月 29 2020 select_random_points.lua-rwxr-xr-x 1 root root  2118 10月 29 2020 select_random_ranges.luadrwxr-xr-x 4 root root    49 10月 29 2020 tests

测试

针对oltp事务进行压测(prepare(装载数据)-->run(运行)-->cleanup(清除数据))查看对应oltp脚本的帮助:sysbench '/usr/local/share/sysbench/oltp_insert.lua' help数据准备:sysbench  --test='/usr/local/share/sysbench/oltp_insert.lua' --mysql-host=10.2.4.179 --mysql-port=3306 --mysql-user=lzm --mysql-password=123 --mysql-db=test --table_size=10000000 --tables=1   prepare运行:sysbench  --test='/usr/local/share/sysbench/oltp_insert.lua' --mysql-host=10.2.4.179 --mysql-port=3306 --mysql-user=lzm --mysql-password=123 --mysql-db=test --table_size=10000000 --tables=1   run清除数据:sysbench  --test='/usr/local/share/sysbench/oltp_insert.lua' --mysql-host=10.2.4.179 --mysql-port=3306 --mysql-user=lzm --mysql-password=123 --mysql-db=test --table_size=10000000 --tables=1   cleanup

标签: #mysql报错1265