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

Allow setting nice (process scheduling priority) #85

Open
mathause opened this issue Oct 19, 2021 · 1 comment
Open

Allow setting nice (process scheduling priority) #85

mathause opened this issue Oct 19, 2021 · 1 comment
Labels

Comments

@mathause
Copy link

Proposed change

systemd-run allows to set the niceness level with systemd-run --nice=19 .... Would be nice if we could spawn kernels with reduced niceness to reduce their priority.

Alternative options

  • it might be possible to start a slice with a given niceness and start the kernels in this slice
  • or jupyterhub itself could be run with reduced niceness and the kernels would inherit this (although this is not desirable)
  • I think it's not possible to set the niceness via --property=Nice=19 - Let me know if I am wrong.

Who would use this feature?

Sysadmins who'd like to reduce the priority of the kernels run on the system.

(Optional): Suggest a solution

  • add a Nice traitlet to SystemdSpawner, defaulting to None
  • expand the systemd-run command in start_transient_service
    if nice is not None:
        run_cmd += ['--nice={}'.format(nice)]

I am happy to open a PR if there's a chance to get this in.

@mathause
Copy link
Author

mathause commented Oct 20, 2021

It might actually work via property. However, I could not really test it as the systemd version of my servers is still too old (currently: systemd 234; required systemd 244 (or 246) and higher). For a quick test:

systemd-run --user --pty --quiet --nice=19 nice
systemd-run --user --pty --quiet --property=Nice=19 nice

both lines should return 19. Neither version works in systemd 234 but work on systemd 246. Thus the issue can be closed.

@consideRatio consideRatio changed the title allow setting nice Allow setting nice (process scheduling priority) May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants