Mac 10.13.4 - `renice` seems to have no effect
Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
I am trying to test out the renice
command on my Mac, it seems to be having no effect. This is how I'm testing it:
I have a dual core CPU with hyper threading, so I run 6 instances of node -e 'while(1)'
which, combined, max out my CPU. (Alternatively, run while true; do echo running > /dev/null ; done
if you dont have node.)
I then get a PID of one of the node processes, either by the activity monitor application or pgrep
, and then run sudo renice -n 19 -p $PID
.
By looking at the activity monitor application or htop
, the CPU usage of all of the node processes are still equivalent:
My understanding was that the process that I renice
d would have a low priority, and so would not use a significant amount of CPU time when there are other processes using it.
Am I misunderstanding something about renice
? Or is this a bug in Mac OS?
process macintosh
 |Â
show 2 more comments
up vote
-1
down vote
favorite
I am trying to test out the renice
command on my Mac, it seems to be having no effect. This is how I'm testing it:
I have a dual core CPU with hyper threading, so I run 6 instances of node -e 'while(1)'
which, combined, max out my CPU. (Alternatively, run while true; do echo running > /dev/null ; done
if you dont have node.)
I then get a PID of one of the node processes, either by the activity monitor application or pgrep
, and then run sudo renice -n 19 -p $PID
.
By looking at the activity monitor application or htop
, the CPU usage of all of the node processes are still equivalent:
My understanding was that the process that I renice
d would have a low priority, and so would not use a significant amount of CPU time when there are other processes using it.
Am I misunderstanding something about renice
? Or is this a bug in Mac OS?
process macintosh
3
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
3
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams , @Kusalananda , I can add morenode
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show this
â Dylanthepiguy
May 8 at 7:53
1
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26
 |Â
show 2 more comments
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
I am trying to test out the renice
command on my Mac, it seems to be having no effect. This is how I'm testing it:
I have a dual core CPU with hyper threading, so I run 6 instances of node -e 'while(1)'
which, combined, max out my CPU. (Alternatively, run while true; do echo running > /dev/null ; done
if you dont have node.)
I then get a PID of one of the node processes, either by the activity monitor application or pgrep
, and then run sudo renice -n 19 -p $PID
.
By looking at the activity monitor application or htop
, the CPU usage of all of the node processes are still equivalent:
My understanding was that the process that I renice
d would have a low priority, and so would not use a significant amount of CPU time when there are other processes using it.
Am I misunderstanding something about renice
? Or is this a bug in Mac OS?
process macintosh
I am trying to test out the renice
command on my Mac, it seems to be having no effect. This is how I'm testing it:
I have a dual core CPU with hyper threading, so I run 6 instances of node -e 'while(1)'
which, combined, max out my CPU. (Alternatively, run while true; do echo running > /dev/null ; done
if you dont have node.)
I then get a PID of one of the node processes, either by the activity monitor application or pgrep
, and then run sudo renice -n 19 -p $PID
.
By looking at the activity monitor application or htop
, the CPU usage of all of the node processes are still equivalent:
My understanding was that the process that I renice
d would have a low priority, and so would not use a significant amount of CPU time when there are other processes using it.
Am I misunderstanding something about renice
? Or is this a bug in Mac OS?
process macintosh
edited May 17 at 9:44
asked May 8 at 5:56
Dylanthepiguy
1085
1085
3
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
3
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams , @Kusalananda , I can add morenode
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show this
â Dylanthepiguy
May 8 at 7:53
1
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26
 |Â
show 2 more comments
3
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
3
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams , @Kusalananda , I can add morenode
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show this
â Dylanthepiguy
May 8 at 7:53
1
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26
3
3
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
3
3
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams , @Kusalananda , I can add more
node
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show thisâ Dylanthepiguy
May 8 at 7:53
@IgnacioVazquez-Abrams , @Kusalananda , I can add more
node
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show thisâ Dylanthepiguy
May 8 at 7:53
1
1
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26
 |Â
show 2 more comments
1 Answer
1
active
oldest
votes
up vote
1
down vote
accepted
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4.
I wrote a small C program called looper which did some basic maths in an infinite loop:
#include <stdio.h>
int main()
unsigned long long prev = 0;
unsigned long long current = 1;
unsigned long long total = 0;
while(1)
total = current + prev;
prev = current;
current = total;
printf("%llun", total);
I ran multiple copies of this on my FreeBSD box and examined them using htop(1)
. Using renice(8)
I could see the Nice value being incremented, the Priority value being incremented, and the CPU percentage decreasing - expected behavior.
I ran the same program on macOS 10.13.4 and repeated the process. While I could see the Nice value incrementing, the Priority value and CPU percentage remained consistent.
I wonder if it is a bug, I've not had cause to look this closely at Nice values in macOS before - the behavior has been close enough to what I expected that I've not been inclined to investigate.
If you have a developer account it would be worth reporting this to Apple.
1
Thanks! I have been able to replicate that the priority has not been increased usingps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!
â Dylanthepiguy
May 18 at 8:58
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4.
I wrote a small C program called looper which did some basic maths in an infinite loop:
#include <stdio.h>
int main()
unsigned long long prev = 0;
unsigned long long current = 1;
unsigned long long total = 0;
while(1)
total = current + prev;
prev = current;
current = total;
printf("%llun", total);
I ran multiple copies of this on my FreeBSD box and examined them using htop(1)
. Using renice(8)
I could see the Nice value being incremented, the Priority value being incremented, and the CPU percentage decreasing - expected behavior.
I ran the same program on macOS 10.13.4 and repeated the process. While I could see the Nice value incrementing, the Priority value and CPU percentage remained consistent.
I wonder if it is a bug, I've not had cause to look this closely at Nice values in macOS before - the behavior has been close enough to what I expected that I've not been inclined to investigate.
If you have a developer account it would be worth reporting this to Apple.
1
Thanks! I have been able to replicate that the priority has not been increased usingps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!
â Dylanthepiguy
May 18 at 8:58
add a comment |Â
up vote
1
down vote
accepted
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4.
I wrote a small C program called looper which did some basic maths in an infinite loop:
#include <stdio.h>
int main()
unsigned long long prev = 0;
unsigned long long current = 1;
unsigned long long total = 0;
while(1)
total = current + prev;
prev = current;
current = total;
printf("%llun", total);
I ran multiple copies of this on my FreeBSD box and examined them using htop(1)
. Using renice(8)
I could see the Nice value being incremented, the Priority value being incremented, and the CPU percentage decreasing - expected behavior.
I ran the same program on macOS 10.13.4 and repeated the process. While I could see the Nice value incrementing, the Priority value and CPU percentage remained consistent.
I wonder if it is a bug, I've not had cause to look this closely at Nice values in macOS before - the behavior has been close enough to what I expected that I've not been inclined to investigate.
If you have a developer account it would be worth reporting this to Apple.
1
Thanks! I have been able to replicate that the priority has not been increased usingps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!
â Dylanthepiguy
May 18 at 8:58
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4.
I wrote a small C program called looper which did some basic maths in an infinite loop:
#include <stdio.h>
int main()
unsigned long long prev = 0;
unsigned long long current = 1;
unsigned long long total = 0;
while(1)
total = current + prev;
prev = current;
current = total;
printf("%llun", total);
I ran multiple copies of this on my FreeBSD box and examined them using htop(1)
. Using renice(8)
I could see the Nice value being incremented, the Priority value being incremented, and the CPU percentage decreasing - expected behavior.
I ran the same program on macOS 10.13.4 and repeated the process. While I could see the Nice value incrementing, the Priority value and CPU percentage remained consistent.
I wonder if it is a bug, I've not had cause to look this closely at Nice values in macOS before - the behavior has been close enough to what I expected that I've not been inclined to investigate.
If you have a developer account it would be worth reporting this to Apple.
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4.
I wrote a small C program called looper which did some basic maths in an infinite loop:
#include <stdio.h>
int main()
unsigned long long prev = 0;
unsigned long long current = 1;
unsigned long long total = 0;
while(1)
total = current + prev;
prev = current;
current = total;
printf("%llun", total);
I ran multiple copies of this on my FreeBSD box and examined them using htop(1)
. Using renice(8)
I could see the Nice value being incremented, the Priority value being incremented, and the CPU percentage decreasing - expected behavior.
I ran the same program on macOS 10.13.4 and repeated the process. While I could see the Nice value incrementing, the Priority value and CPU percentage remained consistent.
I wonder if it is a bug, I've not had cause to look this closely at Nice values in macOS before - the behavior has been close enough to what I expected that I've not been inclined to investigate.
If you have a developer account it would be worth reporting this to Apple.
answered May 18 at 8:52
forquare
2,20531228
2,20531228
1
Thanks! I have been able to replicate that the priority has not been increased usingps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!
â Dylanthepiguy
May 18 at 8:58
add a comment |Â
1
Thanks! I have been able to replicate that the priority has not been increased usingps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!
â Dylanthepiguy
May 18 at 8:58
1
1
Thanks! I have been able to replicate that the priority has not been increased using
ps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!â Dylanthepiguy
May 18 at 8:58
Thanks! I have been able to replicate that the priority has not been increased using
ps -o pid,comm,pri,nice -p $(pgrep node)
. I've reported this to apple again on their developer bug reporter. Hopefully we get a response in any reasonable amount of time!â Dylanthepiguy
May 18 at 8:58
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f442470%2fmac-10-13-4-renice-seems-to-have-no-effect%23new-answer', 'question_page');
);
Post as a guest
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
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
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
3
You have four cores, and you have four running processes. Why would each not get their own core?
â Ignacio Vazquez-Abrams
May 8 at 5:58
3
A nice process would still get 100% of a CPU if it was available to it.
â Kusalananda
May 8 at 6:10
@IgnacioVazquez-Abrams No, I have 2 cores, with hyperthreading. Hyperthreading gives, on average is about 30% of a core's worth of performance. Therefore 4 threads may not (on avg) be able to run in parallel.
â Dylanthepiguy
May 8 at 7:52
@IgnacioVazquez-Abrams , @Kusalananda , I can add more
node
processes, e.g. 6, and the same effect is produced - same cpu usage. I have edited my question to show thisâ Dylanthepiguy
May 8 at 7:53
1
Running some rudimentary tests IâÂÂm seeing this too on 10.13.4. The curious thing is that on my FreeBSD system the Priority of a process shifts with the niceness. On macOS the Priority remains the same, so I wonder if it is a bug. Might be worth flagging to Apple if anyone has an appropriate account.
â forquare
May 18 at 8:26