3

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.

Pablo Fernandez
  • 279,434
  • 135
  • 377
  • 622

2 Answers2

2

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

Hai Hoang
  • 1,207
  • 2
  • 18
  • 35
  • Wow. That is a lot faster with Webrick. Thanks! Was feeling like I'd have to dust out the ole ubuntu laptop for dev work again. – Jay Killeen Dec 07 '18 at 02:35
2

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.

Will
  • 21
  • 1
  • 1
    the problem is about serving files.. not a boot. – ZF007 Dec 21 '19 at 11:56
  • I ran into this exact issue with serving static files. I cloned my repository to the home directory (~) and it's acceptable (full refresh in about 15 seconds compared to timing out after 2 minutes under /mnt/c/). Also, it's worth noting that doing this, you can access the files in windows using //wsl$/ "network" location. – Richard Jan 25 '21 at 17:40