PMDAPROC(1)

PMDAPROC πŸ’…βœ¨

okay so bestie, this is the man page for pmdaproc, section 1 of the general commands manual. it's the process performance metrics domain agent, aka the PMDA that knows literally everything about what your processes are doing. buckle up, she's a long one πŸŽ€


✨ NAME ✨

pmdaproc β€” process performance metrics domain agent (PMDA)


🌸 SYNOPSIS 🌸

$PCP_PMDAS_DIR/proc/pmdaproc [-AL] [-D debug] [-d domain] [-l logfile]
[-r cgroup] [-U username]

πŸ’– DESCRIPTION πŸ’–

pmdaproc is a Performance Metrics Domain Agent (PMDA) that pulls out performance metrics describing the state of the individual processes running on a Linux system. like, every single one. it's giving surveillance but make it ✨observability✨.

the proc PMDA exports metrics that measure the memory, processor and other resource use of each process, plus summary info collated across all of the running processes. this includes per-process NUMA placement summaries from /proc/<pid>/numa_maps via the proc.numa_maps.* metrics. yes bestie, NUMA too, we're thorough.

the PMDA uses credentials passed from the PMAPI(3) monitoring tool identifying the user requesting the information, to make sure that only values the user is allowed to access get returned by the PMDA. how? it temporarily changes its effective user and group identifiers for the duration of requests for instances and values. in other words, the system calls to extract info are performed as the user originating the request, not as a privileged user. periodt. the mechanisms available for transfer of user credentials are described further in the PCPIntro(1) page.

here's a lil rundown of the pmdaproc command line options, bestie:

  • -A β€” disables use of the credentials provided by PMAPI client tools and simply runs everything under the "root" account. refer to the ACCESS CONFIGURATION section below for finer grained control when using pmcd(1) with remote client authentication. only enable this option if you understand the risks involved, and are sure that all remote accesses will be from benevolent users. if enabled, unauthenticated remote PMAPI clients will be able to access potentially sensitive performance metric values which an unauthenticated PMAPI client usually would not be able to. refer to CVE-2011-2495 and CVE-2012-3419 for additional details. 🚨
  • -L β€” changes the per-process instance domain used by most pmdaproc metrics to include threads as well. threads girlies, this one's for you 🧡
  • -d domain β€” it is absolutely crucial that the performance metrics domain number specified here is unique and consistent. that is, domain should be different for every PMDA on the one host, and the same domain number should be used for the same PMDA on all hosts. no cap, this matters.
  • -l logfile β€” location of the log file. by default, a log file named proc.log is written in the current directory of pmcd(1) when pmdaproc is started, i.e. $PCP_LOG_DIR/pmcd. if the log file cannot be created or is not writable, output is written to the standard error instead.
  • -r cgroup β€” restrict the set of processes exported in the per-process instance domain to only those processes that are contained by the specified cgroup resource container. this option provides an optional finer granularity to the monitoring, and can also be used to reduce the resources consumed by pmdaproc during requests for instances and values.
  • -U username β€” user account under which to run the agent. the default is the privileged "root" account, with seteuid (2) and setegid (2) switching for accessing most information.

πŸ”₯ HOTPROC OVERVIEW πŸ”₯

the pmdaproc Performance Metrics Domain Agent (PMDA) includes an additional set of per-process metrics with an instance domain of processes restricted to an "interesting" or "hot" set. unlike the stock metrics exported by the proc PMDA, which have an instance domain equal to the current processes, hot metrics have an instance domain which is a subset of this. this hotproc instance domain is determined by a configurable predicate evaluated over some refresh interval.

as well as the equivalent per-process proc metrics, hotproc provides:

  • a cpuburn metric which specifies the CPU utilization of the process over the refresh interval
  • total metrics which indicate how much of the available CPU time the "interesting" processes account for
  • predicate metrics which show the values of the reserved variables (see below) that are being used in the hotproc predicate
  • control metrics for controlling the agent

iconic, honestly. πŸ‘‘


πŸŽ€ HOTPROC CONFIGURATION πŸŽ€

the configuration file consists of one predicate used to determine if a process should be in the interesting set or not.

an example configuration file may be found at $PCP_PMDAS_DIR/proc/samplehotproc.conf

this file with any modifications can be copied to $PCP_PMDAS_DIR/proc/hotproc.conf in order to configure the hot metrics. the pmstore(1) and pmStore(3) interfaces can be used as well (described below).

the predicate is described using the language specified below. the symbols are based on those used by the C(1) and awk(1) languages.

Boolean Connectives

&& (and), || (or), ! (not), () (precedence overriding)

Number comparators

< , <= , > , >= , == , !=

String comparators

== , !=

String/Pattern comparators

~ (string matches pattern) , !~ (string does not match pattern)

Reserved variables

  • uid (user id; type integer)
  • uname (user name; type string)
  • gid (group id; type integer)
  • gname (group name; type string)
  • fname (process file name; type string)
  • psargs (process file name with args; type string)
  • cpuburn (cpu utilization; type float)
  • iodemand (I/O demand - Kbytes read/written per second; type float)
  • ctxswitch (number of context switches per second; type float)
  • syscalls (number of system calls per second; type float)
  • virtualsize (virtual size in Kbytes; type float)
  • residentsize (resident size in Kbytes; type float)
  • iowait (blocked and raw io wait in secs/sec; type float)
  • schedwait (time waiting in run queue in secs/sec; type float)

Literal values

1234 (positive integer), 0.35 (positive float), "foobar" (string; delimited by "), /[fF](o)+bar/ (pattern; delimited by /), true (boolean), false (boolean)

Comments

#this is a comment (from # to the end of the line).

Examples

cpuburn > 0.2 # cpu utilization of more than 20%
cpuburn > 0.2 && uname == "root"
cpuburn > 0.2 && (uname == "root" || uname == "hot")
psargs ~ /pmda/ && cpuburn > 0.4

the hotproc.predicate metrics may be used to see what the values of the reserved variables are that were used by the predicate at the last refresh. they do not cover the reserved variables which are already exported elsewhere. a hotproc.predicate metric may not have a value if it is not referenced in the configuration predicate. πŸ’€


🌈 DYNAMIC CONFIGURATION 🌈

the hot process metrics can also be configured at runtime through the pmstore(1) interface (and, implicitly, the pmStore(3) API)

Examples

pmstore hotproc.control.config 'fname == "mingetty"'
pmstore hotproc.control.config 'uid == 0'

to force the config file to be reloaded:

pmstore hotproc.control.reload_config "1"

πŸ’œ ACCESS CONFIGURATION πŸ’œ

access to per-process metrics is controlled by several factors.

when using automatically authenticating local connections, such as through the "unix:" or "local:" style context, then client tools will have full access to these metrics as if sampling the metrics directly as the user running the client tool.

when using pmcd with remote, authenticated clients it is possible to specify a set of user names that are allowed access to the process metrics.

a configuration file $PCP_SYSCONF_DIR/proc/access.conf can be used to fine-tune this behaviour, and it supports two keywords:

  • allowed β€” a comma-separated list of authenticated user names that will be allowed access to per-process metrics. sampling is performed as the root user.
  • mapped β€” a boolean value, when true indicating that authenticated user names will be mapped to local system user account names (this requires a one-to-one user name mapping between the account and the SASL-based authenticated user name enforced by pmcd(1)). sampling is performed as that local user.

πŸ¦‹ INSTALLATION πŸ¦‹

the proc PMDA is installed and available by default. if you want to undo the installation, do the following as root:

# cd $PCP_PMDAS_DIR/proc
# ./Remove

if you want to establish access to the names, help text and values for the proc performance metrics once more, after removal, do the following as root:

# cd $PCP_PMDAS_DIR/proc
# ./Install

pmdaproc is launched by pmcd(1) and should never be executed directly. the Install and Remove scripts notify pmcd(1) when the agent is installed or removed. don't be a rebel bestie, let pmcd drive πŸš—


πŸ’… FILES πŸ’…

  • $PCP_PMCDCONF_PATH β€” command line options used to launch pmdaproc
  • $PCP_PMDAS_DIR/proc/help β€” default help text file for the proc metrics
  • $PCP_PMDAS_DIR/proc/Install β€” installation script for the pmdaproc agent
  • $PCP_PMDAS_DIR/proc/Remove β€” undo installation script for the pmdaproc agent
  • $PCP_LOG_DIR/pmcd/proc.log β€” default log file for error messages and other information from pmdaproc
  • $PCP_PMDAS_DIR/proc/samplehotproc.conf β€” simple sample hotproc configuration
  • $PCP_PMDAS_DIR/proc/hotproc.conf β€” default hotproc configuration file
  • $PCP_SYSCONF_DIR/proc/access.conf β€” default access control configuration file

⭐ 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).


✨ DEBUGGING OPTIONS ✨

okay so when things get weird and you need the tea β˜• on what pmdaproc is actually doing, bestie, there's a whole debug mode for that.

The -D or --debug option turns on extra diagnostics dumped to stderr to help you triage problems. lowkey it's giving cryptic sometimes, and it's mostly meant to guide developers rather than end-users, but it's still super useful when you're deep in the weeds. πŸ•΅οΈβ€β™€οΈ

debug is a comma separated list of debugging options β€” so you can stack them like your fave lip gloss πŸ’„. Use pmdbg(1) with the -l option to get the full list of available debugging options and what they mean.

Debugging options specific to pmdaproc are as follows:

  • appl0 β€” cgroup handling πŸ—‚οΈ
  • appl1 β€” refresh processing, including hotproc metrics πŸ”₯
  • appl2 β€” PMNS operations 🌐
  • appl3 β€” process accounting metrics πŸ“Š

🌸 SEE ALSO 🌸

go read these next, bestie, they're literally the friend group of this man page:


and that's the whole vibe, no cap. this page came from Performance Co-Pilot / PCP and it's the PMDAPROC(1) manual β€” periodt πŸ’…βœ¨ stay iconic, and may your processes always be accounted for πŸ«ΆπŸ’–

πŸ“¦ where this page comes from