Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 6 Jun 2022 14:49:37 +0200
From:      Daniel Ebdrup Jensen <debdrup@FreeBSD.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: What can I learn about data that is staying paged out? (There is a more specific poudriere bulk related context given.)
Message-ID:  <20220606124937.exjit7znetcx6t6z@geroi.local>
In-Reply-To: <50163894-DCEB-4033-B555-698523E4D100@yahoo.com>
References:  <A9C9AC24-62EC-43C1-B713-F2012CD1FD5B@yahoo.com> <27DD20B8-E19B-444B-BAE7-A09CD5390D2F@crossfamilyweb.com> <50163894-DCEB-4033-B555-698523E4D100@yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--wedjdybktmzss6rh
Content-Type: multipart/mixed; boundary="x3jibatkpmiijy2n"
Content-Disposition: inline


--x3jibatkpmiijy2n
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline

On Sun, Jun 05, 2022 at 03:55:21PM -0700, Mark Millard wrote:
>Thanks for the idea. Know how I could find an approximation
>to the amount of paged out buffer cache to see about how much
>of the ~300 MiBytes it might explain?
>
>Mark
>
>===
>Mark Millard
>marklmi at yahoo.com
>
>

Hi folks,

      I believe what you're looking for is:
      vmstat -o | awk '$7 == "sw" { print $0 }'

      The definition of the 7th column is escaping me right now; I'm
      pretty sure I've seen it in a manual page somewhere, but can't for
      the life of me remember it - so if anyone knows, do tell and I'll
      figure out a way to get it added to vmstat. ;)

      If a lot of lines in vmstat -o are blank, it's usually a good idea
      to have a look at `pstat -f` because it'll either be shared memory
      objects, sockets, pipes, or things like that.

      There's also vmstat -m or vmstat -z which can be useful in breaking
      down types of VM objects by allocator.

      I've also taken the liberty of including `zones.pl` which has been
      floating around FreeBSD circles for ages, and which uses the vmstat
      -z flag mentioned above plus a bit of perl to sum everything up
      nicely.

      This is just what I've picked up over the course of sysadmining,
      I'm by no means a VM expert - as evidenced by the fact that I
      didn't know about sytat -swap, despite using systat regularly, and
      wishing it had a `systat -sensors` page which detailed the
      temperature values that can be found via acpi(4), coretemp(4) and
      occationally others, as well as fan-speed as reported by
      acpi_ibm(4) and others of its kind in /boot/kernel/acpi_*.

Yours,
Daniel Ebdrup Jensen

--x3jibatkpmiijy2n
Content-Type: text/x-perl; charset=us-ascii
Content-Disposition: attachment; filename="zones.pl"

#!/usr/bin/env perl
open STDIN, "vmstat -z |" or die "Failed to run vmstat program";
open STDOUT, "| sort -n @ARGV -k 2" or die "Failed to pipe through sort";
$fmt="%-30s %8.3f %8.3f %8.3f %6.1f%%\n";
while (<STDIN>) {
    ($n, $s, undef, $u, $c) = split /[:,] */;
    next unless $s > 0;
    $n =~ s/ /_/g;
    $s /= 1024 * 1024;
    $u *= $s;
    $c *= $s;
    $t =  $u + $c;
    next unless $t > 0;
    printf $fmt, $n, $t, $u, $c, 100 * $c / $t;
    $cache += $c;
    $used  += $u;
    $total += $t;
}
printf $fmt, TOTAL, $total, $used, $cache, 100 * $cached / $total;
close STDOUT;

--x3jibatkpmiijy2n--

--wedjdybktmzss6rh
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQGTBAABCgB9FiEEDonNJPbg/JLIMoS6Ps5hSHzN87oFAmKd9+FfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDBF
ODlDRDI0RjZFMEZDOTJDODMyODRCQTNFQ0U2MTQ4N0NDREYzQkEACgkQPs5hSHzN
87py4Af/b+AcDo6iLCpI4y/PvBN3wkH91bxOgNrjhBTsV/cKOe4mY01DwFuYlCwb
k+rssETbOLt8dwo6HVMz9Apb5kImCfM1RwWfL0fmhEYX/iaaYu81+JtF0lk45Q9z
0TFD2YGrcCkig6Gs8z5WC7PO0JjmOO8EGVucB7/gZAJV95TamfNZs8+LPsJAazUk
rkz/TojFNB/fUMP3InUYe4Xv8n1JBIUq2pcOm09BVTCMOBy8UPmy9FpAWSnueQb7
y7XDWFeiuPqfeK9erverat5lO6ofZLsUEs0dwcrLCiVijbiR3A1xtP6RITRFVr0G
bzEmH8HlS3Xv/XHJRZvCDNJ6rtyLmA==
=9fK8
-----END PGP SIGNATURE-----

--wedjdybktmzss6rh--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20220606124937.exjit7znetcx6t6z>