【发布时间】:2019-11-15 18:48:41
【问题描述】:
我想使用 stress-ng 来模拟工作量。最终目标是能够为系统加载不同百分比的不同任务。例如 50% CPU、25% IO 等。
所以我从这个命令开始...
sudo stress-ng -v --taskset 1 --sched fifo --sched-prio 80 --perf --all 2 --ioport 1 --ioport-ops 1000000 --matrix 1 -t 60s
stress-ng: debug: [2077] 2 processors online, 2 processors configured
stress-ng: debug: [2077] sched: setting scheduler class 'fifo', priority 80
stress-ng: info: [2077] dispatching hogs: 1 ioport, 1 matrix
stress-ng: debug: [2077] cache allocate: default cache size: 4096K
stress-ng: debug: [2077] starting stressors
stress-ng: debug: [2077] 2 stressors spawned
stress-ng: debug: [2078] stress-ng-ioport: started [2078] (instance 0)
stress-ng: debug: [2079] stress-ng-matrix: started [2079] (instance 0)
但是当我监控进程 2078 和 2079 时,我注意到只有进程 2078 正在加载 CPU。 Image 1
当我交换 2 个压力源的顺序时...
sudo stress-ng -v --taskset 1 --sched fifo --sched-prio 80 --perf --all 2 --matrix 1 --ioport 1 --ioport-ops 1000000 -t 60s
stress-ng: debug: [2084] 2 processors online, 2 processors configured
stress-ng: debug: [2084] sched: setting scheduler class 'fifo', priority 80
stress-ng: info: [2084] dispatching hogs: 1 matrix, 1 ioport
stress-ng: debug: [2084] cache allocate: default cache size: 4096K
stress-ng: debug: [2084] starting stressors
stress-ng: debug: [2084] 2 stressors spawned
stress-ng: debug: [2085] stress-ng-matrix: started [2085] (instance 0)
stress-ng: debug: [2086] stress-ng-ioport: started [2086] (instance 0)
stress-ng: debug: [2085] stress-ng-matrix using method 'all' (x by y)
只有进程 2085 正在加载 CPU。 Image 2
这表明 2 个压力源不会并行运行。
我怎样才能让压力源并行运行,此外,按比例分配 2 个任务?
是否有更好的开源工具来模拟工作负载?
谢谢!
【问题讨论】:
标签: stress-testing workload stress