No project description provided
Project description
prometheus-dirsize-exporter
Export directory size metrics efficiently.
Why?
When providing multi-user interactive computing services (with a HPC cluster
or with JupyterHub), it's very helpful to know the home directory sizes of
each user over time. However, as NFS is often used, running du
constantly
takes a long time, uses too many IOPS that we may not have many of, and is
plain inefficient.
This project provides a way to keep track of directory sizes with a budgeted amount of IOPS. You can ask it to take however much time it needs but not use more than 100 IOPS, and it will do that. We do not necessarily need very up to date directory size metrics, so this is ok.
Installation
Install the package from PyPI:
pip install prometheus-dirsize-exporter
Running
You can start the process from the commandline:
dirsize-exporter <path-to-parent-directory> <iops-budget> <wait-time-in-minutes>
For example, to export metrics about directories under /home
, using no more
than 200 IO operations per second, updating every 60minutes, you would run:
dirsize-exporter /home 200 60
You can check out the metrics by hitting http://localhost:8000
. The port can
be controlled via a --port
argument.
Metrics recorded
The following metrics are recorded for all top level subidrectories of the parent directory:
- Total Size (in bytes)
- Last Modified (including all the descendents)
- Total Number of Entries (Files, directories & symlinks)
- Processing Time required to gather this information
This is only reported if
--enable-detailed-processing-time-metric
flag is passed, to prevent possible explosion of stored size of prometheus metrics when collected. This information is also not particularly useful outside of debugging this exporter, and as it varies each run, compresses poorly. - Last updated
Limitations
- As directory contents might change in the course of a single run as we wait for budgets to become available, information about a directory may not be exactly correct immediately.
- Because we do not spread the IOPS through time, the IO usage is 'spiky' - all IOPS get done at the beginning of a second, and then it goes silent. If you have a big IOPS budget, this can cause performance degradation.
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
Built Distribution
File details
Details for the file prometheus-dirsize-exporter-2.0.tar.gz
.
File metadata
- Download URL: prometheus-dirsize-exporter-2.0.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67738f152c6e9b1e4aff446eb2f2472b78b53c7f7963077fa4742eee04b93e59 |
|
MD5 | 038e8b786679ee091582f1bdc915a498 |
|
BLAKE2b-256 | 38c2977fd7806e1052341762ba48772fbe0817af7d8cd0b61cb5ac0a86c68cd2 |
File details
Details for the file prometheus_dirsize_exporter-2.0-py3-none-any.whl
.
File metadata
- Download URL: prometheus_dirsize_exporter-2.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17dc654e6636d162a701780bbdff1890367dfe3a8075e8049682e31964271ce7 |
|
MD5 | e3aed5d5063f1505b604a0a705bd23a2 |
|
BLAKE2b-256 | 2ca61e2a5fb32e63252455d898937ee5bff5e588ce5147dfb9fd42350b4318c1 |