Speeding up WSL I/O up than 5x fast + saving a lot of battery life & CPU usage
Tags: performance, webdev, wsl, windows10
Published: 2019-03-06 23:01:26

---
title: "Speeding up WSL I/O up than 5x fast + saving a lot of battery life & CPU usage"
published: true
tags: performance,web-development,wsl,windows-10
canonical_url: 
---

![](https://cdn-images-1.medium.com/max/960/1*6FyyUhdUkfW77MDfC1BgUA.png)<figcaption>Ubuntu running inside WSL trying to update some packages behind Windows Real-time protection bad guy</figcaption>

While being helpful detecting some common Windows malwares, in GNU/Linux side it’s so inefficient and actually unhelpful.

Every time you try to access/read/write some file/folder, Windows Defender intercept WSL requisition for antivirus scanning, slowing down things until you hate everything in&nbsp;WSL!

So, to do so, first get the UbuntuOnLinux (or your distro of choice) installation path going to _%USERPROFILE%\AppData\Local\Packages_ and lookup for something like **CanonicalGroupLimited.UbuntuonWindows\_79rhkp1fndgsc** _._

_Copy the entire path from Explorer.exe address bar, then go to_ Settings \> Update & Security \> Windows Defender \> Open Windows Defender Secutiry Central \> Protection Against Viruses & Threats \> Advanced Config… \> Exclusions \> Add or Remove \> Add \> Folder and finally: paste the previous copied&nbsp;path.

### Warning: High security sometimes means Low performance

![](https://cdn-images-1.medium.com/max/618/1*Cb8wWHPg6h_bgN8P7cnULg.jpeg)<figcaption>Windows Defender Real-time slow down… protection</figcaption>

The tip above may speedup things a little bit, but not so. There is one more thing bringing your performance down: **Window Defender real-time protection**.

As noticed by [David Tansey](https://github.com/tanseydavid) in this [WSL issue](https://github.com/Microsoft/WSL/issues/1932), real-time protection have a HUGE impact in developer tools like Visual Studio build tool and tools like Kubernetes and etc., including WSL.

We will disable it, but be aware: you will may be more vulnerable for some common attacks through malicious script execution.

So, let’s&nbsp;disable:

![](https://cdn-images-1.medium.com/max/1024/1*a-U4iD2KwHC3VXFuNDhTxg.png)<figcaption>Use Group Policy (gpedit.msc) to disable real-time protection</figcaption>

**Use Group Policy to disable real-time protection:**

1. On your Group Policy management machine, open the [Group Policy Management Console](https://technet.microsoft.com/library/cc731212.aspx), right-click the Group Policy Object you want to configure and click&nbsp; **Edit**.
2. In the **Group Policy Management Editor** go to **Computer configuration**.
3. Click **Policies** then **Administrative templates**.
4. Expand the tree to **Windows components \> Windows Defender Antivirus \> Real-time protection**.
5. Double-click the **Turn off real-time protection** setting and set the option to **Enabled**. Click&nbsp; **OK**.

I’ve only tested superficially, but I can ensure a great performance speed&nbsp;up.

_Disclaimer: I have plans to improve my English skill, but my willing to help is bigger than&nbsp;that._

### References:

Configure always-on real-time protection in Windows Defender AV | Microsoft Docs — [https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-antivirus/configure-real-time-protection-windows-defender-antivirus](https://docs.microsoft.com/en-us/windows/threat-protection/windows-defender-antivirus/configure-real-time-protection-windows-defender-antivirus)