Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Sudospawner support Spawner.mem_limit? #55

Open
radumas opened this issue Apr 5, 2019 · 3 comments
Open

Does Sudospawner support Spawner.mem_limit? #55

radumas opened this issue Apr 5, 2019 · 3 comments

Comments

@radumas
Copy link

radumas commented Apr 5, 2019

Per the JupyterHub documentation

c.Spawner.mem_limit: A limit specifies the maximum amount of memory that may be allocated, though there is no promise that the maximum amount will be available. In supported spawners, you can set c.Spawner.mem_limit to limit the total amount of memory that a single-user notebook server can allocate. Attempting to use more memory than this limit will cause errors. The single-user notebook server can discover its own memory limit by looking at the environment variable MEM_LIMIT, which is specified in absolute bytes.

In the configuration file, there is a caveat though:

This is a configuration setting. Your spawner must implement support for the limit to work. The default spawner, LocalProcessSpawner, does not implement this support.

So does SudoSpawner implement this? Can it?

@yuvipanda
Copy link

AFAICT, it does not.

Implementing it would require wrapping the spawned processes in something that does cgroups (like systemd or firejail), or using ulimits.

@yuvipanda
Copy link

There's already a systemd spawner, but it'll be great to have ulimit support built somewhere.

@radumas
Copy link
Author

radumas commented Apr 10, 2019

Thanks for the answer @yuvipanda, this is not my area of expertise, but would be willing to help contribute if pointed in the right direction.

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

No branches or pull requests

2 participants