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

WSL cannot be nice #10766

Closed
1 of 2 tasks
Jefferson111 opened this issue Nov 16, 2023 · 2 comments
Closed
1 of 2 tasks

WSL cannot be nice #10766

Jefferson111 opened this issue Nov 16, 2023 · 2 comments

Comments

@Jefferson111
Copy link

Windows Version

Microsoft Windows [Version 10.0.22621.2428]

WSL Version

WSL version: 1.2.5.0

Are you using WSL 1 or WSL 2?

  • WSL 2
  • WSL 1

Kernel Version

Linux version 5.15.90.1-microsoft-standard-WSL2 (oe-user@oe-host) (x86_64-msft-linux-gcc (GCC) 9.3.0, GNU ld (GNU Binutils) 2.34.0.20200220) #1 SMP Fri Jan 27 02:56:13 UTC 2023

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

Unable to be nice on WSL.

  1. Adding user - nice -19 to /etc/security/limits.conf doesn't take effect. Rebooting or rerunning the shell and also adding pam_limits.so module into /etc/pam.d/common-session doesn't work either.

  2. One can run nice --1 ls for a quick sanity check and see if the permission denied message pops up.

One can be nice on normal Ubuntu servers, be it hypervisors or baremetal, just not WSL2 and probably WSL too.

Expected Behavior

Able to be nice and run processes at higher priority (or lower).

A temporary fix for anyone encountering the issue:

su $USER
ulimit -e 39

This indirectly address the problem by allowing the user to change their thread max priority to 39, hence allowing nice level to go to -19.

Actual Behavior

WSL is unable to be nice and processes can only work at the priority dictated by the default configuration (unless you run your process in root, which is a bad idea).

Diagnostic Logs

No response

Copy link

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

You can give me feedback by thumbs upping or thumbs downing this comment.

Copy link
Contributor

This issue has been automatically closed since it has not had any activity for the past year. If you're still experiencing this issue please re-file this as a new issue or feature request.

Thank you!

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

1 participant