LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-19-2007, 01:44 PM   #1
Revert_To_Saved
LQ Newbie
 
Registered: Oct 2005
Posts: 3

Rep: Reputation: 0
Limit System Resources for a Specific Program


I'm looking for a way to explicitly limit how much cpu percentage a program can have access to. This probably seems a little odd, and normally it wouldn't be a problem, but in this case I'm having issues. Most chess programs, such as gnuchess, are built to use up to 100% of the cpu's capacity to compute moves and such, but on my laptop this pushes the heat up to unacceptable levels. The processor's already underclocked to its lowest setting; I was hoping for some way to limit the program to treat my processor as a 500mhz or something like that.

If anything like this exists, or if you can suggest any other solutions, I'd really appreciate it. I hate not being able to play chess on the go.
 
Old 05-19-2007, 02:11 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Have you tried 'nice-ing' the program? NICE is a level of priority which any given program can have.
19 is VERY NICE (low priority) and -19 is NOT NICE (Hog the machine: high priority).

I'm not absolutely certain this will give you the result you want, but it's worth a try. If you start GNUchess from a console, or from like a desktop icon, use the command like:
nice -n # gnuchess
where the # sign is a number from -19 to 19 and 'gnuchess' is whatever the actual command/path you use to start the game. (try 19 for the maximum effort at nice-ing it -- though *some* things won't run if they are 'too nice') and note -- some 'nice' settings require you to use root priveleges. You may want to start the game as USER, then use ROOT to re-nice the process.

Last edited by GrapefruiTgirl; 05-19-2007 at 02:12 PM.
 
Old 05-19-2007, 09:54 PM   #3
Marsolin
Member
 
Registered: Jul 2005
Posts: 124

Rep: Reputation: 15
cpulimit should do what you are asking for.
 
Old 05-19-2007, 11:29 PM   #4
Revert_To_Saved
LQ Newbie
 
Registered: Oct 2005
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks, cpulimit works perfectly.

And thanks for the reminder about nice values, I had forgotten that. They're coming in handy for some other things I needed done.
 
  


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
limit specific proces to a specific user Tux-Slack Linux - Software 3 02-23-2007 11:38 PM
Limit Browser to specific domains whayford Linux - General 5 05-31-2006 07:49 AM
resources: how to limit process to max. 20% CPU usage alesz Linux - Software 4 03-30-2006 02:49 PM
Want to limit Memory to a specific Process tstaples Linux - General 3 01-26-2005 01:59 PM
How to limit the size of a specific file ericthyred Linux - Software 1 04-15-2004 11:13 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:31 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