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.

pupeno
  • 267,428
  • 120
  • 345
  • 578
  • This is hard to tell from just a screenshot. You might want to share the configuration file and how you invoke Puma so that others might have a chance to find what is happening. – Holger Just Jan 06 '17 at 19:53
  • @HolgerJust I updated the question. What configuration would you like me to share with you? – pupeno Jan 06 '17 at 20:03
  • @Pablo did you ever resolve this? – Jackson Miller Mar 30 '17 at 23:49
  • Note: starting June 2019, [WSL 2 is coming](https://stackoverflow.com/a/56012225/6309), and brings considerable performance improvements. – VonC May 06 '19 at 20:50

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,165
  • 2
  • 15
  • 33
  • 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