<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 22/04/12 18:11, Bas Roufs - message in English wrote:
<blockquote cite="mid:1528726.1y26pFjnjq@viaconsensus-travel"
type="cite">
<meta name="qrichtext" content="1">
<style type="text/css">
p, li { white-space: pre-wrap; }
</style>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">Hello
everybody</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px;
margin-bottom:0px; margin-left:0px; margin-right:0px;
-qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">Today, I have
been tweeking with a view to limiting the use of CPU by the
system Kubuntu 11.10. I have followed most of the advises at
the tutorial "How to make Kubuntu (KDE) blazing fast and
optimise it for performance". </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">See:
<a class="moz-txt-link-freetext" href="http://bit.ly/tRJzap">http://bit.ly/tRJzap</a></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">This has
helped to effectively deal with the worst CPU problems I have
experienced recently. However, the consumption of CPU is still
60 up to and including 100% in certain situations - notably
when syncing IMAP-folders in KMAIL/ Kontact. As a matter of
consequence, it is very difficult to multitask with one or a
few other packages, when doing so. At one of the two laptops I
am working with, I even need to use some workarounds via the
system activity monitor to get Kontact started at all:
"killing" one or two processes, while prioritising others. </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">Be so so kind
to provide me with feedback and ideas to handle this problem.</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">Respectfully
yours,</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px;
margin-right:0px; -qt-block-indent:0; text-indent:0px;
-qt-user-state:0;"><span style=" font-size:12pt;">Bas Roufs. </span></p>
</blockquote>
Hi bas,<br>
<br>
This sounds very annoying. The system being non-responsive effective
prevents you from working properly.<br>
Did you try isolating the culprit in a cgroup? That way you can
maximize the processor power it is allowed to use.<br>
I didnt try it yet, but I plan to if I get problems like this.<br>
<br>
Below a summary of what I read in the Dutch "Linux magazine"
2012-02. Hope it helps.<br>
Remember to change names to your own situation.<br>
<br>
mkdir -p /cgroup/cpu<br>
mount -t cgroup -o cpu none /cgroup/cpu<br>
(check with ls -l /cgroup/cpu it works, you should get something
like:<br>
<br>
root@mahatma:/# mkdir -p /cgroup/cpu<br>
root@mahatma:/# mount -t cgroup -o cpu none /cgroup/cpu<br>
root@mahatma:/# ls -l /cgroup/cpu<br>
total 0<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cgroup.clone_children<br>
--w--w--w- 1 root root 0 2012-04-23 05:24 cgroup.event_control<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cgroup.procs<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.rt_period_us<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.rt_runtime_us<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.shares<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 notify_on_release<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 release_agent<br>
-rw-r--r-- 1 root root 0 2012-04-23 05:24 tasks<br>
root@mahatma:/# cat /cgroup/cpu/cpu.shares<br>
1024<br>
<br>
The 1024 is equal to 100% of your CPU. All processes in the file
"tasks" share these 1024 cycles.<br>
<br>
Now suppose you have a certain set of processes (or only one) that
hog the cpu. <br>
Then you create a new directory and direct these processes to that
directory.<br>
Only this time you maximize the number of cycles it is allowed to
use.<br>
<br>
First you create a subdirectory under CPU, this doubles the number
of cycles to 2x1024. Then you limit the number of cycles by
overwriting the cpu.shares file with a smaller number. Then you copy
the processes that you want limited to the tasks file in the
subdirectory.<br>
<br>
From that time on, these processes should be limited in CPU use to
the shares you specified. I copied from my machine, but dont have
any processes to put in tasks:<br>
<br>
root@mahatma:/cgroup/cpu# mkdir vreters<br>
root@mahatma:/cgroup/cpu# ls -l vreters/<br>
total 0<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cgroup.clone_children<br>
--w--w--w- 1 root root 0 2012-04-23 09:27 cgroup.event_control<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cgroup.procs<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.rt_period_us<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.rt_runtime_us<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.shares<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 notify_on_release<br>
-rw-r--r-- 1 root root 0 2012-04-23 09:27 tasks<br>
root@mahatma:/cgroup/cpu# cd vreters<br>
root@mahatma:/cgroup/cpu/vreters# cat cpu.shares <br>
1024<br>
root@mahatma:/cgroup/cpu/vreters# echo 256 > cpu.shares <br>
<br>
Now you have 1024 + 256 cycles: about 20% for all processes in this
tasks file. The tasks file is currently empty.<br>
All you have to do is copy 199001 to tasks (if that is the process
that is hogging the CPU): echo 19901 > tasks<br>
<br>
From then on, you should have a more responsive system. You can find
out what is wrong with the process later.<br>
<br>
I really hope this helps.<br>
<br>
<div class="moz-signature">-- <br>
Kind regards, Guus Bonnema.</div>
</body>
</html>