User Specific Limits for JupyterHub

40 views
Skip to first unread message

David Greene

unread,
Mar 20, 2020, 2:41:40 PM3/20/20
to Project Jupyter
Hey folks,

I've been using the following in my jupyterhub_config.py to set the spawner limits.

## Maximum number of cpu-cores a single-user notebook server is allowed to use.
c.Spawner.cpu_limit = 20

## Maximum number of bytes a single-user notebook server is allowed to use.
c
.Spawner.mem_limit = '16G'

Is there a way to set this on a per-user basis? For example, if I want to set user jack's CPU limit to 0.5 and user jill's CPU limit to 10? 

Can this be done online (without restarting the whole JupyterHub service in systemd)?

Thanks!

Matthias Bussonnier

unread,
Mar 26, 2020, 11:28:47 AM3/26/20
to jup...@googlegroups.com
As far as I can tell not with the default spawner, but as the spawner
are plugins, you can write your own, or just extend the one you like
to have `cpu_limit` be a per-user value.

If you use a spawner like SlurmSpawner, then it might be easier to
configure this in Slurm itself that have such mechanism and do have
user<-> resources association. I'm guessing other Spawner might have
that as well.
--
Matthias
> --
> You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/c5338b26-3b52-43ff-a525-3cb0f5d6ab9d%40googlegroups.com.

David Greene

unread,
Mar 27, 2020, 11:42:00 AM3/27/20
to Project Jupyter
OK, I'll start with that. Thanks for the tip Matthias.


On Thursday, March 26, 2020 at 11:28:47 AM UTC-4, Matthias Bussonnier wrote:
As far as I can tell not with the default spawner, but as the spawner
are plugins, you can write your own, or just extend the one you like
to have `cpu_limit` be a per-user value.

If you use a spawner like SlurmSpawner, then it might be easier to
configure this in Slurm itself that have such mechanism and do have
user<-> resources association. I'm guessing other Spawner might have
that as well.
--
Matthias

On Fri, 20 Mar 2020 at 11:41, David Greene <djgre...@gmail.com> wrote:
>
> Hey folks,
>
> I've been using the following in my jupyterhub_config.py to set the spawner limits.
>
> ## Maximum number of cpu-cores a single-user notebook server is allowed to use.
> c.Spawner.cpu_limit = 20
>
> ## Maximum number of bytes a single-user notebook server is allowed to use.
> c.Spawner.mem_limit = '16G'
>
> Is there a way to set this on a per-user basis? For example, if I want to set user jack's CPU limit to 0.5 and user jill's CPU limit to 10?
>
> Can this be done online (without restarting the whole JupyterHub service in systemd)?
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to jup...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages