sysbench简易使用
2024-10-06 22:17:16
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]#
最新文章
- C语言字符串匹配、goto语句、关机命令使用
- 服务端的GET、POST请求
- iOS深入学习(UITableView:系列1-最基本的东西)
- 《C#并行编程高级教程》第5章 协调数据结构 笔记
- (转载)浅谈javascript的分号
- UESTC_Tournament CDOJ 124
- 『集群』005 Slithice 基于 集群 的 自动容错
- 《http权威指南》读书笔记6
- 谈谈对C#中反射的一些理解和认识(下)
- ant 相关命令
- java 中int与integer的区别
- HNOI2017单旋
- python编码与存储读取数据(数组字典)
- instanceof用法及本质:
- Git教程Git多人协作开发
- c3p0--常见异常
- Lab颜色空间
- HBase中的Client如何路由到正确的RegionServer
- Mac将应用拖入Finder工具栏
- 机器学习算法实现解析——libFM之libFM的训练过程概述
热门文章
- Redis(1.2)Redis的数据结构与基本操作
- 【LOJ】#3014. 「JOI 2019 Final」独特的城市(长链剖分)
- pycharm连接mysql是出现Connection to orm02@127.0.0.1 failed. [08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
- spark on yarn UI界面详解
- Web前端开发JavaScript基础
- 关于jar冲突的解决方向servlet-api
- C99 inline关键字
- springBoot2.x 支持跨域请求配置
- 解决 'mvn' 不是内部或外部命令,也不是可运行的程序 或批处理文件。
- firefox(火狐中的兼容问题总结)