1 |
On 18/10/14 22:51, James wrote: |
2 |
> thegeezer <thegeezer <at> thegeezer.net> writes: |
3 |
> |
4 |
> |
5 |
>>> So. Is there a make.conf setting or elsewhere to make the |
6 |
>>> terminal session response times, in the browsers (seamonkey, firefox) |
7 |
>>> faster? |
8 |
>>> the typing latency in the browser windows)..... |
9 |
>>> ideas? |
10 |
>> two things you might like to look into: 1. cgroups (including freezer) |
11 |
>> to help isolate your browsers and also 2. look at atop instead of htop |
12 |
>> as this includes disk io |
13 |
> |
14 |
> 2. The system rarely uses 8 G of the 32 G available, so disk IO is |
15 |
> not the problem. No heavy writes. It was the java scripts.... |
16 |
> |
17 |
> 1. Ahhhhhhhhhhhhhhhhhhh! tell me more. I found these links quickly: |
18 |
> |
19 |
> https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt |
20 |
> |
21 |
> http://wiki.gentoo.org/wiki/LXC#Freezer_Support |
22 |
> |
23 |
> I'm not sure if you've read any of my clustering_frustration posts |
24 |
> over the last month or so, but cgroups is at the heart of clustering now. |
25 |
> It seems many of the systemd based cluster solutions are having all |
26 |
> sorts of OOM, OOM-killer etc etc issues. So any and all good information, |
27 |
> examples and docs related to cgroups is of keen interests to me. My efforts |
28 |
> to build up a mesos/spark cluster, center around openrc and therefore |
29 |
> direct management of resources via cgroups. |
30 |
> |
31 |
> The freezer is exactly what I'm looking for. Maybe I also need to read up |
32 |
> on lxc? What are the best ways to dynamically manage via cgroups? A gui? |
33 |
> A static config file? a CLI tool? |
34 |
> |
35 |
> |
36 |
> curiously, |
37 |
> James |
38 |
> |
39 |
> |
40 |
> |
41 |
> |
42 |
> |
43 |
the thing with cgroups is that you can choose to create a hierarchy of |
44 |
what _you_ want to have as your priority |
45 |
unfortunately you need to tell the machine what it is you want, it can't |
46 |
really guess granularly iuc |
47 |
e.g. your favourite terminal / ide etc you want high prio and your |
48 |
favourite file mangler to be low prio ( assuming you want compiling to |
49 |
take precedence over bit munging to usb etc) |
50 |
|
51 |
there is however cgroup support in htop, and i thought that you could |
52 |
adjust cgroup in stead of nice but a quick google is showing that i |
53 |
dreamed it as a nice feature; that would be super slick as you can |
54 |
easily adjust all parts of program demand -- io / memory / cpu |
55 |
|
56 |
using openRC you can start services i.e. apache to have a certain |
57 |
priority, and ssh to have another |
58 |
http://wiki.gentoo.org/wiki/OpenRC/CGroups |
59 |
http://qnikst.github.io/posts/2013-02-20-openrc-cgroup.html |
60 |
|
61 |
|
62 |
the reason i suggest freezer is that you can more easily "pause" or |
63 |
CTRL-Z something that would otherwise be in a GUI and maybe not respond |
64 |
to SIGSTP |
65 |
on my laptop :- |
66 |
|
67 |
# mount | grep freez |
68 |
freezer on /sys/fs/cgroup/freezer type cgroup |
69 |
(rw,nosuid,nodev,noexec,relatime,freezer) |
70 |
# cd /sys/fs/cgroup/freezer/ |
71 |
|
72 |
call the folder something meaningful |
73 |
# mkdir investigate |
74 |
# cd investigate |
75 |
|
76 |
you can use the following, i just did echo $$ for local bash pid... make |
77 |
sure to get all threads especially something like chrome spawns many |
78 |
children |
79 |
# ps -eLf | grep mybadapp |
80 |
|
81 |
note the single > actually concatenates |
82 |
# echo $PID > tasks |
83 |
|
84 |
to remove you actually have to "move" the process into a different |
85 |
cgroup i.e. |
86 |
# echo $PID > /sys/fs/cgroup/freezer/tasks |
87 |
|
88 |
ok so once you have all your tasks in there just make sure you are in |
89 |
/sys/fs/cgroup/freezer/investigate |
90 |
# echo FROZEN > freezer.state |
91 |
|
92 |
to thaw |
93 |
# echo THAWED > freezer.state |
94 |
|
95 |
|
96 |
|
97 |
there is a little more here |
98 |
http://gentoo-en.vfose.ru/wiki/Improve_responsiveness_with_cgroups |
99 |
which will allow you to script creating a cgroup with the processID of |
100 |
an interactive shell, that you can start from to help save hunting down |
101 |
all the threads spawned by chrome. |
102 |
you can then do fun stuff with echo $$ > |
103 |
/sys/fs/cgroup/cpu/high_priority/tasks |
104 |
|
105 |
but for your original point of maybe it's not an issue with something |
106 |
like IO it could still be a very high number disk reads -- low actual |
107 |
thoughput but the demand on the io system was high, i.e. 6zillion reads |
108 |
hopefully this will give you a bit more control over all of that though |