0

Is there a way to set WSL2 Ubuntu 22 to performance mode? I know the original version of the OS you can just set it to performance mode but I'm not sure how to do it through WSL2.

When I run

grep "cpu MHz" /proc/cpuinfo

It shows

cpu MHz         : 3192.001

cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001 cpu MHz : 3192.001

But task manager on Windows shows about 4.2 GHz.

I'm wondering if WSL2 is able to take advantage of Intel turbo.

1
  • Looks like it always just reports the base cpu speed, no matter what speed the cores are actually running.
    – popey
    Mar 9, 2023 at 20:42

1 Answer 1

0

Probably not. A.k.a. "No, but I could always be wrong."

Under WSL2, Ubuntu is running as a container/namespace inside a managed virtual machine. That "managed" part means that we, as end-users, don't have much control over it directly. Even if it was running in a virtual machine, I'm not sure there's any hypervisor that would allow you to control the CPU at that level. It's the host operating system that has to handle that.

While I haven't tried this, it might be possible to change the Windows process priority for WSL/Ubuntu. In Windows 11 22H2, in the Task Manager, you can choose the Details tab, right-click on wsl.exe, and use Set priority to select from:

  • Realtime
  • High
  • Above Normal
  • Normal (default)
  • Below Normal
  • Low

It would be interesting to hear what direct results you might see (or not) in Ubuntu performance after changing this.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .