Faster reporting of user home directory sizes

Storage quotas help users avoid running out of space unexpectedly and give administrators visibility into capacity planning. However, storage usage can change rapidly, and it’s important to have quick information so that administrators know whether they are close to hitting limits.
We’ve improved how quickly hub administrators can see user home directory sizes across our JupyterHubs. This makes monitoring more responsive and adds quota limit visibility that wasn’t possible before.
Using jupyterhub-home-nfs for near-instant disk usage metrics
#
Our existing storage monitoring tool,
prometheus-dirsize-exporter, deliberately runs slowly to avoid excessive disk I/O. This meant home directory metrics could be hours out of date on systems with many users or large directories. Plus, there was no way to report user quota limits at all.
Our home directory storage is managed by
jupyterhub-home-nfs, which enforces per-user quotas. It could also expose usage and limit information as Prometheus metrics using data from the underlying filesystem quota system. Because this information is already tracked by the filesystem, it’s available immediately without scanning individual files.
We made two key improvements:
Make disk usage reporting almost instantaneous. We made
jupyterhub-home-nfsexporttotal_size_bytesandhard_limit_bytesmetrics to Prometheus for near-instant reporting. We used the same metric names and namespace asprometheus-dirsize-exporterfor compatibility. See 2i2c-org/jupyterhub-home-nfs#76Allow this to be used upstream in JupyterHub Grafana Dashboards so that it can support both types of disk usage reporting. This means users of the upstream JupyterHub Grafana dashboards get the same useful view about home directory usage, regardless of whether the metric comes from
prometheus-dirsize-exporterorjupyterhub-home-nfs. See 2i2c-org/prometheus-dirsize-exporter#29
These changes were deployed across all our communities, so administrators can now access current home directory information within minutes regardless of directory size.

Coming next #
We’d like to build on this work to enable alerting when individual users near their disk quotas. This will make it easier to more reliably track user disk usage across a community. See this issue for tracking: 2i2c-org/infrastructure#7166
Acknowledgements #
- This was a directed contribution supported by NASA VEDA to enable more proactive monitoring and alerting for hub administrators.
Thanks for reading! If you'd like to follow our work, join our mailing list or subscribe to our blog. You can read our community hub documentation or learn about membership.