Skip to content

Ruby on Rails app significantly slower on WSL compared to Windows #893

Closed

Description

I have a Rails app which I run on Ubuntu Linux and Windows. Just tried it on WSL and page loads are taking about 10x what I see on Windows or Ubuntu Linux.

I've tried 3 different webservers (Puma, Unicorn, and WEBrick) and all are slow.

I'd like to provide more detail about the issue, is there any diagnostic tool I can run to report metrics?

Activity

  1. marcogroppo commented on Aug 14, 2016

    @marcogroppo

    Just an idea. Where are the application and content files stored? DrvFS (/mnt/*) is known to be slow (there's no dentry cache). See #873

  2. johnnyshields commented on Aug 14, 2016

    @johnnyshields
    Author

    Marco Groppo (@marcogroppo) yep that's probably the issue. I'll experiment with moving tmp to somewhere other than /mnt/*. Closing this issue for now.

  3. aurimus commented on Apr 3, 2017

    @aurimus

    Johnny Shields (@johnnyshields) did it work? I'm having same issue

  4. aurimus commented on Apr 3, 2017

    @aurimus

    Can we reopen this? This is a major drawback

  5. aseering commented on Apr 3, 2017

    @aseering
    Contributor

    I agree that this general issue is a major drawback, but this specific ticket is closed because it's believed to be a duplicate of #873 , which is still open.

    If you have evidence that fixing that issue would not also fix this issue, please post it.

  6. johnnyshields commented on Apr 4, 2017

    @johnnyshields
    Author

    Aurimas (@aurimus) yes using a linux dir (not /mnt/c/) lead to some improvement. agreed this is a dupe of #873.

  7. aurimus commented on Apr 4, 2017

    @aurimus

    Johnny Shields (@johnnyshields) is using a mounted ext4 dir makes for an improvement also? Because with using a lxss dir has other problems, because it becomes impossible to use Sublime Text or similar (files disappearing)

  8. gnodiah commented on Jun 17, 2017

    @gnodiah

    yeah, it's really really slow, how could it be solved?

  9. aurimus commented on Jun 17, 2017

    @aurimus

    Hayden (@gnodiah) move to Ubuntu. Tested, works:)

  10. ztolley commented on Jul 27, 2017

    @ztolley

    Should re-open. Tested WSL /mnt/c vs WSL ~/ vs Docker for windows mounted to C... Docker was so much faster.

    Running a suite of rspec tests in WSL takes 14-16 seconds to load the files vs docker 1.5

    Similar tests using Node js on same machine showed a tiny difference

  11. benhillis commented on Jul 27, 2017

    @benhillis
    Member

    No need to reopen, this is a duplicate of #873.

  12. ztolley commented on Jul 27, 2017

    @ztolley

    I don't think this is a duplicate of #873 talks about a problem with performance when dealing with files under /mnt/* but I have seen performance issues just with Ruby under ~/

    I ran a suite of simple rspec tests in Ruby using the following configurations:

    • WSL /mnt/c
    • WSL ~/
    • Docker mounting a folder from c:

    In my tests WSL was slow irrespective of the location of the ruby files (unless Ruby is pulling something else from /mnt/c but I can't think what). Docker loaded the files for the test in a tenth of the time.

      First Run   Follow up runs  
      Test time file load time Test time file load time
    WSL Local 0.62 15.77 0.62 15.86
    WSL /mnt/c 0.81 34.6 0.61 14.11
    Docker 0.35 1.5 0.35 1.5

    ruby-times

    I also ran tests using Node JS. The node js tests ran only a little slower on WSL compared to docker, even when the test files are on /mnt/c. The first run is slow, though I'm putting that down to cache.

      First Run Follow up runs
      Test time Test time
    WSL /mnt/c 11.28 4.18
    Docker 3.17 3.17

    node times

  13. sunilmut commented on Aug 1, 2017

    @sunilmut
    Member

    Zac Tolley (@ztolley) - Thanks for the experiments and sharing the results. Yes, the title of #873 only seems to refer to perf issues in /mnt/, but it has become a catch all issue for file system perf with WSL. I have updated the title of #873 to reflect the same now. We are aware of these limitations and currently working to improve them. If you haven't already voiced your opinion and vote in the related user voice ticket, please do so.

  14. PhilT commented on Aug 1, 2017

    @PhilT

    Out of interest Zac Tolley (@ztolley) is that Docker for Windows or Docker toolbox (in other words VirtualBox or HyperV)?

  15. ztolley commented on Aug 2, 2017

    @ztolley

    Docker for windows, so it uses Hyper V

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions