OS sysbench压力测试

环境

OS: centos7.x

sysbench安装

1. 安装阿里云 yum 源

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2. 安装sysbench工具

yum -y install sysbench

3. 查看版本

sysbench --version
CPU测试
sysbench cpu --cpu-max-prime=20000 run
sysbench cpu --cpu-max-prime=20000 --threads=12 --events=10000 --debug=on run

memory测试
sysbench --threads=12 --events=10000 memory --memory-block-size=8K --memory-total-size=100G --memory-access-mode=seq run

文件IO测试

1.创建文件

sysbench --threads=12 --events=10000 fileio --file-total-size=1G --file-test-mode=rndrw prepare

2.测试文件读写

sysbench --threads=12 --events=10000 fileio --file-total-size=1G --file-test-mode=rndrw run

3.清除文件

sysbench --threads=12 --events=10000 fileio --file-total-size=1G --file-test-mode=rndrw clean

原文地址:https://www.cnblogs.com/youngerger/p/12605641.html