Skip to content

Conversation

@osschar
Copy link
Contributor

@osschar osschar commented Feb 18, 2025

Resource Monitor (main class XrdPfcResourceMonitor) provides detailed and
accurate snapshots of state and usage of existing directories. It allows
optimization of per-directory statistics information collection and storage,
and reduces the number of required cache namespace traversals. It can
periodically export the state into json and binary files for viewing of
current state and for furhter processing or aggregation. Further, this
information also serves as input to purge process.

Purge plugin provides a class-based API that allows users to implement their
own steering of the purge priority selection. The purge is still directory
driven, i.e., the purge plugin is given a per-directory snapshot of resource
monitor state and responds with a list of { directory-path, bytes_to_remove }
structures. Pfc still drives the actual low-level directory traversal and file
purge -- though this could be relaxed in the future. If the plugin does not
schedule sufficient removals, the classic LRU algorithm kicks in to satisfy
the high/low watermark and file-based limits.

The purge-plugin API is defined in class Pfc::PurgePin. Reference
implementation, directory-quota based purging, is provided in the core PFC
library class XrdPfcPurgeQuota and can be enabled as:

  pfc.purgelib libXrdPfcPurgeQuota /etc/xrootd/quota.cfg

with entries in quota cfg file looking like:

  /store/mc 10T
  /store/data 12T
  /store/group 4T
  /store/group/visualization 500G

This is squashed into a single commit, over several rebases. For full history of commits see these branches:

@amadio
Copy link
Member

amadio commented Feb 19, 2025

For me it's ok to add this as a single commit. However, I suggest something like shown below for the commit message

[Pfc] Add ResourceMonitor and PurgePlugin

<Longer explanation of what the new plugins do>

Co-authored-by: Alja Mrak-Tadel <amraktadel@ucsd.edu>

to give both authors proper credit.

@osschar
Copy link
Contributor Author

osschar commented Feb 19, 2025

Thank you, will update the commit message before the final version of the PR.
I'm still waiting for the Pelican folks to test it in the wild and see how it works with their space manager, LotMan. Presuming this happens well before the 5.8 merge window.

@amadio
Copy link
Member

amadio commented Feb 19, 2025

The 5.8 merge window is now, I have already merged most things that will go into the next release. There's still lots to do before we release, however, so there's still time to test this before the final merge.

@osschar
Copy link
Contributor Author

osschar commented Feb 19, 2025

OK, thanks! I will get this ready before the coming Monday then, including testing at UCSD in production, have it mostly setup already.

@bbockelm
Copy link
Collaborator

This is actually out in production at a handful of caches -- so far, no major issues in the basic XCache functionality. Still have yet to enable the purge plugin (off by default) functionality thoroughly.

@osschar osschar force-pushed the xcache-purge-rebase-onto-master-latest branch from 1620b01 to cbe0973 Compare February 24, 2025 05:54
@osschar
Copy link
Contributor Author

osschar commented Feb 24, 2025

@amadio This should now be ready to go. I have removed the accidental change in readme and formatted the commit message as advised. Thank you very much for your help!!!

@osschar osschar added this to the 5.8.0 milestone Feb 24, 2025
@amadio
Copy link
Member

amadio commented Feb 24, 2025

@osschar Thank you! I see a couple of typos in the first commit (e.g. furhter). If you use git rebase -i you can edit the message to fix and mark the second commit as a fixup so it's merged with the previous one as well (I can do this if you want, just let me know). After that I will proceed with merging. Please ignore the failures in CI, I'm aware of them and know they are not related to your changes. I will push the changes to fix them after merging this. Cheers,

@osschar osschar force-pushed the xcache-purge-rebase-onto-master-latest branch from 89a8217 to 983bf61 Compare February 24, 2025 07:43
@osschar
Copy link
Contributor Author

osschar commented Feb 24, 2025

Thank you -- done as requested, this time with spell checker :)

Resource Monitor (main class XrdPfcResourceMonitor) provides detailed and
accurate snapshots of state and usage of existing directories. It allows
optimization of per-directory statistics information collection and storage,
and reduces the number of required cache namespace traversals. It can
periodically export the state into JSON and binary files for viewing of
current state and for further processing or aggregation. This
information also serves as input to purge process.

Purge plugin provides a class-based API that allows users to implement their
own steering of the purge priority selection. The purge is still directory
driven, i.e., the purge plugin is given a per-directory snapshot of resource
monitor state and responds with a list of { directory-path, bytes_to_remove }
structures. Pfc still drives the actual low-level directory traversal and file
purge -- though this could be relaxed in the future. If the plugin does not
schedule sufficient removals, the classic LRU algorithm kicks in to satisfy
the high/low watermark and file-based limits.

The purge-plugin API is defined in class Pfc::PurgePin. Reference
implementation, directory-quota based purging, is provided in the core PFC
library class XrdPfcPurgeQuota and enabled as:
  pfc.purgelib libXrdPfcPurgeQuota /etc/xrootd/quota.cfg
with entries in quota cfg file looking like:
  /store/mc 10T
  /store/data 12T

Co-authored-by: Alja Mrak-Tadel <amraktadel@ucsd.edu>
@osschar osschar force-pushed the xcache-purge-rebase-onto-master-latest branch from 983bf61 to a2b4940 Compare February 24, 2025 08:01
@amadio amadio merged commit 9387f64 into xrootd:master Feb 24, 2025
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants