Hi, all!
I am an end-user doing a little research for the engineering team -- so my descriptions of our system are going to be very handwavy.
System Details We are getting a brand new system and some brand new Posit Team licenses up an running on a single compute server (Linux, no slurm, no kubernetes) that will be used by a some handful (but rapidly growing #s) of mostly new-to-R analysts.
Issue In our old (free) Rstudio server environment, our system was generally well sized for the users, but we sometimes ran into instances when someone inadvertently used all cores (due to underlying detectCores() or availableCores() within functions-- not intentionally) and disrupted the environment for everyone. We would like to avoid or reduce this with the tools we have.
We thought this would be possible with Workbench but it doesn't seem to be.
What do people recommend, without (yet?) adopting slurm or kubernetes?
We don't want to overengineer the problem -- currently, we don't have many of users (few cores in use at a given time), and on occasion, someone has a heavy computational project where, with a little communication, we're ok with them making use of a substantial chunk of the environment for a period.
But it has certainly happened, and it is certainly a pain for all, and we would like to ensure that it happens very infrequently (we do not need to ensure that it can never happen).
Some thoughts:
-
I would love if we could set an environment variable on the system for some reasonable number to be returned by detectCores/ availableCores. This could be set to some reasonable number for all, and in the instances where someone has permission to use a substantial part of the server, they could override it. I really, really wanted this to exist, but as far as I can tell, it only does for {parallelly}. We could set the
R_PARALLELLY_AVAILABLECORES_FALLBACK
variable, which would take care of all packages that use {parallelly} for parallelizing, but that still leaves us vulnerable for anything that uses parallel::detectCores(). (Any idea what percentage of modern packages use each? I have no clue.) -
Most of our users are new-to-R and learning tidyverse. I want to believe this won't happen very often for our users (though history says it has happened plenty often to be problematic for those of us who rely on the R environment.) What packages use detectCores()? Is it possible to scrape CRAN for those packages and do a little active monitoring of people downloading those packages from Package Manager? Send people a warning message if they download {foreach} or {doParallel}?
-
Uninstall {parallel}. Create new {parallel} that incorporates the code from Attachment #2479 for bug #17641 and host that on Package Manager. (This sounds both horrifying and so tempting.)
-
Use cgroup stuff
-
Other...??
Would love to hear what people recommend!
Thanks!