-
Notifications
You must be signed in to change notification settings - Fork 854
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
Set process priority #894
Comments
Did you try |
I did just now, I think it only lowers the priority in bash environment, in relation to other bash processes. My measure criteria is a small Rainmeter clock/cpu meter skin which slows down considerably when any other window process with same default priority takes up too much cpu, so it's really noticable. Compared to when I lower the priority of |
@laggingreflex if MS implements something maybe like dummy read-only windows processes in /proc, that could make it work, right? That way you can set your process priority for windows stuff in windows and for linux in WSL |
Great idea. This is one of those features which we know about but is pretty low on our backlog. Best way to communicate the desire here would be to go vote on the User Voice page. |
Nice values are weird. I tried setting process priority from process hacker, and the nice value shot up to 4294967295 as seen in htop. Then I tried each setting (Realtime, High, Above Normal, Normal, Below Normal, Idle) and all of them do the same thing. |
+1 Tried both |
@yuriiz That's because the priority isn't being set like that. When you
( Well, at least that's all that bash.exe used to do. Since the big interop upgrade a month or two ago, it's hooked up in a much more sophisticated way to allow passing window control back and forth between windows and linux console programs. ) |
How might a person go about doing this? I don't think there's an option for that in services.msc. |
wish I didn't need "sudo" for the nice command tho... |
That's why they invented sudoers |
So, is there a way to set a wsl process to lower priority? |
You can use sudo to start a shell ... (e.g. You can also edit Just add the following below the
That said, as of 1909/18363.535 I don't even see a process called I'm not sure if there were some changes made, but WSL processes do show up in task manager and when using It would appear that there is some Windows Kernel stuff going on here that's not implemented? Is it possible to set the priority of all WSL processes? (I mean, in some cases, that'd be better than nothing at all.) Or is the priority as far as the Windows Kernel is concerned locked on "Normal"? |
@therealkenc Why is this closed? I still get an error when trying to change process priority in WSL2. |
@IanPNewson you might want to check and make sure you're actually using WSL2 and not WSL1. WSL2 is supposed to be using hyper-v virtualization to run a full Linux kernel, not just implementing a subset of the Linux kernel like WSL1. I'm still on WSL1 (all I want is nginx and SFTP) so I'm not 100% sure, but I wouldn't expect WSL2 Linux processes to show up at all in windows task manager; if you're inside Linux and having issues, make sure that you're actually running WSL2 and that you're not running into permission issues (trying to modify something running under another user). |
@Efreak ah you were right, I had upgraded to WSL2 but that particular distribution was still on WSL1. Thanks! |
It seems it's currently impossible to set CPU priority for bash or any of its sub processes. I know the use case probably is very slim, mine is to only set an especially CPU hogging
ffmpeg
process right now. But could it be made possible in future? Or is there any other underlying issue/feature which if solved would make this possible as well?The text was updated successfully, but these errors were encountered: