Otto P. wrote:
> I found this zfs tuning script at
> www . solarisinternals . com/wiki/index.php/ZFS_Evil_Tuning_Guide
> 
> I am running snv_111b
> I don't feel like rendering my system useless by fiddling around with mdb.
> Can tell what modifications are need to this script to make it work?

Define "work"?  On the one hand, you don't want to fool with mdb, but on 
the other, you want to make a script do it?  And is there reason to 
believe it's broken?

> 
> 
> #!/bin/perl
> 
> use strict;
> my $arc_max = shift @ARGV;
> if ( !defined($arc_max) ) {
>         print STDERR "usage: arc_tune <arc max>\n";
>         exit -1;
> }
> $| = 1;
> use IPC::Open2;
> my %syms;
> my $mdb = "/usr/bin/mdb";
> open2(*READ, *WRITE,  "$mdb -kw") || die "cannot execute mdb";
> print WRITE "arc::print -a\n";
> while(<READ>) {
>         my $line = $_;
> 
>         if ( $line =~ /^ +([a-f0-9]+) (.*) =/ ) {
>                 $syms{$2} = $1;
>         } elsif ( $line =~ /^\}/ ) {
>                 last;
>         }
> }
> # set c & c_max to our max; set p to max/2
> printf WRITE "%s/Z 0x%x\n", $syms{p}, ( $arc_max / 2 );
> print scalar <READ>;
> printf WRITE "%s/Z 0x%x\n", $syms{c}, $arc_max;
> print scalar <READ>;
> printf WRITE "%s/Z 0x%x\n", $syms{c_max}, $arc_max;
> print scalar <READ>;

Reply via email to