Date: Thu, 31 Jan 2008 04:28:46 -0800 (PST) From: shinny knight <sh1nny_kn1ght@yahoo.com> To: Rudy <crapsh@monkeybrains.net>, freebsd-questions@freebsd.org Cc: karl.triebes@gmail.com Subject: Re: Future development of Jail Message-ID: <108340.30428.qm@web44813.mail.sp1.yahoo.com> In-Reply-To: <47A19934.6050709@monkeybrains.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Rudy <crapsh@monkeybrains.net> wrote: 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 _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to freebsd-questions-unsubscribe@freebsd.org Nice one Rudy, Thanks for the tip. Best Regards, Catalin --------------------------------- Looking for last minute shopping deals? Find them fast with Yahoo! Search.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?108340.30428.qm>