Installation and Usage

Use pip to install the sensor, then configure it using the cms.perf directive. To avoid conflicts with other libraries and applications, a Python virtual environment is recommended.

Installing the Sensor

The cms_perf library and executable are available via the pip package manager.

# install globally for the system Python3
python3 -m pip install cms_perf

Note

The psutil dependency requires a C compiler and Python headers. On a RHEL system, use yum install gcc python3-devel to install both. See the psutil documentation for details and other systems.

Installing the sensor creates a cms_perf executable. The module can also be run directly by the respective python executable, e.g. python3 -m cms_perf.

cms_perf --help

Configuring XRootD

Set cms_perf as the pgm of the cms.perf directive. Use the same interval for the directive’s int and the sensor’s --interval.

set SCRIPT_BIN = /usr/local/bin
cms.perf int 2m pgm $(SCRIPT_BIN)/cms_perf --interval 2m

See the cms.perf documentation for details of the directive.

Note

Make sure to provide the same interval to both XRootD itself and the cms_perf executable.

Sensor Configuration

The cms_perf sensor can be configured for report interval and ramp up, load sensors and cms.sched emulation. The CLI supports both directly specified options as well as ini-style configuration files.

cms_perf --interval 10

The following general options are supported:

--help

show this help message and exit

--version

show program’s version number and exit

--interval

Interval between output [default: 60s]

--rampup

Duration in which usage is dampened [default: 0s]

--sched

cms.sched directive to report total load and maxload on stderr [default: None]

See the CLI Sensor Language guide for details of sensor options.

Configuration File Format

The configuration file uses option = value when the CLI would use --option value. Only one option per line is allowed; # marks comments for the rest of the line and empty lines are ignored.

interval = 60s
rampup = 10m
# Redefine prunq and ppag based on machine size
prunq = 100.0*loadq/10/ncores
pcpu = pcpu
pmem = pmem
ppag = 100.0*nsockets/250/ncores
pio = pio

Both CLI and file options are processed in-order, with later settings replacing earlier ones. For example, this allows to use a configuration file for defaults and CLI options for specific settings.