PMSTAT(1)

PMSTAT(1) πŸ’– the pcp-vmstat, pmstat glow-up

okay bestie, this is the General Commands Manual page for PMSTAT(1) and lemme tell you, it's a whole vibe check for your system. pull up a chair πŸͺ‘


✨ NAME ✨

pcp-vmstat, pmstat β€” high-level system performance overview 🫢


✨ SYNOPSIS ✨

pcp [pcp options] vmstat [interval [samples]]

pmstat [-gLlPVxz?]  [-a archive] [-A align] [-D debug] [-h host] [-H
file] [-n pmnsfile] [-O offset] [-p port] [-s samples] [-S starttime]
[-t interval] [-T endtime] [-Z timezone]

pcp-vmstat ...

✨ DESCRIPTION ✨

so pmstat gives you a one line summary of how your system is doing, every interval unit of time (default is 5 seconds). it's giving "top-level tea only" β˜• β€” pmstat is made to watch system performance at the highest level, and then once you spot something sus, you go grab the other tools to dig into the subsystems where the potential performance problems might be lurking. iykyk πŸ”

pcp-vmstat is literally just a cute lil wrapper for use with the pcp(1) command, giving a more familiar command line format for some users. it also turns on the extended reporting option by default, peep the -x option below πŸ‘€

you can monitor multiple hosts by supplying more than one host with multiple -h flags (that's for live monitoring), or by giving a name of the hostlist file with -H where each line contains one host name, or with multiple -a flags (that's retrospective monitoring from sets of archives). so many options, so much power πŸ‘‘

by default, pmstat fetches metrics by connecting to the Performance Metrics Collector Daemon (PMCD) on the local host. if you specify the -L option, then pmcd(1) gets bypassed entirely, and metrics are fetched from PMDAs on the local host using the stand-alone PM_CONTEXT_LOCAL variant of pmNewContext(3). when you specify the -h option, pmstat connects to the pmcd(1) on host and fetches metrics from there. and yeah, like we said, multiple hosts may be monitored by supplying multiple -h flags πŸ’…

alternatively, if you use the -a option, the metrics are retrieved from the Performance Co-Pilot archive files identified by archive, which is a comma-separated list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives. multiple sets of archives may be replayed by supplying multiple -a flags. and when the -a flag is used, the -P flag may also be used to pause the output after each interval ⏸️

stand-alone mode can only connect to the local host, using a set of archives implies a host name, and nominating a host precludes using an archive, so the options -L, -a and -h are mutually exclusive. pick one bestie, you can't have all three 😭

pmstat may relinquish its own timing control, and operate under the control of a pmtime(1) process that uses a GUI dialog to provide timing control. in this case, either the -g option should be used to start pmstat as the sole client of a new pmtime(1) instance, or -p should be used to attach pmstat to an existing pmtime(1) instance via the IPC channel identified by the port argument πŸŽ€

the -S, -T, -O and -A options may be used to define a time window to restrict the samples retrieved, set an initial origin within the time window, or specify a ``natural'' alignment of the sample times; refer to PCPIntro(1) for a complete description of these options. fr fr, go read it 🌸


✨ OPTIONS ✨

the available command line options are:

  • -a archive, --archive=archive β€” performance metric values are retrieved from the set of Performance Co-Pilot (PCP) archive files identified by the archive argument, which is a comma-separated list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives πŸ“¦
  • -A align, --align=align β€” force the initial sample to be aligned on the boundary of a natural time unit align. refer to PCPIntro(1) for a complete description of the syntax for align πŸ“
  • -g, --guimode β€” start pmstat as the client of a new pmtime(1) server process for replay of archived performance data using the pmtime(1) graphical user interface πŸ–ΌοΈ
  • -h host, --host=host β€” fetch performance metrics from pmcd(1) on host, rather than from the default localhost 🌐
  • -H path, --hostsfile=path β€” specify the path to a file containing a set of hostnames where pmcd(1) is running , rather than using the default localhost πŸ“‹
  • -K spec, --spec-local=spec β€” when fetching metrics from a local context (see -L), the -K option may be used to control the DSO PMDAs that should be made accessible. the spec argument conforms to the syntax described in pmSpecLocalPMDA(3). more than one -K option may be used 🧩
  • -l, --suffix β€” prints the last 7 characters of a hostname in summaries involving more than one host (when more than one -h option has been specified on the command line) βœ‚οΈ
  • -L, --local-PMDA β€” use a local context to collect metrics from DSO PMDAs on the local host without PMCD. see also -K 🏠
  • -n pmnsfile, --namespace=pmnsfile β€” load an alternative Performance Metrics Name Space (PMNS(5)) from the file pmnsfile πŸ“›
  • -O origin, --origin=origin β€” when reporting archived metrics, start reporting at origin within the time window (see -S and -T). refer to PCPIntro(1) for a complete description of the syntax for origin 🎯
  • -p port, --guiport=port β€” attach pmstat to an existing pmtime(1) time control process instance via the IPC channel identified by the port argument. this option is normally only used by other tools, e.g. pmchart(1), when they launch pmstat with synchronized time control πŸ”—
  • -P, --pause β€” pause between updates for archive replay ⏸️
  • -s samples, --samples=samples β€” the samples option defines the number of samples to be retrieved and reported. if samples is 0 or -s is not specified, pmstat will sample and report continuously β€” this is the default behavior πŸ”
  • -S starttime, --start=starttime β€” when reporting archived metrics, the report will be restricted to those records logged at or after starttime. refer to PCPIntro(1) for a complete description of the syntax for starttime ⏰
  • -t interval, --interval=interval β€” set the reporting interval to something other than the default 5 seconds. the interval argument follows the syntax described in PCPIntro(1), and in the simplest form may be an unsigned integer (the implied units in this case are seconds) βŒ›
  • -T endtime, --finish=endtime β€” when reporting archived metrics, the report will be restricted to those records logged before or at endtime πŸ›‘
  • -V, --version β€” display version number and exit πŸ‘‹
  • -x, --xcpu β€” the extended CPU metrics option, causes three additional CPU metrics to be reported, namely wait for I/O ("wa"), virtualisation steal time ("st"), and virtual guest time ("gu") πŸ”₯
  • -z, --hostzone β€” change the reporting timezone to the local timezone at the host that is the source of the performance metrics, as identified via either the -h or -a options 🌍
  • -Z timezone, --timezone=timezone β€” by default, pmtime reports the time of day according to the local timezone on the system where pmstat is run. the -Z option changes the timezone to timezone in the format of the environment variable TZ as described in environ(7) πŸ•°οΈ
  • -?, --help β€” display usage message and exit πŸ™‹

✨ OUTPUT ✨

the output from pmstat is directed to standard output, and the columns in the report are interpreted as follows:

  • loadavg β€” the 1 minute load average πŸ“ˆ
  • memory β€” the swpd column indicates average swap space used during the interval, in Kbytes. the free column indicates average free memory during the interval, in Kbytes. the buff column indicates average buffer memory in use during the interval, in Kbytes. the cache column indicates average cached memory in use during the interval, in Kbytes.

if the values become large, they are reported as Mbytes (m suffix) or Gbytes (g suffix) πŸ“

  • swap β€” the metrics in this area of the kernel instrumentation are of varying value. we try to report the average number of pages that are paged in (pi) and out (po) per second during the interval. if the corresponding page swapping metrics are unavailable, we report the average rate per second of swap operations in (si) and out (so) during the interval. it is normal for the in'' values to be non-zero, but the system is suffering <red>memory stress</red> if the out'' values are non-zero over an extended period 😭

if the values become large, they are reported as thousands of operations per second (K suffix) or millions of operations per second (M suffix) πŸ’€

  • io β€” the bi and bo columns indicate the average rate per second of block input and block output operations (respectfully) during the interval. unless all file systems have a 1 Kbyte block size, these rates do not directly indicate Kbytes transferred.

if the values become large, they are reported as thousands of operations per second (K suffix) or millions of operations per second (M suffix) πŸ’½

  • system β€” interrupt rate (in) and context switch rate (cs). rates are expressed as average operations per second during the interval. note that the interrupt rate is normally at least HZ (the clock interrupt rate, usually 100) interrupts per second ⚑

if the values become large, they are reported as thousands of operations per second (K suffix) or millions of operations per second (M suffix) πŸŒ€

  • cpu β€” percentage of CPU time spent executing user and "nice user" code (us), system and interrupt processing code (sy), idle loop (id) πŸ‘‘

if any values for the associated performance metrics are unavailable, the value appears as ``?'' in the output. iconic behavior honestly ❓


✨ FILES ✨

  • $PCP_VAR_DIR/pmns/* β€” default PMNS specification files πŸ—‚οΈ
  • $PCP_VAR_DIR/config/pmlogger/config.pmstat β€” pmlogger(1) configuration for creating an archive suitable for replay with pmstat πŸ“Ό

✨ PCP ENVIRONMENT ✨

environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. on each installation, the file /etc/pcp.conf contains the local values for these variables. the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5) πŸ› οΈ

for environment variables affecting PCP tools, see pmGetOptions(3) 🫢


bestie reminder: the vibe is yours to enjoy, but every flag, file and number up there is doing real work. don't skip the details, they're the whole point πŸ’…βœ¨

...and there's more coming, so don't go anywhere πŸŽ€

πŸ› DEBUGGING OPTIONS πŸ›

okay so if things are being weird and you need the tea on what's actually happening inside, there's a flag for that. the -D or --debug option turns on extra diagnostics that get printed to stderr πŸ’… it's there to help triage problems, bestie.

⚠️ ngl, heads up: that info is sometimes cryptic and is primarily intended to provide guidance for developers rather than for end-users. so if it reads like a cryptic group chat you weren't added to… yeah, that's expected 😭

here's the thing: debug is a comma separated list of debugging options β€” so you can stack a bunch of them at once, no cap. and if you're sitting there like "okay but what are the options and what do they even mean", just run pmdbg(1) with the -l option and it'll hand you the full list of available debugging options plus their meanings. slay ✨


πŸ‘€ SEE ALSO πŸ‘€

the whole extended cinematic universe, fr fr:


and that's the whole page, bestie 🫢 this one's brought to you by Performance Co-Pilot, filed under PCP, living in section PMSTAT(1) β€” go forth and monitor, you icon πŸ‘‘

πŸ“¦ where this page comes from