LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Setting nice levels in ubuntu 11.10? (https://www.linuxquestions.org/questions/linux-newbie-8/setting-nice-levels-in-ubuntu-11-10-a-942612/)

ags1 04-30-2012 02:38 PM

Setting nice levels in ubuntu 11.10?
 
I am trying to write an intensive application on Windows and Linux. When I test on Linux the CPU performance shows as being one tenth that of the performance levels on my similar Windows machine. Iḿ guessing that the problem might be related to the nice settings which I can see are all set to 0 for all processes - I suppose this prevents my app from claiming most of the system resources.

Unfortunately attempting to change the nice levels in System Monitor just gives a Permission Denied message.

Any suggestions?

Tinkster 04-30-2012 03:19 PM

You can only renice as root; try from the command-line.
man renice for all the gory details.

=o)

ags1 04-30-2012 04:06 PM

Thank you, I eventually figured out

sudo renice -5 processid

It did not solve my problem unfortunately. I see bizarrely a factor of 20 difference between a single thread and a multithread approach. Two cores should not give me more than a factor of 3 or 4 (assuming the first thread shares a core with other processes).

suicidaleggroll 04-30-2012 04:07 PM

Sounds like there's something wrong in your multithread compilation.

ags1 04-30-2012 04:07 PM

And thanks for the reminder about man commandname, that is truly helpful.

Tinkster 04-30-2012 06:11 PM

Quote:

Originally Posted by ags1 (Post 4667033)
Thank you, I eventually figured out

sudo renice -5 processid

It did not solve my problem unfortunately. I see bizarrely a factor of 20 difference between a single thread and a multithread approach. Two cores should not give me more than a factor of 3 or 4 (assuming the first thread shares a core with other processes).

I'd be happy to move your thread to programming if you want to disclose some
of your source to discuss your work w/ other coders.


Cheers,
Tink

ags1 05-02-2012 03:09 PM

Thanks. I suffered a brain failiure and posted pretty much the same question in the prgramming forum, with a bit of source code. By the way, I discovered the nice command, but that also seems to have had no effect on my results (nice, if I understand it right, lets me set the priority of a process when I start it). -19 did nothing.

suicidaleggroll 05-02-2012 03:11 PM

Quote:

Originally Posted by ags1 (Post 4668794)
Thanks. I suffered a brain failiure and posted pretty much the same question in the prgramming forum, with a bit of source code. By the way, I discovered the nice command, but that also seems to have had no effect on my results (nice, if I understand it right, lets me set the priority of a process when I start it). -19 did nothing.

The nice level will only have an effect if multiple processes are competing for processor time. If your application is the only one using any processor time, you can give it any nice value you want and it won't change anything.


All times are GMT -5. The time now is 11:35 PM.