Skip to main content

Sensor for the XRootD cms.perf directive

Project description

Sensor for use in the XRootD cms.perf directive. Measures system load, as well as cpu, memory, and network utilization, to enable load-balancing in a cluster of multiple XRootD servers.

Installation and Usage

Use pip to install the sensor, then configure it using the cms.perf directive.

Installing the sensor

The sensor can be installed using the Python package manager:

python3 -m pip install cms_perf

Installing the sensor creates a cms_perf executable.

When installed for a non-standard Python, such as a venv, the module can be run directly by the respective python executable:

python3 -m cms-perf

Configuring xrootd

Add the script or module as the pgm executable of the cms.perf directive. Set the same interval for the directive’s int and the sensor’s --interval.

# installed for system python
cms.perf int 2m pgm /usr/local/bin/cms_perf --interval 2m
# installed for virtual environment
cms.perf int 2m pgm /path/to/venv/bin/python -m cms_perf --interval 2m

See the cms.perf documentation for details of the directive. Consult the sensor’s help via cms_perf --help for details of the sensor.

Using pag plugins

The pag (paging load) sensor is by default always 0. cms_perf avoids calculating this metric entirely, similar to other tools such as XRootD’s own XrdOlbMonPerf:

# what's the paging I/O activity ?
# useless as this metric is highly correlated with some of the others above.
# being kept for backward compatibility with the load balancer.
$pgio = 0;

cms_perf allows to use the pag slot for one of several plugins. A plugin is selected by passing pag=<plugin name> to cms_perf.

$ # show help and plugins
$ cms_perf --help
...
$ # show plugin specific help
$ python -m cms_perf pag=xrootd.num_fds -h
...
$ # use sensor with plugin
$ cms_perf --interval 10 pag=xrootd.num_fds --max-core-xfds 10
32 10 73 32 0
33 4 72 34 0
...

Testing cms.sched policies

To gauge how a server is rated by a manager cms, cms_perf allows to evaluate the total weight of the collected sensor data. Use the --sched option and pass a cms.sched directive that you want to test; in addition to the sensor data on stdout, the total weight is written to stderr.

$ python3 -m cms_perf --interval=1 --sched 'cms.sched runq 20 cpu 20 mem 60 maxload 45'
13 1 70 0 0 44
13 3 70 0 0 45!
13 1 70 0 0 44
13 1 70 0 0 44
13 2 70 0 0 45

If maxload is given, a ! indicates whether the load exceeds it. All unused options, including the cms.sched word, are ignored and may be omitted.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cms_perf-0.3.0.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

cms_perf-0.3.0-py2.py3-none-any.whl (8.9 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page