LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 02-02-2009, 06:30 PM   #1
terminatorul
LQ Newbie
 
Registered: Jan 2007
Posts: 18

Rep: Reputation: 0
How to set mximum allowed CPU time for a process ?


Hello

I am trying to play Heroes Of Might and Magic III (under wine) and after some hours of play my system just rebooted.

I looked for the CPU temp and it was 46 °C.
I know this game uses 100% CPU time, even though it gets more FPS than needed, and I think it over-heats my system.

Is there a way to tell my system that process 3851 can only have 25% CPU time and no more (like the task scheduler to suspend it 10 times per second for 75ms each and only let it run 25ms) ?

Simply setting the process to low priority would not help.

I think it would not be complicated to write a program that suspends and resumes a process many times per second, as long as you know the API. Has anyone had a need for something like this before ?


I have (Slackware) Linux 2.6.24 i686 AMD Sempron.

Thank you,
Timothy Madden
 
Old 02-04-2009, 04:25 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,124

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Have a look at containers (cgroups).
Documented in the source tree.
 
Old 02-04-2009, 04:28 AM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
Hi.

46°C isn't hot. To be honest, it's not even warm for a modern processor. As a data point, my Athlon box runs at about 45 degrees at idle, and can get up to 65 under load.
I'd be more inclined to think that you've got some dodgy RAM, or a failing power supply.

Dave
 
Old 02-05-2009, 06:27 PM   #4
terminatorul
LQ Newbie
 
Registered: Jan 2007
Posts: 18

Original Poster
Rep: Reputation: 0
Thank you for your answers.

How am I supposed to use cgroups ? There is no such command ...
I thought 46 deg. C are not much, but then again during the time my system rebooted, twice, maybe the cooler did its job.
And anyway Heroes III does take up 100% CPU time, as system information shows me, and I had no way to stop it.

Thank you,
Timothy Madden
 
  


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
How can I set CPU max % usage for a process ? lapin3000 Linux - Software 3 12-01-2007 07:51 PM
how to get the accumulate cpu time of a process chrislam Programming 1 10-14-2007 04:02 PM
Set Maximum allowed per-process timer george_7117 Programming 2 03-06-2007 07:25 PM
kjournald process consumed all CPU time tttx Linux - General 1 05-11-2005 03:28 PM
set time limit on allowed user in iptables? luap Linux - Networking 5 03-04-2003 10:55 PM

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

All times are GMT -5. The time now is 07:24 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
Open Source Consulting | Domain Registration