From owner-freebsd-questions@FreeBSD.ORG Thu Jan 31 09:47:06 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7945216A420 for ; Thu, 31 Jan 2008 09:47:06 +0000 (UTC) (envelope-from crapsh@monkeybrains.net) Received: from ape.monkeybrains.net (ape.monkeybrains.net [208.69.40.11]) by mx1.freebsd.org (Postfix) with ESMTP id 5A7A113C4D9 for ; Thu, 31 Jan 2008 09:47:06 +0000 (UTC) (envelope-from crapsh@monkeybrains.net) Received: from monchichi.monkeybrains.net (adsl-75-55-220-44.dsl.pltn13.sbcglobal.net [75.55.220.44]) (authenticated bits=0) by ape.monkeybrains.net (8.14.1/8.14.1) with ESMTP id m0V9l5ss001938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 31 Jan 2008 01:47:06 -0800 (PST) (envelope-from crapsh@monkeybrains.net) Message-ID: <47A19934.6050709@monkeybrains.net> Date: Thu, 31 Jan 2008 01:47:32 -0800 From: Rudy User-Agent: Thunderbird 2.0.0.9 (X11/20071122) MIME-Version: 1.0 To: freebsd-questions@freebsd.org References: <26a198490712311910l4dd05238vbe6bebad33066f@mail.gmail.com> In-Reply-To: <26a198490712311910l4dd05238vbe6bebad33066f@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV version 0.92, clamav-milter version 0.92 on pita.monkeybrains.net X-Virus-Status: Clean Cc: karl.triebes@gmail.com Subject: Re: Future development of Jail X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2008 09:47:06 -0000 Karl Triebes wrote: > I would like to see per-jail quotas such as the ones Andy mentions, > and would like to hear if anyone would be interested in doing it for > the right price. You may contact me via this list or in private. Per-jail quotas are Trivial you use zfs... You can even resize a zfs mount 'on the fly'. Here is the command to resize a jail to 100GB of space:: # zfs set quota=100G tank/jails/myNeatoWebsite As for doing it for a price, I'll consult -- granted I just let The Secret out of the bag. :) I can build a 1TB to 6TB box for you and have it all set and ready for jails, or you could do it yourself. As for CPU, I 'auto nice' pids with high CPU usage: #!/usr/local/bin/perl # This is BEERWARE [b] Rudy # auto-nice-jails.pl - set this up in cron to run every 5 minutes #use strict; open PS, "/bin/ps -axo time,pid,nice,state,command | /usr/bin/sort -nr |" or die "no PS for me. $). $!"; while () { # examples: #191:49.16 0 R+J ./q3ded +set fs_game arena +set vm_game 0 +set sv_pure ...etc... # 21:23.58 4 RN+J ./sc_serv /^\s*(\d+):(\d+).\d+\s+(\d+)\s+(\d+)\s+(\S+)\s+(.*)$/ or next; my ($cputime,$pid,$nice,$state,$command) = (($1*60+$2),$3,$4,$5,$6); ### print "($cputime,$pid,$nice,$state,$command)\n"; last if ($cputime < 30); next unless ($state =~ /J/); # only jailed procs... next if ($nice > 5); my $renice = 2; $renice = 4 if ($cputime > 1000); $renice = 5 if ($cputime > 10000); if ($renice > $nice) { print "$pid\t$nice\t$cputime\t$command\n"; system("/usr/bin/renice +$renice $pid"); } } Rudy