LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-30-2012, 02:38 PM   #1
ags1
LQ Newbie
 
Registered: Apr 2012
Posts: 19

Rep: Reputation: Disabled
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?
 
Old 04-30-2012, 03:19 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

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

=o)
 
Old 04-30-2012, 04:06 PM   #3
ags1
LQ Newbie
 
Registered: Apr 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
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).
 
Old 04-30-2012, 04:07 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Sounds like there's something wrong in your multithread compilation.
 
Old 04-30-2012, 04:07 PM   #5
ags1
LQ Newbie
 
Registered: Apr 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
And thanks for the reminder about man commandname, that is truly helpful.
 
Old 04-30-2012, 06:11 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by ags1 View Post
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
 
Old 05-02-2012, 03:09 PM   #7
ags1
LQ Newbie
 
Registered: Apr 2012
Posts: 19

Original Poster
Rep: Reputation: Disabled
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.
 
Old 05-02-2012, 03:11 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Quote:
Originally Posted by ags1 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Alarm Clock - Nice Simple App for Setting Reminders and Alarms in Ubuntu LXer Syndicated Linux News 0 11-05-2010 06:50 PM
Ubuntu 10.04.1: All 'nice' levels at 0 altech2k3 Ubuntu 6 10-09-2010 12:32 PM
LXer: Linux: History Of Nice Levels LXer Syndicated Linux News 0 07-19-2007 04:46 PM
setting password levels iamthe Linux - Security 1 09-25-2006 11:41 AM
How to change Nice levels permanently Peppercorn Linux - Software 0 12-21-2005 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration