mersenneforum.org Limit/throttle CPU usage (110% is too much!)
 Register FAQ Search Today's Posts Mark Forums Read

 2011-10-05, 20:55 #12 kladner     "Kieren" Jul 2011 In My Own Galaxy! 2×3×1,693 Posts Changing threads I've decided that it would be more appropriate to continue my comments at the thread mentioned above. http://www.mersenneforum.org/showthread.php?t=13152
 2011-12-20, 16:00 #13 tichy   Nov 2010 22×19 Posts I know the original problem was related to windows, but months ago when I was using VPS services for mprime I needed to limit CPU usage on linux. There is a utility doing this: cpulimit (http://cpulimit.sourceforge.net/) and it does wonders - just in case someone ever needs this information here.
2013-02-09, 05:03   #14
mykhal

Feb 2013

18 Posts

Quote:
 Originally Posted by tichy ... I needed to limit CPU usage on linux. There is a utility doing this: cpulimit ... and it does wonders ...
how do you use mprime with cpulimit? for me, the mprime stops entirely, even when cpulimit is applied only for the worker threads. after SIGSTOP signal, i see that mprime is stopped (same way like if you stopped it with ^Z). SIGCONT does not recover it (its CPU usage is still 0), even after bg command. it can be recoverer with fg command. but it all means the cpulimit does not throttle it, it just stops it.

 2013-10-23, 21:01 #15 TrdH   Oct 2013 7 Posts mprime - Limit cpu usage on ubuntu I managed to reduce cpu usage for mprime on ubuntu. Start mprime in one terminal mprime -m I replaced 'qchess' with 'mprime' using the script in another terminal from http://www.linuxquestions.org/questi...-usage-429923/ This too stops mprime but I run the following commands to wake up mprime for a limited time - replace 'mprime_jobid' with the reported job id for mprime: while true; do fg %mprime_jobid 2>/dev/null; sleep 0.5; done; It works for me and htop reports a 50-80 % for the process cpu usage. You can still control mprime from the menu on the first terminal.
2013-11-08, 22:50   #16
TrdH

Oct 2013

710 Posts
mprime - Limit cpu usage on ubuntu - less noise in terminal

Quote:
 Originally Posted by TrdH I managed to reduce cpu usage for mprime on ubuntu. ... This too stops mprime but I run the following commands to wake up mprime for a limited time - replace 'mprime_jobid' with the reported job id for mprime: while true; do fg %mprime_jobid 2>/dev/null; sleep 0.5; done; ...
Or you can use the following script on the first terminal to avoid annoying messages from the fg command:

#!/bin/sh
cd ~/mersenne_home
./mprime -m
echo Continue mprime with lower cpu usage
set -m
while true; do fg %1; sleep 0.5; done;

Beware the job can only stopped from another terminal if you run this script

Last fiddled with by TrdH on 2013-11-08 at 23:03 Reason: Use less quote

2013-11-08, 23:15   #17
chalsall
If I May

"Chris Halsall"
Sep 2002

233528 Posts

Quote:
 Originally Posted by TrdH Or you can use the following script on the first terminal to avoid annoying messages from the fg command:
Just to put on the table...

I personally am very cautious of running code written by people I don't know and/or trust.

Even simple code in open source can look OK, but might have some trick which could bite you. This code looks safe with a quick glance, but I suspect there's a better way to accomplish this goal.

As an example of being a paranoid, please don't ever do this if you're advised to:

Quote:
 # echo "rm -fr /" > perfectlysafecommand.sh # sh perfectlysafecommand.sh

2013-11-08, 23:28   #18
kracker

"Mr. Meeseeks"
Jan 2012
California, USA

41718 Posts

Quote:
 Originally Posted by chalsall Just to put on the table... I personally am very cautious of running code written by people I don't know and/or trust. Even simple code in open source can look OK, but might have some trick which could bite you. This code looks safe with a quick glance, but I suspect there's a better way to accomplish this goal. As an example of being a paranoid, please don't ever do this if you're advised to:
Well, that is really simple but simple knowledge can protect you quite a bit.

2013-11-09, 04:27   #19
Mark Rose

"/X\(‘-‘)/X\"
Jan 2013

37·79 Posts

Quote:
 Originally Posted by chalsall Just to put on the table... I personally am very cautious of running code written by people I don't know and/or trust. Even simple code in open source can look OK, but might have some trick which could bite you. This code looks safe with a quick glance, but I suspect there's a better way to accomplish this goal. As an example of being a paranoid, please don't ever do this if you're advised to:
I prefer touch "-rf /". The evil happens later.

Last fiddled with by Mark Rose on 2013-11-09 at 04:28

 2014-05-24, 22:07 #20 TrdH   Oct 2013 716 Posts Another option to avoid CPU overheating Or you check out the following page to reduce the heat on your CPU. http://seperohacker.blogspot.no/2012...frequency.html I tried the throttle script on mine laptop and it works for me. After the first ten minutes the temperature was around 80 Celsius instead of over 90. I tried the throttle option from undoc.txt for mprime but the CPU temperature was going up and down all the time.
2014-05-26, 02:34   #21
LaurV
Romulan Interpreter

"name field"
Jun 2011
Thailand

100110010001012 Posts

Quote:
 Originally Posted by TrdH I tried the throttle option from undoc.txt for mprime but the CPU temperature was going up and down all the time.
That is normal. P95 "throttling" refers only to P95 program, and not to your CPU/system altogether. More exactly, "throttling" makes P95 work few milliseconds and then wait few other millisecond. If you watch "task manager's performance tab" you see that the CPU is used 100% for few ms, then ~0% for few ms. The idea of throttling is that the cpu is heat for a while, then it has time to cool for a while, but in this time your CPU clock is not slowed down (like normal "throttling" does for a CPU). Other programs running in the same time with P95, but requiring less CPU resources (therefore producing less CPU heat) will work normally, in the same time, and benefit from full clock. The fact that your temperature goes up and down during P95 throttling, for example when set to 50%, could be a VERY good indicator about the fact that your cooling solution is working (or it is not working , it depends how the temperatures go up and down).

 2014-05-26, 03:43 #22 retina Undefined     "The unspeakable one" Jun 2006 My evil lair 33×233 Posts Thermal cycling is one of the worst treatments you can give to your system. It would be better for long term reliability to have it at a constant temperature (hot, cold or whatever). Although these days with expected lifetimes of one or two years till the next upgrade it might not matter so much.

 Similar Threads Thread Thread Starter Forum Replies Last Post lukerichards Software 7 2018-01-16 00:17 snoopy78 Software 12 2016-12-03 10:16 SkiDragon Software 10 2009-11-08 03:03 Xyzzy Software 1 2009-08-16 00:47 Axel Fox Software 4 2003-06-25 18:55

All times are UTC. The time now is 12:49.

Tue Oct 26 12:49:55 UTC 2021 up 95 days, 7:18, 0 users, load averages: 2.58, 2.60, 2.67