16
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

プロセスのCPU使用率を制限できるcpulimit

Last updated at Posted at 2015-01-11

バッチ処理にCPU100%使われると困るときとか使えそう
OSXにはないみたい。残念

Install

@ Amazon Linux

$ sudo yum --enablerepo=epel -y install cpulimit

Example

loop.rb
loop{ rand(100) }

loopスクリプトをCPU使用率5%で回す。

$ cpulimit -l 5 ruby /home/ec2-user/bin/loop.rb

バックグラウンドで動いて欲しいし、出力しないで欲しいなら

$ nohup cpulimit -l 5 ruby /home/ec2-user/bin/loop.rb  > /dev/null &
16
12
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
16
12

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?