PMPROXY(1)
π¦ PMPROXY(1) β proxy for performance metrics collector and querying
okay so we're in the General Commands Manual bestie, and this one is called PMPROXY(1). it's a whole vibe. sit down, grab a snack π, we're doing this.
πΈ NAME
pmproxy β proxy for performance metrics collector and querying. that's the whole name section. short, sweet, iconic. π
β¨ SYNOPSIS
pmproxy [-AdfFt?] [-c conffile] [-D debug] [-h host[,host ...] [-i
ipaddress] [-l logfile] [-L bytes] [-p port[,port ...] [-r port[,port
...] [-s sockname] [-U username] [-x outfile]
yeah the brackets are a little unhinged, that's just how it is, no cap. π
π«Ά DESCRIPTION
so pmproxy is a protocol proxy. it lets Performance Co-Pilot (PCP) monitoring clients connect indirectly to one or more pmcd(1) and/or key-value servers (like https://valkey.io/ for example). yes, indirectly. it's the middle bestie. the wingwoman. the one who knows a guy. π
in its default mode of operation, pmproxy provides the REST API for PCP services β see PMWEBAPI(3) for the details. that includes:
- an Open Metrics (https://openmetrics.io) text interface for PCP metrics at
/metrics - real-time access to PCP metrics through the
/pmapiinterfaces - access to the fast, scalable PCP time series query capabilities that come with a key-value server (peep
pmseries(1)) via the/queryREST interfaces
pmproxy can be deployed in a firewall domain, or on a cluster ``head'' node, in the situation where the IP (Internet Protocol) address of the hosts where pmcd and/or a key-value server (like https://valkey.io/) are running might be unknown to the PCP monitoring clients β but the IP address of the host running pmproxy is known to those clients. same energy the other way too: clients might only have network connectivity to the host where pmproxy is running, while that host has connectivity out to the hosts of interest where pmcd and/or a key-value server are running. it's giving networking diplomacy. π
the behaviour of the PCP monitoring clients is controlled by either:
- the
PMPROXY_HOSTenvironment variable, or - the extended hostname specification (see
PCPIntro(1)for that)
if neither of those mechanisms is used, clients will make their PMAPI(3) connections directly to pmcd. but if the proxy hostname syntax is used, or PMPROXY_HOST is set, then that should be the hostname or IP address of the system where pmproxy is running β and the clients will connect to pmcd or a key-value server indirectly through the protocol proxy services of pmproxy. periodt. π
π OPTIONS
the available command line options are, and I'm listing every single one because we don't skip:
-Aβ disable service advertisement. by defaultpmproxywill advertise its presence on the network using any available mechanisms, helping remote monitoring tools find it. this option disables those mechanisms. bye bestie π-cconffile,--config=conffile β specify the path to an optional configuration conffile, with the format described in the ``CONFIGURATION'' section. this option impliespmproxyis running in timeseries mode. (we'll get to that section, hold on π« )-d,--deprecatedβ by defaultpmproxyprefers to run in the new timeseries mode, providing REST APIs, asynchronous network I/O, scalable time series, and secure connections using OpenSSL. however, legacy deployments may wish to use the original synchronouspmproxyimplementation usinglibpcpnetworking β this option is how you do that. > note: the-dand-toptions are mutually exclusive. can't have both, bestie, pick a lane π-f,--foregroundβ by defaultpmproxyis started as a daemon. the-foption says: no, run in the foreground. this is most useful when you're trying to diagnose problems with establishing connections. debugging szn π-F,--managedβ like-f, the-Foption runspmproxyin the foreground, but it also does some housekeeping (like create a ``pid'' file and change user id). this is intended for whenpmproxyis launched fromsystemd(1)orlaunchd(1), where the daemonising has already been done bysystemd(1)orlaunchd(1)and doesn't need to be done again bypmproxyβ which is the case when neither-fnor-Fis specified.
at most one of-fand-Fmay be specified. choose wisely π
-hhost,--keyhost=host β specify an alternate key-value server host to connect to for time series querying, overriding any configuration file settings. this option impliespmproxyis running in timeseries mode.-iipaddress,--interface=ipaddress β this option is usually only used on hosts with more than one network interface (super common for firewall and ``head'' node hosts, wherepmproxyis likely to be deployed to arbitrate access to an internal network). if no-ioptions are specified,pmproxyaccepts PCP client connections on any of its host's IP addresses. the-ioption is used to explicitly specify an IP address that PCP client connections should be accepted on. ipaddress should be in the standard dotted form (e.g.100.23.45.6). the-ioption may be used multiple times to define a list of IP addresses. when one or more-ioptions is specified, attempted connections made on any other IP addresses will be refused. π«-llogfile,--log=logfile β by default a log file namedpmproxy.logis written in the current directory. the-loption causes the log file to be written to a given logfile instead of the default. if this logfile cannot be created or is not writable, output is written to the standard error instead. no logfile, no problem, we improvise β¨-Lbytes β PDUs received bypmproxyfrom PCP monitoring clients are restricted to a maximum size of65536bytes by default, to defend against Denial of Service attacks. the-Loption may be used to change the maximum incoming PDU size. protect the peace π‘οΈ-pport,--port=port β specify an alternate port number to listen on for client connections. the default value is44322. π―-Q,--certreqdβ require that all client connections provide a trusted client certificate. no cert, no entry. π-rport,--keyport=port β specify an alternate key-value server port number to connect to for time series querying, overriding any configuration file settings. this option impliespmproxyis running in timeseries mode.-ssockname,--socket=sockname β specify the path to a local unix domain socket (for platforms supporting this socket family only). the default value is$PCP_RUN_DIR/pmproxy.socket. this option impliespmproxyis running in timeseries mode. π§¦-S,--reqauthβ require that all client connections be authenticated. π-t,--timeseriesβ operate in automatic archive timeseries discovery mode. this mode of operation will enable thePMWEBAPI(3)REST APIs, dynamically and automatically detect active system archives being written bypmlogger(1), and import them into a key-value server (such as https://valkey.io/), for the fast, scalable time series querying described inpmseries(1).
heads up bestie: in this mode of operation,pmproxyonly "log-tails" and ingests actively growing archives, e.g. as written by one or morepmlogger(1)instances.
when an archive is first discovered (usually but not limited to pmproxy startup), all metadata is loaded and sent to the configured key-value server β however, note that only new archive metric value data from the tail end of each archive is ingested. compressed archives never grow and so are ignored. π see the --load option to pmseries(1) for a supported mechanism for manually loading all of the metric value data from previously collected (inactive) archives, whether compressed or not. it would be normal, though not mandated, for a set of archives being manually loaded to cover the same time period, e.g. archive data for a particular week for one or more hosts in the same data-centre. π
-Uusername,--username=username β assume the identity of the given username before starting to accept incoming packets from PCP monitoring clients. glow-up via identity change β¨-xoutfile β before thepmproxylogfile can be opened,pmproxymay encounter a fatal error which prevents it from starting. by default the output describing this error is sent to/dev/tty, but it may be redirected to outfile. π-?,--helpβ display usage message and exit. the classic. π
π CONFIGURATION
when running in the timeseries mode of operation, runtime configuration is relatively complex and typically handled via the $PCP_SYSCONF_DIR/pmproxy/pmproxy.conf file. this file is in the common ``ini'' format, with section headers and individual variables and values with each section. the configuration file installed as part of PCP documents every available section and option. yes, every single one. the receipts are in the file itself. π
at a high level, the [pmproxy] section can be used to explicitly enable or disable each of the different protocols. ποΈ
the [http] section provides fine-tuning over HTTP server settings used by pmproxy. chunksize sets the chunked transfer encoding buffer size, and defaults to the system pagesize. access control HTTP protocol settings can be adjusted using the Access-Control-Allow-Headers and Access-Control-Max-Age options. discussion of these HTTP protocol headers is beyond the scope of this document, but suitable default values are described within the pmproxy.conf configuration file. iykyk. π€·βοΈ
the [keys] section allows connection information for one or more backing key-value server processes to be configured (hostnames and ports). note: to access multiple (scalable) key-value servers, the servers variable in this section can be a comma-separated list of hostname:port pairs. alternatively, it can be a single key-value server host that will be queried using the "CLUSTER INFO" command to automatically configure multiple backing hosts. ποΈβ¨
in earlier versions of PCP (before 6) an alternative configuration setting section was used for this purpose β key-value servers were specified in the [pmseries] section, and this is still accepted as a fallback for backwards compatibility. the old way still hits different, respectfully. π«Ά
okay bestie, part two, let's GO π
πΈ STARTING AND STOPPING PMPROXY πΈ
So like, normally? pmproxy just does its thing all on its own β it starts at boot time and stops when the system is being brought down. No input from you, no drama, she's just there. π
But sometimes you gotta step in manually, and that means becoming superuser (yes, the big powers) and typing:
# $PCP_RC_DIR/pmproxy start
to start pmproxy, or:
# $PCP_RC_DIR/pmproxy stop
to stop pmproxy. π
And here's a lil fun fact bestie: starting pmproxy when it is already running is literally the same as stopping it and then starting it again. Not a bug, just her vibe. β¨
Normally pmproxy listens for PCP client connections on TCP/IP port number 44322 (as well as 44323 with timeseries enabled) β and those bad boys are registered at https://www.iana.org/. iykyk.
Wanna pick your own ports? Two ways, bestie:
- the environment variable
PMPROXY_PORT, or - the
-pcommand line option
...may be used to specify alternative port number(s) when pmproxy is started. In each case, the specification is a comma-separated list of one or more numerical port numbers. π
Now the β¨unionβ¨ situation: should both methods be used, or multiple -p options appear on the command line, pmproxy will listen on the union of the set of ports specified via all -p options and the PMPROXY_PORT environment variable. She's not picking favourites, she's collecting them. π
β οΈ Heads up bestie: if non-default ports are used withpmproxy, care should be taken to ensure thatPMPROXY_PORTis also set in the environment of any client application that will connect topmproxy, or that the extended host specification syntax is used (seePCPIntro(1)for details).
π DIAGNOSTICS π
If pmproxy is already running, the message
Error: OpenRequestSocket bind: Address already in use
will appear. π
This may also appear if pmproxy was shutdown with an outstanding request from a client. In this case, a request socket has been left in the TIME_WAIT state, and until the system closes it down (after some timeout period) it will not be possible to run pmproxy. So basically she's ghosting you for a sec. not her fault fr.
In addition to the standard PCP debugging options, see pmdbg(1), pmproxy currently supports the debugging option context for tracing client connections and disconnections. π΅οΈββοΈ
π FILES π
$PCP_PMPROXYOPTIONS_PATHβ command line options forpmproxywhen launched from$PCP_RC_DIR/pmproxy. All the command line option lines should start with a hyphen as the first character. (yes, every single one, don't test her π)$PCP_SYSCONFIG_DIR/pmproxyβ Environment variables that will be set whenpmproxyexecutes. Only settings of the form"PMPROXY_VARIABLE=value"will be honoured. π―./pmproxy.logβ (or$PCP_LOG_DIR/pmproxy/pmproxy.logwhen started automatically) All messages and diagnostics are directed here. π/etc/pki/tlsβ default OpenSSL certificate database directory, optionally used for Secure Socket Layer connection in timeseries mode of operation. These certificates can be created and queried using theopenssltool, amongst others. π
π ENVIRONMENT π
In addition to the PCP environment variables described in the PCP ENVIRONMENT section below, there are several environment variables that influence the interactions between a PCP monitoring client, pmproxy and pmcd. (it's giving group project energy ngl)
PMCD_PORTβ For the PCP monitoring client this (or the default port number) is passed topmproxyand used to connect topmcd. In the environment ofpmproxy,PMCD_PORTis not used. π«PMPROXY_HOSTβ For the PCP monitoring client this is the hostname or IP address of the host wherepmproxyis running. In recent versions of PCP (since version 3) this has been superseded by the extended hostname syntax (seePCPIntro(1)for details). πPMPROXY_PORTβ For the PCP monitoring client this is the port on whichpmproxywill accept connections. The default is44322, as well as44323with timeseries enabled. πPMCD_CONNECT_TIMEOUT,PMCD_RECONNECT_TIMEOUTandPMCD_REQUEST_TIMEOUTβ (seePCPIntro(1)) For the PCP monitoring client, setting these environment variables will modify the timeouts used for interactions between the client andpmproxy(independent of whichpmcdis being used). Forpmproxythese same environment variables control the timeouts betweenpmproxyand allpmcd(1)instances (independent of which monitoring client is involved). β°
If set to the value 1, the PMPROXY_LOCAL environment variable will cause pmproxy to run in a localhost-only mode of operation, where it binds only to the loopback interface. Homebody era. π
The PMPROXY_MAXPENDING variable can be set to indicate the maximum length to which the queue of pending client connections may grow. π
π¦ 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).
π DEBUGGING OPTIONS π
The -D or --debug option enables the output of additional diagnostics on stderr to help triage problems, although the information is sometimes cryptic and primarily intended to provide guidance for developers rather than for end-users. (translation: this is dev-coded bestie, but you're smart, you got this πͺ)
debug is a comma separated list of debugging options; use pmdbg(1) with the -l option to obtain a list of the available debugging options and their meaning.
Debugging options specific to pmproxy are as follows:
appl0β client connections and disconnections πappl1β desperate logging mode, where a period followed by the PID ofpmproxyis inserted in the name ofRlogfilebefore the last period, so for examplepmproxy.logbecomespmproxy.<pid>.logπ±appl2β log incoming HTTP URLs (this is also enabled by thehttpdebugging option, but the latter has broader scope because it turns on debugging in the libraries thatpmproxyuses) π
β SEE ALSO β
PCPIntro(1), pmcd(1), pmdbg(1), pmlogger(1), pmseries(1), PMAPI(3), PMWEBAPI(3), pmGetOptions(3), pcp.conf(5) and pcp.env(5).
and that's a wrap bestie!! π«Ά this lil masterpiece came to you courtesy of Performance Co-Pilot (PCP), page PMPROXY(1), stamped with its very own date down in the footer. go forth and proxy responsibly, mwah π
πβ¨
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2013-2015,2018-2019,2021-2023 Red Hat
- Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms