LoginSignup
1
3

More than 3 years have passed since last update.

stressコマンドでメモリへの負荷をかける

Posted at

stressコマンドインストール

curl -OL  http://ftp.riken.jp/Linux/dag/redhat/el7/en/x86_64/rpmforge/RPMS/stress-1.0.2-1.el7.rf.x86_64.rpm
rpm -ivh stress-1.0.2-1.el7.rf.x86_64.rpm

メモリへ負荷をかける

--vm-keepはメモリを解放せずにkeep。
オプションなしだと、いちいち解放するっぽい?

stress --vm 3 --vm-bytes 256M --vm-keep

AWSEC2の1GBインスタンス

上記コマンドだと、3つのプロセスが256MBを確保する。

image.png

4つ(物理メモリ以上)起動しようとしたら怒られた

stress: info: [8065] dispatching hogs: 0 cpu, 0 io, 4 vm, 0 hdd
stress: FAIL: [8065] (420) <-- worker 8068 got signal 9
stress: WARN: [8065] (422) now reaping child worker processes
stress: FAIL: [8065] (456) failed run completed in 2s
1
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
3