LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 03: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, 04:19 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

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

=o)
 
Old 04-30-2012, 05: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, 05:07 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Sounds like there's something wrong in your multithread compilation.
 
Old 04-30-2012, 05: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, 07:11 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 04: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, 04:11 PM   #8
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:50 PM
Ubuntu 10.04.1: All 'nice' levels at 0 altech2k3 Ubuntu 6 10-09-2010 01:32 PM
LXer: Linux: History Of Nice Levels LXer Syndicated Linux News 0 07-19-2007 05:46 PM
setting password levels iamthe Linux - Security 1 09-25-2006 12:41 PM
How to change Nice levels permanently Peppercorn Linux - Software 0 12-21-2005 04:31 AM


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

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration