13.02.2019 1:14, Eugene Grosbein wrote:> Use following command to see how much memory is wasted in your case: > > vmstat -z | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | headOops, small correction: vmstat -z | sed 's/:/,/' | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | head
Hi!> > Use following command to see how much memory is wasted in your case: > > > > vmstat -z | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | head > > Oops, small correction: > > vmstat -z | sed 's/:/,/' | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | headOn a 8 GB 11.2p8 box doing mostly routing: 42.3047 abd_chunk 40 zio_buf_131072 31.75 zio_data_buf_131072 19.8901 swblk 12.9224 RADIX NODE 11.7344 zio_buf_16384 10.0664 zio_data_buf_12288 9.84375 zio_data_buf_40960 9.375 zio_data_buf_81920 7.96875 zio_data_buf_98304 So, how do I understand this ? Please note that I use: vfs.zfs.arc_max=1216348160 -- pi at opsec.eu +49 171 3101372 One year to go !
On 12/02/2019 20:17, Eugene Grosbein wrote:> 13.02.2019 1:14, Eugene Grosbein wrote: > >> Use following command to see how much memory is wasted in your case: >> >> vmstat -z | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | head > > Oops, small correction: > > vmstat -z | sed 's/:/,/' | awk -F, '{printf "%10s %s\n", $2*$5/1024/1024, $1}' | sort -k1,1 -rn | headI have a much uglier but somewhat more informative "one-liner" for post-processing vmstat -z output: vmstat -z | tail +3 | awk -F '[:,] *' 'BEGIN { total=0; cache=0; used=0 } {u $2 * $4; c = $2 * $5; t = u + c; cache += c; used += u; total += t; name=$1; gsub(" ", "_", name); print t, name, u, c} END { print total, "TOTAL", used, cache } ' | sort -n | perl -a -p -e 'while (($j, $_) = each(@F)) { 1 while s/^(-?\d+)(\d{3})/$1,$2/; print $_, " "} print "\n"' | column -t This would be much nicer as a small python script. Or, even, we could add a sort option for vmstat -z / -m. -- Andriy Gapon