From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-user+bounces-159398-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id 593541387B1
	for <garchives@archives.gentoo.org>; Sat, 18 Oct 2014 23:02:35 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6B87CE0AAE;
	Sat, 18 Oct 2014 23:02:27 +0000 (UTC)
Received: from uberouter3.guranga.net (unknown [81.19.48.176])
	(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 34AEDE0965
	for <gentoo-user@lists.gentoo.org>; Sat, 18 Oct 2014 23:02:25 +0000 (UTC)
Received: from [192.168.1.115] (unknown [91.235.98.134])
	(using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits))
	(No client certificate requested)
	by uberouter3.guranga.net (Postfix) with ESMTPSA id D9914415
	for <gentoo-user@lists.gentoo.org>; Sun, 19 Oct 2014 00:02:15 +0100 (BST)
Message-ID: <5442F17C.7040904@thegeezer.net>
Date: Sun, 19 Oct 2014 00:02:20 +0100
From: thegeezer <thegeezer@thegeezer.net>
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0
Precedence: bulk
List-Post: <mailto:gentoo-user@lists.gentoo.org>
List-Help: <mailto:gentoo-user+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-user+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-user+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-user.gentoo.org>
X-BeenThere: gentoo-user@lists.gentoo.org
Reply-to: gentoo-user@lists.gentoo.org
MIME-Version: 1.0
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: gigabyte mobo latency
References: <loom.20141018T172004-713@post.gmane.org> <5442DAC8.2030106@thegeezer.net> <loom.20141018T233956-266@post.gmane.org>
In-Reply-To: <loom.20141018T233956-266@post.gmane.org>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Archives-Salt: 3cb8c316-eeec-4d70-8e5d-c9524740233d
X-Archives-Hash: 32a7e59af3260f1180acb260ed63e8bc

On 18/10/14 22:51, James wrote:
> thegeezer <thegeezer <at> thegeezer.net> writes:
>
>
>>> So. Is there a make.conf setting or elsewhere to make the 
>>> terminal session response times, in the browsers (seamonkey, firefox)
>>> faster?  
>>> the typing latency in the browser windows).....
>>> ideas?
>> two things you might like to look into: 1. cgroups (including freezer)
>> to help isolate your browsers and also 2. look at atop instead of htop
>> as this includes disk io
>
> 2. The system rarely uses 8 G of the 32 G available, so disk IO is 
> not the problem. No heavy writes. It was the java scripts....
>
> 1. Ahhhhhhhhhhhhhhhhhhh! tell me more. I found these links quickly:
>
> https://www.kernel.org/doc/Documentation/cgroups/freezer-subsystem.txt
>
> http://wiki.gentoo.org/wiki/LXC#Freezer_Support
>
> I'm not sure if you've read any of my clustering_frustration posts
> over the last month or so, but cgroups is at the heart of clustering now.
> It seems many of the systemd based cluster solutions are having all
> sorts of OOM, OOM-killer etc etc issues. So any and all good information,
> examples and docs related to cgroups is of keen interests to me. My efforts
> to build up a mesos/spark cluster, center around openrc and therefore
> direct management of resources via cgroups.
>
> The freezer is exactly what I'm looking for. Maybe I also need to read up
> on lxc?  What are the best ways to dynamically manage via cgroups? A gui?
> A static config file? a CLI tool?
>
>
> curiously,
> James
>
>
>
>
>
the thing with cgroups is that you can choose to create a hierarchy of
what _you_ want to have as your priority
unfortunately you need to tell the machine what it is you want, it can't
really guess granularly iuc
e.g. your favourite terminal / ide etc you want high prio   and your
favourite file mangler to be low prio ( assuming you want compiling to
take precedence over bit munging to usb etc)

there is however cgroup support in htop, and i thought that you could
adjust cgroup in stead of nice but a quick google is showing that i
dreamed it as a nice feature; that would be super slick as you can
easily adjust all parts of program demand -- io / memory / cpu

using openRC you can start services i.e. apache to have a certain
priority, and ssh to have another
http://wiki.gentoo.org/wiki/OpenRC/CGroups
http://qnikst.github.io/posts/2013-02-20-openrc-cgroup.html


the reason i suggest freezer is that you can more easily "pause" or
CTRL-Z something that would otherwise be in a GUI and maybe not respond
to SIGSTP
on my laptop :-

# mount | grep freez
freezer on /sys/fs/cgroup/freezer type cgroup
(rw,nosuid,nodev,noexec,relatime,freezer)
# cd /sys/fs/cgroup/freezer/

call the folder something meaningful
# mkdir investigate
# cd investigate

you can use the following, i just did echo $$ for local bash pid... make
sure to get all threads especially something like chrome spawns many
children
# ps -eLf | grep mybadapp    

note the single > actually concatenates
# echo $PID > tasks

to remove you actually have to "move" the process into a different
cgroup i.e.
# echo $PID > /sys/fs/cgroup/freezer/tasks

ok so once you have all your tasks in there just make sure you are in
/sys/fs/cgroup/freezer/investigate
# echo FROZEN > freezer.state

to thaw
# echo THAWED > freezer.state



there is a little more here
http://gentoo-en.vfose.ru/wiki/Improve_responsiveness_with_cgroups
which will allow you to script creating a cgroup with the processID of
an interactive shell, that you can start from to help save hunting down
all the threads spawned by chrome.
you can then do fun stuff with echo $$ >
/sys/fs/cgroup/cpu/high_priority/tasks

but for your original point of maybe it's not an issue with something
like IO it could still be a very high number disk reads -- low actual
thoughput but the demand on the io system was high, i.e. 6zillion reads
hopefully this will give you a bit more control over all of that though