虽然yabs、LemonBench、融合怪等脚本都可以测试云主机的内存读写速度。但是如果在已经安装好的生产环境中,木准企服学习分享小白还是不建议使用一键脚本测试。这些脚本大部分都是安全的,但是也不排除有风险的脚本。今天教大家使用Debian源中的软件来测试云服务器内存读写速度。
需要用到的软件
sysbench
安装教程
ssh中运行:
apt-get install sysbench
使用教程
1、测试内存读取速度
sysbench --test=memory --memory-block-size=1M --memory-total-size=100G --memory-oper=read run
示例:
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1024KiB
total size: 10240MiB
operation: read
scope: global
Initializing worker threads...
Threads started!
Total operations: 10240 (15526.64 per second)
10240.00 MiB transferred (15526.64 MiB/sec)
General statistics:
total time: 0.6570s
total number of events: 10240
Latency (ms):
min: 0.05
avg: 0.06
max: 1.15
95th percentile: 0.08
sum: 648.86
Threads fairness:
events (avg/stddev): 10240.0000/0.00
execution time (avg/stddev): 0.6489/0.00
2、测试内存写入速度
sysbench --test=memory --memory-block-size=1M --memory-total-size=100G run
示例:
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
sysbench 1.0.20 (using system LuaJIT 2.1.0-beta3)
Running the test with following options:
Number of threads: 1
Initializing random number generator from current time
Running memory speed test with the following options:
block size: 1024KiB
total size: 10240MiB
operation: write
scope: global
Initializing worker threads...
Threads started!
Total operations: 10240 ( 9550.84 per second)
10240.00 MiB transferred (9550.84 MiB/sec)
General statistics:
total time: 1.0691s
total number of events: 10240
Latency (ms):
声明:请谨记木准企服唯一官方电话:18300003210,请勿轻信其他其他联系方式,一对一入口。如遇诈骗请及时联系我们将配合处理!
原文地址:Debian/Ubuntu系统测试内存读写速度(非脚本机房服务器)发布于2024-05-12 01:04:01