systembench 1.0.19龙芯版-编译安装说明

源码(龙芯版)下载链接

https://gitee.com/cn-loongson/sysbench/repository/archive/v1.0.19-loongson.zip

环境依赖

安装mysql-8.0.12:
安装方法参考:https://www.showdoc.cc/p/fb985f8c64451132108da8ee06aad24e
安装依赖库:
yum install atuomake libtool

生成Makefile

./autogen.sh
./configure --with-mysql-includes=/usr/local/mysql-8.0.12/include/mysql/ --with-mysql-libs=/usr/local/mysql-8.0.12/lib/mysql/

编译&安装

make -j4
make install

设置运行库依赖

export LD_LIBRARY_PATH=/usr/local/mysql-8.0.12/lib/mysql/

sysbench 使用

测试1: CPU测试:

测试命令:
sysbench --threads=20 --events=10000 --debug=on --test=cpu --cpu-max-prime=20000 run

结果参考:
CPU speed:
events per second: 1501.14

General statistics:
total time: 6.6501s
total number of events: 10000

Latency (ms):
min: 1.97
avg: 13.21
max: 99.39
95th percentile: 38.25
sum: 132081.65

Threads fairness:
events (avg/stddev): 500.0000/133.87
execution time (avg/stddev): 6.6041/0.03

测试2: 内存测试

2.1 测试8K顺序分配:
测试命令:
sysbench --threads=12 --events=10000 --test=memory --memory-block-size=8K --memory-total-size=100G --memory-access-mode=seq run

结果参考:
General statistics:
total time: 10.0004s
total number of events: 9331047

Latency (ms):
min: 0.00
avg: 0.01
max: 70.32
95th percentile: 0.00
sum: 77527.53

Threads fairness:
events (avg/stddev): 777587.2500/23327.39
execution time (avg/stddev): 6.4606/0.15

2.2 测试8K随机分配。
测试命令:
sysbench --threads=12 --events=10000 --test=memory --memory-block-size=8K --memory-total-size=100G --memory-access-mode=rnd run

结果参考:
Total operations: 1020905 (101982.94 per second)

7975.82 MiB transferred (796.74 MiB/sec)

General statistics:
total time: 10.0006s
total number of events: 1020905

Latency (ms):
min: 0.03
avg: 0.11
max: 50.82
95th percentile: 0.04
sum: 115251.34

Threads fairness:
events (avg/stddev): 85075.4167/2103.75
execution time (avg/stddev): 9.6043/0.07

测试3: 文件io测试

测试准备:
sysbench --threads=12 --events=10000 fileio --file-total-size=3G --file-test-mode=rndrw prepare
测试执行:
sysbench --threads=12 --events=10000 fileio --file-total-size=3G --file-test-mode=rndrw run
结果参考:
File operations:
reads/s: 3388.67
writes/s: 2250.57
fsyncs/s: 9145.82

Throughput:
read, MiB/s: 52.95
written, MiB/s: 35.17

General statistics:
total time: 0.7710s
total number of events: 10000

Latency (ms):
min: 0.00
avg: 0.87
max: 19.40
95th percentile: 4.03
sum: 8680.66

Threads fairness:
events (avg/stddev): 833.3333/37.71
execution time (avg/stddev): 0.7234/0.01
测试清理
sysbench --threads=12 --events=10000 fileio --file-total-size=3G --file-test-mode=rndrw cleanup

测试4. 锁测试

测试命令:
sysbench --threads=12 mutex --mutex-num=1024 --mutex-locks=10000 --mutex-loops=10000 run

结果参考:
General statistics:
total time: 0.4722s
total number of events: 12

Latency (ms):
min: 156.11
avg: 339.19
max: 471.94
95th percentile: 450.77
sum: 4070.31

Threads fairness:
events (avg/stddev): 1.0000/0.00
execution time (avg/stddev): 0.3392/0.10

测试5. 线程测试

测试命令:
sysbench threads --num-threads=64 --thread-yields=100 --thread-locks=2 run

结果参考:
General statistics:
total time: 10.0113s
total number of events: 85412

Latency (ms):
min: 0.11
avg: 7.50
max: 393.88
95th percentile: 51.94
sum: 640186.28

Threads fairness:
events (avg/stddev): 1334.5625/118.43
execution time (avg/stddev): 10.0029/0.00

测试6. OLTP测试

创建数据库
/usr/local/mysql-8.0.12/bin/mysql -uroot -p
create database sbtest;
create user ‘sbtest’@‘127.0.0.1’ identified by ‘sbtest’;
grant all privileges on . to ‘sbtest’@‘127.0.0.1’;
flush privileges;
exit;

测试准备:
sysbench --test= /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=10000 --mysql-table-engine=innodb --oltp-tables-count=10 --mysql-user=sbtest --mysql-password=sbtest --mysql-port=3306 --mysql-host=127.0.0.1 --max-requests=0 --time=10 --report-interval=1 --threads=10 --oltp-point-selects=1 --oltp-simple-ranges=0 --oltp_sum_ranges=0 --oltp_order_ranges=0 --oltp_distinct_ranges=0 --oltp-read-only=on prepare

测试执行:
sysbench --test= /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=10000 --mysql-table-engine=innodb --oltp-tables-count=10 --mysql-user=sbtest --mysql-password=sbtest --mysql-port=3306 --mysql-host=127.0.0.1 --max-requests=0 --time=10 --report-interval=1 --threads=10 --oltp-point-selects=1 --oltp-simple-ranges=0 --oltp_sum_ranges=0 --oltp_order_ranges=0 --oltp_distinct_ranges=0 --oltp-read-only=on run

测试清理:
sysbench --test= /usr/local/share/sysbench/tests/include/oltp_legacy/oltp.lua --oltp-table-size=10000 --mysql-table-engine=innodb --oltp-tables-count=10 --mysql-user=sbtest --mysql-password=sbtest --mysql-port=3306 --mysql-host=127.0.0.1 --max-requests=0 --time=10 --report-interval=1 --threads=10 --oltp-point-selects=1 --oltp-simple-ranges=0 --oltp_sum_ranges=0 --oltp_order_ranges=0 --oltp_distinct_ranges=0 --oltp-read-only=on cleanup

删除数据库
/usr/local/mysql-8.0.12/bin/mysql -uroot -p
SQL>drop database sbtest;

结果参考:
[ 1s ] thds: 10 tps: 3208.99 qps: 9637.87 (r/w/o: 3212.96/0.00/6424.92) lat (ms,95%): 9.91 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 10 tps: 5103.81 qps: 15312.44 (r/w/o: 5103.81/0.00/10208.63) lat (ms,95%): 8.90 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 10 tps: 5045.26 qps: 15135.79 (r/w/o: 5046.25/0.00/10089.54) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 10 tps: 5129.07 qps: 15387.21 (r/w/o: 5128.08/0.00/10259.13) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 10 tps: 5160.37 qps: 15483.15 (r/w/o: 5161.39/0.00/10321.76) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 6s ] thds: 10 tps: 5174.79 qps: 15515.37 (r/w/o: 5169.79/0.00/10345.58) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 7s ] thds: 10 tps: 5214.44 qps: 15651.32 (r/w/o: 5218.44/0.00/10432.88) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 8s ] thds: 10 tps: 5264.83 qps: 15792.50 (r/w/o: 5264.83/0.00/10527.67) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 9s ] thds: 10 tps: 5060.96 qps: 15184.89 (r/w/o: 5061.96/0.00/10122.93) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
[ 10s ] thds: 10 tps: 5199.95 qps: 15603.82 (r/w/o: 5201.94/0.00/10401.88) lat (ms,95%): 8.74 err/s: 0.00 reconn/s: 0.00
SQL statistics:
queries performed:
read: 49629
write: 0
other: 99258
total: 148887
transactions: 49629 (4946.99 per sec.)
queries: 148887 (14840.97 per sec.)
ignored errors: 0 (0.00 per sec.)
reconnects: 0 (0.00 per sec.)

General statistics:
total time: 10.0226s
total number of events: 49629

Latency (ms):
min: 0.63
avg: 2.01
max: 447.19
95th percentile: 8.74
sum: 99748.38

Threads fairness:
events (avg/stddev): 4962.9000/223.74
execution time (avg/stddev): 9.9748/0.00

官方参考:

github 官方版本(非龙芯版)下载链接:
https://github.com/akopytov/sysbench

你可能感兴趣的:(systembench 1.0.19龙芯版-编译安装说明)