ALWAYS run commands with low priority on unix?
I am not asking how to nice and renice a command on UNIX.
What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?
Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?
many thanks!
~l
unix scheduling priority nice
migrated from stackoverflow.com Jul 21 '10 at 0:35
This question came from our site for professional and enthusiast programmers.
add a comment |
I am not asking how to nice and renice a command on UNIX.
What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?
Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?
many thanks!
~l
unix scheduling priority nice
migrated from stackoverflow.com Jul 21 '10 at 0:35
This question came from our site for professional and enthusiast programmers.
2
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31
add a comment |
I am not asking how to nice and renice a command on UNIX.
What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?
Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?
many thanks!
~l
unix scheduling priority nice
I am not asking how to nice and renice a command on UNIX.
What happens is that on a particular machine into which I frequently log I am only allowed to run long-running processes with low priority (nice 19). Is there a way for all my commands on this machine to run as if I had "niced 19" them?
Inevitably I forget to prefix the command with "nice 19" when I start it, then need to go muck around in ps/top to locate the pid of my resource-hogging process and then renice it. Too much trouble, and I risk annoying the sysadmin; is there a way to do this by default?
many thanks!
~l
unix scheduling priority nice
unix scheduling priority nice
asked Jul 21 '10 at 0:29
laramichaelslaramichaels
3991512
3991512
migrated from stackoverflow.com Jul 21 '10 at 0:35
This question came from our site for professional and enthusiast programmers.
migrated from stackoverflow.com Jul 21 '10 at 0:35
This question came from our site for professional and enthusiast programmers.
2
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31
add a comment |
2
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31
2
2
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31
add a comment |
4 Answers
4
active
oldest
votes
Assuming Bash, if your system supports this feature, place this in your ~/.bashrc
or ~/.profile
:
ulimit -e 19
You can try it from a command line first as a test.
add a comment |
You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.
A line like
@users hard priority 19
sets the default 'niceness' for processes started by user accounts.
add a comment |
This answer assumes your shell is bash
.
Rather than mucking about in ps
or top
, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &
), and then run jobs -l
to get a pid, renice
that pid, and then continue the job's execution via bg
(for BackGround) or fg
(ForeGround).
add a comment |
Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.
Update 2019-02-06: link updated.
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f165921%2falways-run-commands-with-low-priority-on-unix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
Assuming Bash, if your system supports this feature, place this in your ~/.bashrc
or ~/.profile
:
ulimit -e 19
You can try it from a command line first as a test.
add a comment |
Assuming Bash, if your system supports this feature, place this in your ~/.bashrc
or ~/.profile
:
ulimit -e 19
You can try it from a command line first as a test.
add a comment |
Assuming Bash, if your system supports this feature, place this in your ~/.bashrc
or ~/.profile
:
ulimit -e 19
You can try it from a command line first as a test.
Assuming Bash, if your system supports this feature, place this in your ~/.bashrc
or ~/.profile
:
ulimit -e 19
You can try it from a command line first as a test.
answered Jul 21 '10 at 4:23
Dennis WilliamsonDennis Williamson
77.5k14130167
77.5k14130167
add a comment |
add a comment |
You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.
A line like
@users hard priority 19
sets the default 'niceness' for processes started by user accounts.
add a comment |
You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.
A line like
@users hard priority 19
sets the default 'niceness' for processes started by user accounts.
add a comment |
You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.
A line like
@users hard priority 19
sets the default 'niceness' for processes started by user accounts.
You might ask your sysadmin to look into adjusting limits.conf, a configuration file that is part of PAM and is located (on my Ubuntu system) in /etc/security.
A line like
@users hard priority 19
sets the default 'niceness' for processes started by user accounts.
answered Jul 21 '10 at 0:36
JALJAL
1213
1213
add a comment |
add a comment |
This answer assumes your shell is bash
.
Rather than mucking about in ps
or top
, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &
), and then run jobs -l
to get a pid, renice
that pid, and then continue the job's execution via bg
(for BackGround) or fg
(ForeGround).
add a comment |
This answer assumes your shell is bash
.
Rather than mucking about in ps
or top
, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &
), and then run jobs -l
to get a pid, renice
that pid, and then continue the job's execution via bg
(for BackGround) or fg
(ForeGround).
add a comment |
This answer assumes your shell is bash
.
Rather than mucking about in ps
or top
, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &
), and then run jobs -l
to get a pid, renice
that pid, and then continue the job's execution via bg
(for BackGround) or fg
(ForeGround).
This answer assumes your shell is bash
.
Rather than mucking about in ps
or top
, just suspend the process(es) with Ctrl-z if they weren't launched that way (via &
), and then run jobs -l
to get a pid, renice
that pid, and then continue the job's execution via bg
(for BackGround) or fg
(ForeGround).
answered Jul 21 '10 at 0:44
Phil MillerPhil Miller
1013
1013
add a comment |
add a comment |
Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.
Update 2019-02-06: link updated.
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
add a comment |
Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.
Update 2019-02-06: link updated.
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
add a comment |
Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.
Update 2019-02-06: link updated.
Have you tried verynice? It's a bit old but still seems to be a program that might be excellent for your needs.
Update 2019-02-06: link updated.
edited Feb 6 at 17:02
answered Jul 29 '10 at 8:58
Janne PikkarainenJanne Pikkarainen
6,2892329
6,2892329
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
add a comment |
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
Linky no worky no more. What was verynice?
– Jé Queue
Feb 6 at 16:27
1
1
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
Oh wow, 2010 called, it wanted its answer back. Link updated. :)
– Janne Pikkarainen
Feb 6 at 17:01
add a comment |
Thanks for contributing an answer to Super User!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f165921%2falways-run-commands-with-low-priority-on-unix%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
It sounds like this is a sysadmin type question, about using an operating system rather than programming. It may be better suited for superuser.com.
– JAL
Jul 21 '10 at 0:31