在平台上使用Sysbench测试CPU

发布于 2025-02-05 11:43:39 字数 1374 浏览 2 评论 0原文

我正在尝试编写一个简单的BASH脚本来测试有关CPU性能的系统/机器,并调整为核心计数。我选择了Sysbench,因为它似乎很容易。 但是,我不知道如何正确解释结果。我应该将每秒事件视为主要指标吗? 当我增加MX Prime数量时,它会迅速下降(由于素数较大?)。

脚本

user1@machine1:~$ prc_count=$(nproc --all)
user1@machine1:~$ factor=1
user1@machine1:~$ prc_count=$((prc_count*factor))
user1@machine1:~$ sysbench --test=cpu --num-threads=$prc_count --cpu-max-prime=600000 run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --num-threads is deprecated, use --threads instead
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 128
Initializing random number generator from current time


Prime numbers limit: 600000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   325.66

General statistics:
    total time:                          10.2763s
    total number of events:              3347

Latency (ms):
         min:                                  190.99
         avg:                                  384.71
         max:                                  804.36
         95th percentile:                      383.33
         sum:                              1287614.93

Threads fairness:
    events (avg/stddev):           26.1484/0.67
    execution time (avg/stddev):   10.0595/0.07

I am trying to write a simple bash script to test a system/machine regarding cpu performance, adjusted to core count. I opted for sysbench, since it seemed easy.
However, I dont know how to properly interpret the results. Should I look at events per second as the primary metric?
When I increase the mx prime count it declines rapidly (due to larger primes?).

The script

user1@machine1:~$ prc_count=$(nproc --all)
user1@machine1:~$ factor=1
user1@machine1:~$ prc_count=$((prc_count*factor))
user1@machine1:~$ sysbench --test=cpu --num-threads=$prc_count --cpu-max-prime=600000 run
WARNING: the --test option is deprecated. You can pass a script name or path on the command line without any options.
WARNING: --num-threads is deprecated, use --threads instead
sysbench 1.0.20 (using bundled LuaJIT 2.1.0-beta2)

Running the test with following options:
Number of threads: 128
Initializing random number generator from current time


Prime numbers limit: 600000

Initializing worker threads...

Threads started!

CPU speed:
    events per second:   325.66

General statistics:
    total time:                          10.2763s
    total number of events:              3347

Latency (ms):
         min:                                  190.99
         avg:                                  384.71
         max:                                  804.36
         95th percentile:                      383.33
         sum:                              1287614.93

Threads fairness:
    events (avg/stddev):           26.1484/0.67
    execution time (avg/stddev):   10.0595/0.07

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文