Why is Puma so slow in WSL?

2.1k Views Asked by At

I'm running Puma in Windows Subsystem for Linux, installing it was a breeze and it worked right away but serving static files is horribly slow. It takes more than 8 seconds to serve them:

enter image description here

Any ideas what's going on or how to fix it? The app itself is running at a good speed.

I run puma by executing:

rails s Puma

Other than adding the gem to my Gemfile, I haven't made any particular configuration for Puma.

2

There are 2 best solutions below

2
On

I found that rails was slow startup because i was running it on ntfs drive /mnt/c etc.

When running rails in WSL which you can get to with cd ~ in wsl. My speed problems were resolved.

1
On

According to WSL I/O performance issue , it seem to be the root cause is WSL itself at the moment. Hope Microsoft will improve WSL asap.

Webrick work fine in WSL, when in develop environment, you can run rails s webrick to start quick webrick server