2
4

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.

Linux でプロセスの優先度を指定して実行する

Last updated at Posted at 2014-12-04

はじめに

gcc の makeに非常に時間がかかるし、マシンが重くなるから、なんとかしたいなーって思ってた。
別にすぐできなくていいから、プロセスの優先度を下げれば良いのか!と思いついたので、備忘録。

nice コマンド

とりあえずマニュアルを見る

$ man nice

NAME
       nice - run a program with modified scheduling priority

SYNOPSIS
       nice [OPTION] [COMMAND [ARG]...]

シンプルなマニュアルである。
nice -n 優先度 コマンド コマンドの引数・・・って形で打てば良さそう

優先度は、-20(優先度高)から19(優先度低)まであって、nice コマンド使わないデフォルトは、0で動くようだ。

おわりに

同じマシンで動いている emacs の動作が遅くなってイラっとしてたのが改善されてよかった。
既に動いてるプロセスの優先度の変更には、renice というコマンドがあるみたい。

追記

起動中にプロセスの優先度の確認方法

top コマンド

top コマンドの NI の項目が優先度。
nice で設定した優先度で動いていることが確認できる。

2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?