You are not logged in.
on windows there were at least 2 good apps to control the percentage of cpu an app could hog.
so you could set say firefox to only allow it 80% tops, that way your system wouldn't freeze up.
Before anyone says you dont need that on linux - just today it happened to me whilst running a bash script (that uses imagemagick) to rezize a couple of photos
anyone use an app on Crunchbang to control things?
Last edited by ChickenPie4Tea (2012-08-22 15:01:34)
Troll = not a fanatic
Offline
Hi.Usually, i use htop and top
You can use gnome system monitor ,lxtaks or xfce system monitor.Make your choose.We have a lots of choices.
htop
lxtask
Use google and look system monitors 
Last edited by fthpl (2012-08-22 15:14:55)
*Crunchbang Waldorf
*Linux Mint Debian Edition
Offline
so with htop you can configure it to stop an app using too much cpu? that way you would need to run htop all the time so it could control things?
If you mean you can just bring up htop and then kill a process - how would you do that when your system is not responding because an app has already hogged all the cpu?
Troll = not a fanatic
Offline
htop is very featureful. You can set filters to allow only certain cpu usage, and many users leave a VT open with htop 24/7 just for process monitoring.
All tyranny needs to gain a foothold is for people of good conscience to remain silent.
---Thomas Jefferson ---
Offline
htop is very featureful. You can set filters to allow only certain cpu usage, and many users leave a VT open with htop 24/7 just for process monitoring.
oh well, didn't know that I thought it was just for viewing what was running and killing a process, will play about with it then.
Troll = not a fanatic
Offline
You can kill processes with htop as you can do from the command line in general as with some graphical monitors too.
Offline
Run htop, run through the filter menu, sort by, etc. and figure out how to set the CPU filter. I don't recall where it is, but I know you can do it. Like fthpl said though, there are many other process managers, task managers, etc. I just don't see going out and snagging a GUI when you've got top already.
Last edited by p120d16y (2012-08-22 15:34:54)
All tyranny needs to gain a foothold is for people of good conscience to remain silent.
---Thomas Jefferson ---
Offline
cpulimit:
recurring example: cpulimit -e mencoder -l 50 so that mencoder uses no more than 50% of one core...
Offline
Thanks for the example.
I should refresh on certain terminal commands I very rarely use.
All tyranny needs to gain a foothold is for people of good conscience to remain silent.
---Thomas Jefferson ---
Offline
cpulimit:
recurring example: cpulimit -e mencoder -l 50 so that mencoder uses no more than 50% of one core...
Thanks very handy to know, I looked at htop but couldn't find how to do it with it.
Troll = not a fanatic
Offline
you can also take a look at the "nice" command.
Type in your shell
info coreutils 'nice invocation'for more information.
Offline
so with htop you can configure it to stop an app using too much cpu? that way you would need to run htop all the time so it could control things?
If you mean you can just bring up htop and then kill a process - how would you do that when your system is not responding because an app has already hogged all the cpu?
if you know which applications are usually to blame you can just terminate them with Openbox keybindings, like
<keybind key="C-W-t">
<action name="Execute">
<command>kill -9 $(pidof application_name)</command>
</action>
</keybind>for example I have set one to terminate chrome that sometimes slows down everything.. 
Last edited by VDP76 (2012-08-23 12:30:40)
We are a nice, friendly community here and I hope we stay that way.. 
Offline
you can also take a look at the "nice" command.
Type in your shell
info coreutils 'nice invocation'for more information.
This is it. Process priority, and not CPU capping: http://everyjoe.com/technology/howto-ch … e-command/
Offline
Yes, use nice. Limiting CPU usage for a certain binary will slow your system down and use way more energy in the long run.
I'm so meta, even this acronym
Offline
thanks for the link MachineBacon - although I notice the comment someone left at the bottom of the page to say the author was wrong with his examle.
ok so if I wanted to use the nice command in a script to reduce the priority would this be right?
#!/bin/bash
nice -10 ./zim-start.sh &Last edited by ChickenPie4Tea (2012-08-23 14:32:40)
Troll = not a fanatic
Offline
i also use htop, of course.
and my dual-core notebook, which is capable of running at 1.6 GHz at max, is throttled down to 800 MHz permanently.
this keeps CPU temps low, thus the fan does not make siren noises. i never need the full performance for my daily work.
evilwm = digital zen
Offline
I use cpulimit. Works very well while remastering to keep my cpu (s) from going to 100% and overheating my laptop.
Here is a very nice "how to" written by abcuser on the ubuntu forums.
http://ubuntuforums.org/showthread.php?t=992706
I support the candidate that will steal the least from me....
Offline
I use cpulimit. Works very well while remastering to keep my cpu (s) from going to 100% and overheating my laptop.
Here is a very nice "how to" written by abcuser on the ubuntu forums.
http://ubuntuforums.org/showthread.php?t=992706
Thanks afab4 I followed the guide exactly but when it got to
"Add script to boot-up procedure directories"
sudo update-rc.d cpulimit defaults
terminal gave the message
"update-rc.d: using dependency based boot sequencing
insserv: warning: script 'cpulimit' missing LSB tags and overrides"
(however I notice despite the message that the daemon does start on system startup)
Trying to start it manually as the guide told - I got the message
cpulimit daemon can not be started
however I notice despite the message that the daemon does start on system startup
Think I'm going to have to exclude Iceweasel from the 20% of cpu limint though as it is noticably slow
Last edited by ChickenPie4Tea (2012-08-24 08:02:36)
Troll = not a fanatic
Offline
<snip>
Trying to start it manually as the guide told - I got the message
cpulimit daemon can not be startedhowever I notice despite the message that the daemon does start on system startup
<snip>
I followed the same guide and had the very same "problem":
start)
if [ $(ps -eo pid,args | gawk '$3=="/usr/bin/cpulimit_daemon.sh" {print $1}' | wc -l) -eq 0 ]; then
nohup /usr/bin/cpulimit_daemon.sh >/dev/null 2>&1 &
sleep 1 # I added this to delay the next command.
ps -eo pid,args | gawk '$3=="/usr/bin/cpulimit_daemon.sh" {print}' | wc -l | gawk '{ if ($1 == 1) print " * cpulimit daemon started successfully"; else print " * cpulimit daemon can not be started" }'
else
echo " * cpulimit daemon can't be started, because it is already running"
fi
;;This is because when issuing "sudo service cpulimit start" it would tell me "daemon not started" but doing "sudo service cpulimit status" right after would tell me it is actually running, sleep 1 fixes this...
Last edited by El_Belgicano (2012-08-24 10:09:03)
Offline
Thanks afab4 I followed the guide exactly but when it got to
"Add script to boot-up procedure directories"
sudo update-rc.d cpulimit defaultsterminal gave the message
"update-rc.d: using dependency based boot sequencing
insserv: warning: script 'cpulimit' missing LSB tags and overrides"
(however I notice despite the message that the daemon does start on system startup)Trying to start it manually as the guide told - I got the message
cpulimit daemon can not be startedhowever I notice despite the message that the daemon does start on system startup
Think I'm going to have to exclude Iceweasel from the 20% of cpu limint though as it is noticably slow
Yes, I got the same insserv:warning messages but as you stated the daemon does start.
I set variables in my cpulimit_daemon.sh like this:
# Variables
CPU_LIMIT=80 # Maximum percentage CPU consumption by each PID
DAEMON_INTERVAL=3 # Daemon check interval in seconds
BLACK_PROCESSES_LIST= "mksquashfs|rsync|genisoimage" # Limit only processes defined in this variable. If variable is empty (default) all violating processes are limited.
WHITE_PROCESSES_LIST= # Limit all processes except processes defined in this variable. If variable is empty (default) all violating processes are limited.
This allows my Core2 Duo CPU P9400 to run about 40% while remastering and keeps my cpu temp around 155 F.Last edited by afab4 (2012-08-24 15:19:01)
I support the candidate that will steal the least from me....
Offline
Warning
insserv: warning: script 'cpulimit' missing LSB tags and overrides"
You guys will probably run into trouble next time you want to add a system service.
The LSB tags are used to figure out in what order the system services should be started.
The absence of LSB tags makes this impossible. It can cause update-rc.d to go into a loop.
bootinfoscript - emacs primer - I ♥ #!
Offline
Warning
insserv: warning: script 'cpulimit' missing LSB tags and overrides"
You guys will probably run into trouble next time you want to add a system service.
The LSB tags are used to figure out in what order the system services should be started.
The absence of LSB tags makes this impossible. It can cause update-rc.d to go into a loop.
So would adding this header to the cpulimit script in /etc/init.d as such do the job?
#!/bin/sh
#
### BEGIN INIT INFO
# Provides: cpulimit
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Script to start CPU limit daemon
### END INIT INFOThis is the format and run levels used in the irqbalance script.
I support the candidate that will steal the least from me....
Offline
I suppose it would, yes.
You can test this by
☆ editing the script
☆ removing the service cpulimit
sudo update-rc.d cpulimit disable☆ adding the service again
sudo update-rc.d cpulimit enableLast edited by xaos52 (2012-08-24 17:21:06)
bootinfoscript - emacs primer - I ♥ #!
Offline
I suppose it would, yes.
You can test this by
☆ editing the script
☆ removing the service cpulimitsudo update-rc.d cpulimit disable☆ adding the service again
sudo update-rc.d cpulimit enable
I tried this and still got errors about the current runlevels for stop conflicting with the new script. After fiddling around with the header I came up with this:
### BEGIN INIT INFO
# Provides: cpulimit
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Script to start and stop CPU limit daemon
### END INIT INFOthen ran:
sudo update-rc.d cpulimit defaultsand no more error message.
I support the candidate that will steal the least from me....
Offline
That should be OK.
Thanks for the feedback.
bootinfoscript - emacs primer - I ♥ #!
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.