From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Wagner Subject: Re: [RFC] per-containers tcp buffer limitation Date: Thu, 25 Aug 2011 20:27:54 +0200 Message-ID: <4E56942A.3080905@monom.org> References: <4E558137.5020900@parallels.com> <4E55A55B.8090608@parallels.com> <20110825104956.41c4b60e.kamezawa.hiroyu@jp.fujitsu.com> <4E56464B.4070304@monom.org> <4E5664B5.6000806@genband.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4E5664B5.6000806@genband.com> Sender: netdev-owner@vger.kernel.org To: Chris Friesen Cc: "Eric W. Biederman" , KAMEZAWA Hiroyuki , Glauber Costa , Linux Containers , netdev@vger.kernel.org, David Miller , Pavel Emelyanov List-Id: containers.vger.kernel.org Hi Chris, On 08/25/2011 05:05 PM, Chris Friesen wrote: > On 08/25/2011 06:55 AM, Daniel Wagner wrote: > >> I'd like to solve a use case where it is necessary to count all bytes >> transmitted and received by an application [1]. So far I have found two >> unsatisfying solution for it. The first one is to hook into libc and >> count the bytes there. I don't think I have to say I don't like this. > > Is there any particular reason you can't use LD_PRELOAD to interpose a > library to do the statistics monitoring? This is certainly possible to do for any dynamic linked application. I think it wouldn't work for static linked ones. Currently I don't know if I have to face such application on the project I am on. The reason why I am not so a big fan is that using the LD_PRELOAD trick seems very hackish to me. As Glauber has argumented in this thread, there are properly quite a few people who want to control or monitor sockets. It seems I am one of those. Having this kind of support in cgroups seems like a very neat solution to me. thanks, daniel