WRITELOOP

STRESS-NG AND IOPING FOR BENCHMARKING A MACHINE

2018 August 4

stress-ng

(you can add -v to all stress-ng examples below to have more detailed debugging info)

List all stressors available:

$ stress-ng –stressors

Most relevant stressors:

  • cpu: create x processes that will be processed by the cpu.
  • io: each process will make multiple calls to the sync() system call (that flushes memory contents to disk).
  • hdd: each process will make calls to the write() system call to write files on disk.
  • vm: each process will allocate memory on the server

CPU:

To run 4 cpu stressors exercising the CPU by sequentially working through all the different CPU stress methods: $ stress-ng –cpu 4 –timeout 60s –metrics-brief

IO:

To run 4 io stressors that will flush memory contents to disk: $ stress-ng –io 4 –timeout 10s –metrics-brief

HDD (disks):

To run 5 hdd stressors and stop after 100000 bogo operations $ stress-ng –hdd 5 –hdd-ops 100000 –metrics-brief To run 10 hdd stressors to write 2GB files on disk: $ stress-ng –hdd 10 –hdd-bytes 2g –timeout 30s –metrics-brief

VM (memory):

To run 2 vm stressors that will allocate 128MB each and the total memory (256MB) $ stress-ng –vm 2 –vm-bytes 128M –timeout 30s –metrics-brief To run 1 vm stressor that uses 75% of memory using all the vm stressors for 10 minutes $ stress-ng –vm 1 –vm-bytes 75% –vm-method all –verify -t 10m -v

Combined - E.g. CPU, IO and VM:

To run 4 cpu stressors, 4 I/O stressors and 1 virtual memory stressor using 1GB of virtual memory for one minute: $ stress-ng –cpu 4 –io 4 –vm 1 –vm-bytes 1G –timeout 60s –metrics-brief

References

http://www.dicas-l.com.br/arquivo/efetuando_stress-test_em_servidores_unix..php#.W2WwOp_Q9hE https://www.tecmint.com/linux-cpu-load-stress-test-with-stress-ng-tool/2/ https://www.cyberciti.biz/faq/stress-test-linux-unix-server-with-stress-ng/ https://www.cyberciti.biz/faq/linux-freebsd-openbsd-macosx-find-disk-io-latency-with-ioping/