sysbench简易使用

由于测试需要,需要用到sysbench这个工具。推荐简便使用。

# yum 安装
yum install sysbench

创建数据库

CREATE DATABASE `sbtest`  DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

GRANT ALL PRIVILEGES ON *.* TO 'sbtest'@'%' IDENTIFIED BY 'sbtestpwd';

准备数据

#!/bin/bash
sysbench --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size= --mysql-table-engine=innodb --oltp-tables-count= --mysql-user=sbtest --mysql-password=sbtestpwd --mysql-port= --mysql-host=127.0.0.1 --max-requests= --time= --report-interval= --threads= --oltp-point-selects= --oltp-simple-ranges= --oltp_sum_ranges= --oltp_order_ranges= --oltp_distinct_ranges= --oltp-read-only=on prepare

运行

[root@dba_test_001 scripts]# cat 2run_sysbench.sh
#!/bin/bash
sysbench --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size= --mysql-table-engine=innodb --oltp-tables-count= --mysql-user=sbtest --mysql-password=sbtestpwd --mysql-port= --mysql-host=10.10.117.231 --max-requests= --time= --report-interval= --threads= --oltp-test-mode=complex --oltp-read-only=off run [root@dba_test_001 scripts]#

清理数据

[root@dba_test_001 scripts]# cat 2cleanup_sysbench.sh
#!/bin/bash
sysbench --test=/usr/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size= --mysql-table-engine=innodb --oltp-tables-count= --mysql-user=sbtest --mysql-password=sbtestpwd --mysql-port= --mysql-host=10.10.117.231 --max-requests= --time= --report-interval= --threads= --oltp-test-mode=complex --oltp-read-only=off cleanup
[root@dba_test_001 scripts]#

最新文章

  1. C语言字符串匹配、goto语句、关机命令使用
  2. 服务端的GET、POST请求
  3. iOS深入学习(UITableView:系列1-最基本的东西)
  4. 《C#并行编程高级教程》第5章 协调数据结构 笔记
  5. (转载)浅谈javascript的分号
  6. UESTC_Tournament CDOJ 124
  7. 『集群』005 Slithice 基于 集群 的 自动容错
  8. 《http权威指南》读书笔记6
  9. 谈谈对C#中反射的一些理解和认识(下)
  10. ant 相关命令
  11. java 中int与integer的区别
  12. HNOI2017单旋
  13. python编码与存储读取数据(数组字典)
  14. instanceof用法及本质:
  15. Git教程Git多人协作开发
  16. c3p0--常见异常
  17. Lab颜色空间
  18. HBase中的Client如何路由到正确的RegionServer
  19. Mac将应用拖入Finder工具栏
  20. 机器学习算法实现解析——libFM之libFM的训练过程概述

热门文章

  1. Redis(1.2)Redis的数据结构与基本操作
  2. 【LOJ】#3014. 「JOI 2019 Final」独特的城市(长链剖分)
  3. pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
  4. spark on yarn UI界面详解
  5. Web前端开发JavaScript基础
  6. 关于jar冲突的解决方向servlet-api
  7. C99 inline关键字
  8. springBoot2.x 支持跨域请求配置
  9. 解决 'mvn' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
  10. firefox(火狐中的兼容问题总结)