Boost Performance: Allocate More CPU to a Process in Windows 11

Boost Performance: Allocate More CPU to a Process in Windows 11

Struggling to get the best performance out of your applications on Windows 11? Allocating more CPU resources can help. Here’s how you can do it.

How can I allocate more CPU to a process?​

1. Configure .wslconfig File​

  • Open Notepad as Administrator:
    • Press Start, type Notepad, right-click on Notepad, and select Run as administrator.
  • Open .wslconfig:
    • In Notepad, go to File > Open and paste %UserProfile%/.wslconfig in the file path field, then click Open. If the file doesn't exist, create a new file named .wslconfig in your user profile directory.
  • Edit the Configuration:
    • Copy and paste the following configuration into the .wslconfig file:[wsl2]
      memory=10GB
      processors=6

    • Adjust the values of memory and processors as needed.
  • Save the File:
    • Click File > Save to save the changes.
  • Restart WSL:
    • Open Command Prompt or PowerShell as Administrator and run:wsl --shutdown

    • Next, restart the WSL service by running:restart-service LxssManager
This configuration will allocate the specified memory and number of processors to WSL2, ensuring that your Linux environment within Windows has the resources you need. Ensure WSL is restarted for changes to take effect.

2. Allocate More CPU to a Process Using Task Manager​

  • Right-click on the Start button and select Task Manager.
  • Navigate to the Details Tab.
  • Right-click on the program you wish to allocate more CPU. Next, click on the Set Affinity option from the pop-up menu.
  • Then, select the cores you want to assign to this particular process from the options listed as CPU0, CPU1, CPU2, and CPU3 (for quad-core chipsets).
  • Lastly, click on OK to apply the changes.
This method will ensure that the selected application gets more CPU resources, enhancing its performance.

3. Optimize CPU for Best Performance​

  • Open System Properties:
    • Right-click the This PC icon on the desktop or file explorer, and select Properties.
  • Advanced System Settings:
    • Click on Advanced system settings on the left pane.
  • Performance Settings:
    • Under the Advanced tab, click Settings in the Performance section.
  • Adjust for Best Performance:
    • Select Adjust for best performance, then click Apply and OK.
  • Restart Your PC:
    • Restart your PC to apply the changes.
This optimization will reduce the load on your CPU by disabling unnecessary visual effects, making more resources available for your tasks.

4. Use Windows 11 Graphics Settings​

  • Open Settings:
    • Press Windows key + I to open the Settings app.
  • Navigate to Display:
    • Go to System > Display.
  • Access Graphics Settings:
    • Scroll down and click on Graphics.
  • Add Application:
    • Select Desktop app from the drop-down menu, then click Browse to find and select the application's .exe file.
  • Set High Performance:
    • Click on the added application, select Options, choose High performance, and click Save.
This setting ensures that the application utilizes the maximum graphical resources, which can indirectly enhance CPU performance for graphic-intensive tasks.

By following these steps, you will ensure that your applications and WSL2 in Windows 11 have the necessary CPU and memory resources to run efficiently.
Author
Windows Daily
First release
Last update

More resources from Windows Daily

Top