-
WSL2 vs WSL3 Benchmarks: Performance, Memory, and Syscall Scaling
With the release of the WSL 3.x stack, Microsoft bumped the default virtualization runtime and advanced the shipped guest kernel from the 6.6 LTS branch up to 6.18.
WSL upgrades often claim generalized performance gains, but marketing bullet points rarely translate directly to developer workloads. To see what actually changed under the hood, I ran side-by-side benchmark suites comparing WSL 2.6.3.0 (Linux kernel
6.6.87.2) against WSL 3.0.2.0 (Linux kernel6.18.40.1). -
The Security Tax in WSL3: Benchmarking Kernel Mitigations Against WSL 2.x
In our earlier look at The Security Tax in WSL 2, we showed how kernel-level mitigations for CPU speculative execution vulnerabilities (Spectre, Meltdown, Retbleed) imposed a steep penalty on developer tasks. On a real-world Go backend compilation workload, turning off mitigations slashed kernel system time by 45.7% and delivered a 31.7% drop in wall-clock compile time.
With the rollout of WSL v3.0.2 (running Linux kernel
6.18.40.1-microsoft-standard-WSL2), how does the security tax hold up today? Does modern hypervisor paravirtualization eliminate the overhead, or are developers still paying an invisible performance toll on syscall-heavy workloads? -
Surviving the 1 GB Squeeze: Engineering an Unstoppable Alpine GCE Image
In my previous post, we looked at how default Google guest daemons consume over 15% of available memory on a 1 GB Google Compute Engine (
e2-micro) instance, pushing standard Debian images into SSH lockout during moderate memory pressure.To see how far we could push the lower boundary of GCE instances without sacrificing reliability, I built a custom minimal Alpine Linux image (
alpine-3-24-1-uefi-lite-v5).We subjected this image to a punishing synthetic stress harness: pinning 900 MB to 1,250 MB of memory, driving 16 concurrent worker threads, and executing over 167,000 sub-processes in five minutes. While standard Debian froze solid, the Alpine instance maintained sub-second SSH logins and responsive interactive keystrokes.
-
Taming GCE Memory Tax: Disabling OS Login and OS Config on Small Instances
Google Compute Engine’s
e2-microinstances are a staple of the GCP Free Tier, offering 2 vCPUs and roughly 1 GB of RAM (969 MiB usable). They are ideal for lightweight bastions, cron runners, and small test beds. However, if you run memory-sensitive workloads—such as Go builds, package extractions, or continuous process forks—you may have experienced intermittent, baffling SSH connection timeouts and unresponsive terminals.The root cause is rarely your application alone. By default, GCE provisions a suite of Google guest daemons that consume a disproportionate share of resident memory on small VMs, creating an environment primed for SSH exhaustion.
-
Isolated & Sandboxed WSL Environments with Debian Slim
This approach moves away from the “one big distro” model, which often leads to 100GB+ VHDX files and dependency hell. Instead, we use a modular, immutable-ish workflow by utilizing the
debian:stable-slimDocker image as our “Gold Master.” It makes recovery loads easier, and isolates each project, which is expecially important with so many supply chain attacks today.
The Architecture of a Sandboxed WSL Environment
The goal is to create a clean Base Image, snapshot it, and then spin up lightweight, project-specific Instances. This ensures that an experimental library or a legacy Node.js version in one project never touches your primary development environment.
-
Lightweight Efficiency: Porting Alpine Linux RootFS to WSL2
In our pursuit of a minimalist, high-performance development environment, we recently moved our primary local operations to a custom Alpine Linux footprint. By importing a minimal Alpine RootFS into WSL2, we’ve achieved a sub-60MB idle memory footprint and near-instantaneous shell readiness.
This post outlines the technical workflow to import the image and the specific configurations required to harden the environment for security and performance.
Although there is an Alpine Linux distro in the Microsoft Store, it is out of date. Using this method ensures you always have the latest version.
-
The "Security Tax": Reclaiming 30% Performance in WSL 2
For engineers running lean environments on WSL 2, every megabyte of RAM and every CPU cycle counts. Many developers are unaware of the significant “performance tax” imposed by kernel-level mitigations for vulnerabilities like Spectre and Meltdown.
In a recent set of benchmarks on a Go-based backend project, disabling these mitigations resulted in a 31.7% reduction in wall-clock compilation time. Here is how you can audit your system and decide if the trade-off is right for your workflow.
-
Improve WSL Security with Read-Only Filesystem
By default, all Windows drives are mounted with read & write access (rw) within WSL . Though this is convenient for beginners, it opens up VM shell attacks on your Windows host files.
Instead, we can disable the auto mount feature using
wsl.confand selectively add read-only drives inside the WSL VM using/etc/fstabOverview
- Deactivate “auto mount” in
/etc/wsl.conf - Enable fstab using
MOUNTfStAB = trueinwsl.conf - test config files and mounting work well
- reboot the wsl VM to complete the setup
Example WSL Config
wsl.confPlace this inside the /etc/ directory on the WSL VM
- Deactivate “auto mount” in
-
A Timeless Directory Layout for All of your Projects
Directory layouts are like log cabins that start from a basic shed, gradually adding a room at a time. When you start out on UNIX, everything gets thrown in your home directory. Over time you start to develop a structure for your sources, binaries, projects, data files (like CSV, images, tar files), config, etc
My layout is called TDL – because it allows me to juggle open source projects, partnerships and jobs in a consistent structure across machines and time.