Networking improvements are a consistent top ask for WSL, and this feature aims to improve the networking experience in WSL! This is a complete overhaul on the traditional NAT networking architecture of WSL, to an entirely new networking mode called “Mirrored”. Default or unrecognized strings result in NAT networking. If the value is mirrored then this turns on mirrored networking mode. New Networking Mode – Mirrored Setting name Additionally, we’ve added the wsl -manage -set-sparse command to allow you to set your existing distros to be sparse or not if you’d like. WSL virtual hard disks (VHDs) grow in size as you use them, and now with this feature enabled they will automatically shrink in size too! This new setting automatically sets any new VHD to be a sparse VHD, which can automatically reduce their size. When set to true, any newly created VHD will be set to sparse automatically. Automatic disk space clean up (Set sparse VHD) Setting name You can also set this to dropcache which will instead drop caches entirely after detecting idle, and will not require any cgroup changes. If you’d like to customize your idle detection thresholds and more, we’d recommend doing so by not enabling this feature and creating a bash script, see this GitHub gist for instructions. We are working with the Docker team to address this in the future. In early testing we noticed that this will break the docker daemon when running it as a service in WSL, and so if you’re using this feature we recommend you use Docker Desktop for your docker needs. However, this feature does require disabling cgroups v1 in WSL, which can cause some issues. The memory.reclaim cgroup feature allows us to intelligently reclaim a portion of memory over time, striking a balance between performance and memory usage. We reclaim a fixed portion of your VM’s memory size, which is calculated so that if your VM was full of cached memory it would go to zero cached memory after 30 minutes (e.g: If you have 3000MB of memory, we reclaim 100MB every minute). This works by WSL detecting that you’re idle by seeing if CPU usage is continuously low for 5 minutes, and then we start reclaiming cached memory by using the cgroup memory.reclaim feature. This means that your WSL VM will automatically shrink in memory size when you’re not using it! When this is set to gradual, after being idle for 5 minutes, WSL will slowly start to release cached memory in Linux and make it available as free memory back to the Windows host. Set to gradual for slow release, and dropcache for instant release of cached memory. Automatic memory reclaim Setting nameĪutomatically releases cached memory after detecting idle CPU usage. The new feature settings are explained below, please see this docs page to learn more about advanced configurations for WSL. wslconfig file in your Windows home directory (e.g: C:\Users\\.wslconfig) and ensure it has an section with each setting below it, such as this:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |