Still too much CPU consumption - especially when using Kontact.
On 22/04/12 18:11, Bas Roufs - message in English wrote:
Hello
everybody
*
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".
See:
http://bit.ly/tRJzap
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.
Be so so kind
to provide me with feedback and ideas to handle this problem.
Respectfully
yours,
Bas Roufs.
Hi bas,
This sounds very annoying. The system being non-responsive effective
prevents you from working properly.
Did you try isolating the culprit in a cgroup? That way you can
maximize the processor power it is allowed to use.
I didnt try it yet, but I plan to if I get problems like this.
Below a summary of what I read in the Dutch "Linux magazine"
2012-02. Hope it helps.
Remember to change names to your own situation.
mkdir -p /cgroup/cpu
mount -t cgroup -o cpu none /cgroup/cpu
(check with ls -l /cgroup/cpu it works, you should get something
like:
root@mahatma:/# mkdir -p /cgroup/cpu
root@mahatma:/# mount -t cgroup -o cpu none /cgroup/cpu
root@mahatma:/# ls -l /cgroup/cpu
total 0
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cgroup.clone_children
--w--w--w- 1 root root 0 2012-04-23 05:24 cgroup.event_control
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cgroup.procs
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.rt_period_us
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.rt_runtime_us
-rw-r--r-- 1 root root 0 2012-04-23 05:24 cpu.shares
-rw-r--r-- 1 root root 0 2012-04-23 05:24 notify_on_release
-rw-r--r-- 1 root root 0 2012-04-23 05:24 release_agent
-rw-r--r-- 1 root root 0 2012-04-23 05:24 tasks
root@mahatma:/# cat /cgroup/cpu/cpu.shares
1024
The 1024 is equal to 100% of your CPU. All processes in the file
"tasks" share these 1024 cycles.
Now suppose you have a certain set of processes (or only one) that
hog the cpu.
Then you create a new directory and direct these processes to that
directory.
Only this time you maximize the number of cycles it is allowed to
use.
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.
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:
root@mahatma:/cgroup/cpu# mkdir vreters
root@mahatma:/cgroup/cpu# ls -l vreters/
total 0
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cgroup.clone_children
--w--w--w- 1 root root 0 2012-04-23 09:27 cgroup.event_control
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cgroup.procs
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.rt_period_us
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.rt_runtime_us
-rw-r--r-- 1 root root 0 2012-04-23 09:27 cpu.shares
-rw-r--r-- 1 root root 0 2012-04-23 09:27 notify_on_release
-rw-r--r-- 1 root root 0 2012-04-23 09:27 tasks
root@mahatma:/cgroup/cpu# cd vreters
root@mahatma:/cgroup/cpu/vreters# cat cpu.shares
1024
root@mahatma:/cgroup/cpu/vreters# echo 256 > cpu.shares
Now you have 1024 + 256 cycles: about 20% for all processes in this
tasks file. The tasks file is currently empty.
All you have to do is copy 199001 to tasks (if that is the process
that is hogging the CPU): echo 19901 > tasks
From then on, you should have a more responsive system. You can find
out what is wrong with the process later.
I really hope this helps.
*
--
Kind regards, Guus Bonnema.
--
kubuntu-users mailing list
kubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/kubuntu-users
|