how to *start* a process with a high priority

Notes: 1. by lower priority I mean that the priority number is lower. 2. Distro is RHE

I want to start a daemon with lower than normal priority (ie. say 18 rather than 20) so it will get cpu first in the case of contention.

nice runs commands at increased priority, renice can raise or lower but works for processes that are already running.

I would rather not have to dig the pid out of the process list and then call renice in the start script if I can avoid it since the program does not conveniently produce a pid file.

5
задан 18 October 2016 в 07:16
2 ответа

Просто запустите его с хорошим.

Например:

nice -n 18 /path/to/mydaemon

8
ответ дан 3 December 2019 в 01:09

Кроме того, вы можете использовать команду ionice, чтобы запустить процесс с низким приоритетом io:

nice -n18 ionice -c3 /path/to/mydaemon
2
ответ дан 3 December 2019 в 01:09

Теги

Похожие вопросы