From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 21 11:09:49 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D168216A4DA; Mon, 21 Aug 2006 11:09:49 +0000 (UTC) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from correo.novusordo.net (cdjj.org [216.194.85.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id ECFED43D4C; Mon, 21 Aug 2006 11:09:46 +0000 (GMT) (envelope-from cdjones-freebsd-hackers@novusordo.net) Received: from [192.168.2.100] (S010600c049bda6b5.ed.shawcable.net [68.149.198.157]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by correo.novusordo.net (Postfix) with ESMTP id 0B62A11523; Mon, 21 Aug 2006 05:09:45 -0600 (MDT) Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <98C569DD-B559-4243-8C15-0DA1D832C387@novusordo.net> Content-Transfer-Encoding: 7bit From: Chris Jones Date: Mon, 21 Aug 2006 05:09:44 -0600 To: freebsd-hackers@freebsd.org X-Mailer: Apple Mail (2.752.2) Cc: Kip Macy Subject: [SoC] Jail Resource Limits X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Aug 2006 11:09:49 -0000 Hi, folks: I've completed the Summer of Code work on the jail resource limits (http://wikitest.freebsd.org/JailResourceLimits); jails can now have soft-ish limits placed on their memory and CPU usage. Briefly, when a jail uses more memory than its limit, pages are clawed back by a new kernel process, jpager. The clawback is at a configurable rate, though the proportion is currently fixed. When a jail uses more CPU time in proportion to total CPU time used than the number of its CPU usage shares to the total CPU usage shares, its processes are dropped in priority until it's had its fair share of the total CPU time; if there are no other processes that want to run, they'll use up as much CPU time as they otherwise would. We have a new command, jtune(8), which allows you to change the memory limit and CPU shares for a jail while it's running. You can also set these when a jail's created. Note that some sysctls need to be set (see jail(8) for details) before the limits will be enforced. A tarball with everything you need to build the experimental kernel can be at http://www.ualberta.ca/~cdjones/cdjones_jail_soc2006.tgz --- please read the INSTALL document in docs/ carefully, as it's pretty easy to trash your libc.so. The tarball is against RELENG_6 as of a few hours ago; I expect to port it to CURRENT sometime this week, once I build CURRENT on the desktop whose libc.so I trashed while writing docs/INSTALL. :) I look forward to your feedback. Cheers, Chris