From owner-freebsd-jail@FreeBSD.ORG Fri Jun 5 09:32:01 2009 Return-Path: Delivered-To: freebsd-jail@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABCA7106566B for ; Fri, 5 Jun 2009 09:32:01 +0000 (UTC) (envelope-from kostjn@peterhost.ru) Received: from mail.z8.ru (mail.z8.ru [80.93.58.56]) by mx1.freebsd.org (Postfix) with ESMTP id 6835B8FC12 for ; Fri, 5 Jun 2009 09:31:56 +0000 (UTC) (envelope-from kostjn@peterhost.ru) Received: from [85.235.196.139] (helo=kostjn.pht) by mail.z8.ru with esmtpa (Exim 4.67 (FreeBSD)) (envelope-from ) id 1MCVmD-00016I-3f for freebsd-jail@freebsd.org; Fri, 05 Jun 2009 13:31:53 +0400 Message-ID: <4A28E691.9010301@peterhost.ru> Date: Fri, 05 Jun 2009 13:34:09 +0400 From: Menshikov Konstantin User-Agent: Thunderbird 2.0.0.18 (X11/20090328) MIME-Version: 1.0 CC: freebsd-jail@freebsd.org References: <20090603180221.E56412@hub.org> <4A275D80.5050408@peterhost.ru> <20090605055852.N56412@hub.org> In-Reply-To: <20090605055852.N56412@hub.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Calculating per jail memory usage ... X-BeenThere: freebsd-jail@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion about FreeBSD jail\(8\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jun 2009 09:32:01 -0000 Marc G. Fournier wrote: > On Thu, 4 Jun 2009, Menshikov Konstantin wrote: > >> Hi. >> You can consider memory occupied with processes in jail as sum RSS of >> these processes, but it is wrong. >> >> Processes divide memory among themselves, a segment of the text or >> all memory (if not to do exec after fork). >> >> Now in a kernel there is no mechanism with which help it is possible >> to count a memory size occupied with processes in jail. >> After this mechanism will appear, it will be possible to add top :) >> >> There is a patch for restriction of resources jail, >> http://wiki.freebsd.org/Jails, CPU + RAM Limits for Current. > > Is this the ChrisJones patch that is labeled "Not fully working / > stalled" you are referring to? No, it is a patch written with zero. > > For 7.x, all we can really go back is RSS, from what I can tell ... it > won't be until 8.x(?) that we will be able to get more accurate ... ? > And even then, it will be a patch we have to add, not stuff that has > been yet integrated into 8.x? Yes, the kernel has no counters of memory for jail in 7 branch, also has no system calls jail_get, jail_set, therefore on there is no place to take the information. In 8 branch are added jail_set, jail_get, it gives the chance to obtain any data about jail. I hope that after a while, after testing, the patch for restriction of use of resources jail will be accepted. After that, reception of the information on use of resources jail will be trivial.