Skip to content

Conversation

@smithdh
Copy link
Contributor

@smithdh smithdh commented Jan 16, 2025

No description provided.

@smithdh
Copy link
Contributor Author

smithdh commented Jan 16, 2025

To solve #2396 I've tried to do what appears to be the smaller change, move the NPROC rlimit change from an XrdScheduler constructor to a dedicated method, which is only called from the server code. A Scheduler object is still constructed as part of the XrdUtils.so library and in the case of client that will be unused. However rearranging the set of global objects in the 'XrdGlobal' namespace (used by some Xrd/ classes, e.g. XrdLink XrdPoll) seemed to be a larger change.

@smithdh
Copy link
Contributor Author

smithdh commented Jan 16, 2025

I've just relised Andy's comment:

Additionally, certain client plugins rely on the NPROC limit to be changed even in the presence of XRD_WORKERTHREADS setting.

is of course relating to clients and this patch could does change that case. I'll make another revision.

@amadio
Copy link
Member

amadio commented Jan 17, 2025

@smithdh Could you please base your branch on master? That will avoid the CI failures on Alpine and macOS. Thanks!

@smithdh smithdh changed the base branch from devel to master January 17, 2025 13:52
@smithdh smithdh changed the title [XrdScheduler] Move NPROC limit reset to dedicated method, xrootd#2396 [XrdScheduler] Add control of NPROC limit reset. Fixes #2396 Jan 17, 2025
@smithdh
Copy link
Contributor Author

smithdh commented Jan 21, 2025

Revised & rebased to master:

The intended behavior this patch should bring now:

(i) By default keep same behavior for servers (i.e. things which construct an XrdConfig object, cmsd & xrootd daemons). That means the nproc soft rlimit is set to 30000 if possible.

(ii) Other things that link or load libXrdUtils.so have a modified behavior: instread of setting the limit to 30000, the limit is raised to 30000 unless it is already less restrictive than that. (i.e. this applies to apps like xrdcp, frm_xfragent etc but could apply to anything linked with XrdCl, including python bindings or c++).

(iii) Introduced XRDLEAVENPROC: If that env variable is set then NPROC is not changed (in either of the cases).

@smithdh smithdh marked this pull request as ready for review January 21, 2025 14:14
@amadio amadio linked an issue Jan 25, 2025 that may be closed by this pull request
@amadio amadio added this to the 5.8.0 milestone Jan 27, 2025
@amadio
Copy link
Member

amadio commented Feb 10, 2025

@smithdh This is ready for merging, right?

@smithdh
Copy link
Contributor Author

smithdh commented Feb 13, 2025

Yes, this is ready to merge. Thanks.

@amadio amadio merged commit 3a5d37f into xrootd:master Feb 13, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Xrootd client import reduces nproc limit

2 participants