[Linux] Stress

stress 설치 #

  • stress는 다양한 스트레스 테스트를 지원하는 도구
1apt install -y stress

stress 옵션 #

 1Usage: stress [OPTION [ARG]] ...
 2 -?, --help         show this help statement
 3     --version      show version statement
 4 -v, --verbose      be verbose
 5 -q, --quiet        be quiet
 6 -n, --dry-run      show what would have been done
 7 -t, --timeout N    timeout after N seconds
 8     --backoff N    wait factor of N microseconds before work starts
 9 -c, --cpu N        spawn N workers spinning on sqrt()
10 -i, --io N         spawn N workers spinning on sync()
11 -m, --vm N         spawn N workers spinning on malloc()/free()
12     --vm-bytes B   malloc B bytes per vm worker (default is 256MB)
13     --vm-stride B  touch a byte every B bytes (default is 4096)
14     --vm-hang N    sleep N secs before free (default none, 0 is inf)
15     --vm-keep      redirty memory instead of freeing and reallocating
16 -d, --hdd N        spawn N workers spinning on write()/unlink()
17     --hdd-bytes B  write B bytes per hdd worker (default is 1GB)

Example #

1stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 10s

CPU 부하 #

1stress -c <Core 수>

Memory 부하 #

  • 사용할 크기의 단위 : b(byte) ,k(killo byte) , m(mega byte) , g(giga byte)
1stress –vm <프로세스 수> –vm-bytes <사용할 크기>
2ex)stress -vm 2 –vm-bytes 2048m

HDD write 부하 #

1stress –hdd <write에 사용할 worker 수> –hdd-bytes <사용할 크기>
2ex) stress –hdd 3 -hdd-bytes 1024m

I/O 부하 #

1stress -i <sync를 사용하여 i/o 부하를 발생 시킬 worker의수>
Advertisement