Date: Thu, 04 Jun 2009 09:37:04 +0400 From: Menshikov Konstantin <kostjn@peterhost.ru> Cc: freebsd-jail@freebsd.org Subject: Re: Calculating per jail memory usage ... Message-ID: <4A275D80.5050408@peterhost.ru> In-Reply-To: <20090603180221.E56412@hub.org> References: <20090603180221.E56412@hub.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Marc G. Fournier wrote: > > Are there any tools for this that are either in ports, or others would > like to share? > > ---- > Marc G. Fournier Hub.Org Networking Services > (http://www.hub.org) > Email . scrappy@hub.org MSN . > scrappy@hub.org > Yahoo . yscrappy Skype: hub.org ICQ . 7615664 > _______________________________________________ > freebsd-jail@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-jail > To unsubscribe, send any mail to "freebsd-jail-unsubscribe@freebsd.org" > 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. In it, it is considered memory which is used by processes in jail. Further using a system call jail_get it is possible to receive a memory size used jail. The program jget thus works. Example [root@book /home/kostjn]# ./jget.o 1 Jail limits and rusage, jid = 1 Limits: CPU 5, MEM 64M, NPROC 128, NOFILE 512 Usage: CPU 0, MEM 6M, NPROC 9, NOFILE 65 -- Menshikov Konstantin
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A275D80.5050408>