#!/bin/sh #echo case "$1" in z) cat $2 | perl -e'sub pm{print $_[1],int(0.49+$_[0]/1024/1024)," m\n"}; while(<>){@A=split/[:,]\s+/; $s=$A[1]*$A[3]; $sum+=$s; if($A[0]=~/^(malloc|zio_|arc_buf|abd_|mbuf)/){$S{$1}+=$s}}; pm $sum,"vmstat -z: "; for(qw/malloc mbuf zio_ arc_buf abd_/){pm $S{$_},"uma $_ "}; ' ;; zz) cat $2 | perl -e'sub pm{print $_[1],int(0.49+$_[0]/1024/1024)," m\t"}; while(<>){@A=split/[:,]\s+/; $s=$A[1]*$A[3]; $sum+=$s; pm $s; print "$_";}; pm $sum; print"\n" ' ;; *) date uname -a # vfs.zfs.arc_meta_limit vfs.zfs.arc_meta_used vfs.unmapped_bufspace \ # kern.geom.stripe.maxmem \ # vfs.zfs.zio.use_uma \ ( sysctl \ vfs.zfs.arc.min \ kstat.zfs.misc.arcstats.arc_meta_min \ kstat.zfs.misc.arcstats.arc_meta_used \ kstat.zfs.misc.arcstats.arc_meta_limit \ kstat.zfs.misc.arcstats.arc_meta_max \ kstat.zfs.misc.arcstats.mfu_size \ kstat.zfs.misc.arcstats.mru_size \ kstat.zfs.misc.arcstats.anon_size \ kstat.zfs.misc.arcstats.size \ kstat.zfs.misc.arcstats.c_min \ kstat.zfs.misc.arcstats.c \ kstat.zfs.misc.arcstats.c_max \ vfs.zfs.arc.max \ sysctl kstat.zfs.misc.arcstats.anon_evictable_data \ kstat.zfs.misc.arcstats.anon_evictable_metadata \ kstat.zfs.misc.arcstats.mfu_evictable_data \ kstat.zfs.misc.arcstats.mfu_evictable_metadata \ kstat.zfs.misc.arcstats.mru_evictable_data \ kstat.zfs.misc.arcstats.mru_evictable_metadata \ sysctl vfs.ufs.dirhash_mem vfs.ufs.dirhash_maxmem vfs.ufs.dirhash_minsize sysctl kstat.zfs.misc.arcstats.memory_free_bytes \ vm.kmem_map_free vm.kmem_map_size vm.kmem_size \ vm.uma_kmem_total vm.uma_kmem_limit vm.kmem_size_max \ vfs.bufspace \ ) \ | perl -ne 'chomp;if(/^(.+: *)([0-9]+)$/) {$_=$1.int(0.5+$2/1024/1024)." m" if $2>10000}; print "$_\n"' sysctl vfs.zfs.arc.evict_batch_limit vfs.zfs.arc.eviction_pct \ vm.max_wired vm.max_user_wired vfs.zfs.arc_free_target kern.ipc.numopensockets echo -n "vmstat -m: " #vmstat -m | egrep -o ' [0-9]+K'|SUM vmstat -m | egrep -o ' [0-9]+K'| perl -ne'chomp; $A+=$_; END {print int($A/1024+.9)," m\n"};' vmstat -z | $0 z ;; esac