Nodejs/Gcloud/kubectl any command we run from WSL2 is deadly slow

Viewed 24

I referred many solutions yet no luck. I have a linux automation which runs few gcloud commands with some conditions. I made this script with node js, but it is incredibly slow that I even finish it manually before the scrips completes the run.

Same with the gcloud commands when I connect to a cluster and kubectl commands when i query something.

Please help!!

1 Answers

Right now access to /mnt folders in WSL2 is too slow and by default at launch the entire Windows PATH is added to the Linux $PATH so any Linux binary that scans $PATH will make things unbearably slow.

To disable this feature, edit the /etc/wsl.conf to add the following section:

[interop]

appendWindowsPath = false

Avoid adding Windows Path to Linux $PATH and best for now is adding folders to the $PATH manually. Terminate the WSL distro (wsl.exe --terminate <distro_name>) to make it immediately effective or wsl.exe --shutdown and start the terminal again.

Refer to the stack link for more information.

Related