Ubuntu 16.04:CPU 压力测试

Ubuntu 16.04:CPU 压力测试

我有Lenovo Thinkpad E531Core i3。我觉得我的机器运行不正常,比如打开应用程序、打开文件到文件,在 Linux 和 Windows 上一切都需要一点额外的时间,但现在我正在使用 ubuntu 16.04。

所以我用了stress-ng

使用以下命令stress-ng --cpu 4 --cpu-method matrixprod --metrics-brief --perf -t 60

我得到了以下结果:

stress-ng: info:  [4717] dispatching hogs: 4 cpu
stress-ng: info:  [4717] cache allocate: default cache size: 3072K
stress-ng: info:  [4717] successful run completed in 60.01s (1 min, 0.01 secs)
stress-ng: info:  [4717] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
stress-ng: info:  [4717]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
stress-ng: info:  [4717] cpu              16728     60.00    220.07      0.48       278.78        75.85
stress-ng: info:  [4717] cpu:
stress-ng: info:  [4717]            486,809,130,288 CPU Cycles                     8.11 B/sec
stress-ng: info:  [4717]            299,665,293,760 Instructions                   4.99 B/sec (0.616 instr. per cycle)
stress-ng: info:  [4717]             23,618,473,352 Cache References               0.39 B/sec
stress-ng: info:  [4717]                155,046,972 Cache Misses                   2.58 M/sec ( 0.66%)
stress-ng: info:  [4717]            340,515,406,760 Stalled Cycles Frontend        5.67 B/sec
stress-ng: info:  [4717]            173,093,935,356 Stalled Cycles Backend         2.88 B/sec
stress-ng: info:  [4717]             36,696,289,676 Branch Instructions            0.61 B/sec
stress-ng: info:  [4717]                289,823,652 Branch Misses                  4.83 M/sec ( 0.79%)
stress-ng: info:  [4717]             22,175,572,704 Bus Cycles                     0.37 B/sec
stress-ng: info:  [4717]            510,047,929,756 Total Cycles                   8.50 B/sec
stress-ng: info:  [4717]                        776 Page Faults Minor             12.93 sec  
stress-ng: info:  [4717]                          0 Page Faults Major              0.00 sec  
stress-ng: info:  [4717]                     22,952 Context Switches             382.46 sec  
stress-ng: info:  [4717]                        188 CPU Migrations                 3.13 sec  
stress-ng: info:  [4717]                          0 Alignment Faults               0.00 sec  

现在我不知道结果是否良好或者是否不明确?

更新

正如@ColinIanKingauthor of stress-ng在答案评论中提到的,结果vmstat 1是:

procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 2  0      0 213980  69832 1450000    0    0   672     0  793 3419 26  2 69  3  0
 1  0      0 213360  69832 1450060    0    0     0   312 1155 3243 30  2 68  0  0
 2  0      0 213420  69848 1450072    0    0     4   120  991 2534 29  2 68  2  0
 1  0      0 213172  69848 1450072    0    0     0     0 1306 2173 28  2 70  0  0
 2  0      0 174192  70008 1465956    0    0  4964    96 2152 8701 29  5 48 18  0
 0  0      0 141592  70136 1467132    0    0  4240     0 1838 6137 15  4 70 11  0
 2  0      0 129532  70136 1466920    0    0   296    12 1718 4069 16  3 80  0  0
 0  0      0 128664  70136 1467084    0    0   128     0 1436 3546 15  3 82  0  0
 1  0      0 138956  70136 1467212    0    0   128     0 1508 3388 14  3 83  0  0
 0  0      0 213120  70152 1452916    0    0  1284   128 1817 6011 23  4 70  4  0
 0  0      0 212920  70152 1452928    0    0     0     0 1075 1948  3  2 95  0  0
 0  0      0 212720  70188 1452640    0    0    24   484 1218 2970  5  2 87  5  0
 0  0      0 212812  70188 1452640    0    0     0     0  361 1161  3  1 96  0  0
 0  0      0 212812  70188 1452640    0    0     0     0  251  554  2  1 98  0  0
 0  0      0 212812  70188 1452512    0    0     0     0  302  830  2  1 97  0  0
 0  0      0 212812  70188 1452512    0    0     0     0  250  552  1  1 98  0  0
 0  0      0 212728  70196 1452512    0    0     0    36  527 1786  6  1 93  1  0
 0  0      0 217416  70196 1447648    0    0     0     0  296  738  2  1 97  0  0
 0  0      0 205140  70196 1459488    0    0     0     0  405 1429  4  2 94  0  0
 0  0      0 205140  70196 1459788    0    0     0    12  499 2010  5  1 94  0  0
 2  0      0 205048  70196 1459820    0    0     0     0 1127 3336 14  3 83  0  0

结果如下free -m

              total        used        free      shared  buff/cache   available
Mem:           3518        1861         280         425        1376         912
Swap:             0  

在此期间,我通过 VLC 播放了一段视频片段。

答案1

您所说的延迟将始终存在。将应用程序或文件从磁盘加载到内存需要一些时间。您可以通过切换到更快的硬盘或固态硬盘来减少此延迟,但无法消除。大容量存储介质的速度一直是一个瓶颈,而且这种情况似乎不会很快改变。如果应用程序在加载完成后运行顺畅,则无需担心。

相关内容