2

I am running CraftCMS locally but it's extremely slow.

What does extremely slow mean:

  • login takes 10-15 seconds
  • clicking any admin screen takes 10-15 seconds
  • viewing an entry takes 10-15 seconds ...

Specifications:

  • CPU: Intel Core i7 11th gen
  • RAM: 12 GB
  • OS: Windows 11 with WSL2
  • Using nitro
  • Using docker

Debug Bar screenshot:

enter image description here

Note that everything else runs just perfect. So it's not a hardware issue.

Also, this is a screenshot of the Task manager while a page is being loaded:

enter image description here

CPU and RAM are okay.

I created a .wslconfig file with:

[wsl2]
memory=10GB
processors=4

So that Docker has enough power.

10
  • Could you share some more information about your development environment? What OS are you using? Do you use MAMP? Docker? Nitro? etc..
    – mike
    Commented Feb 15, 2022 at 11:48
  • Go to your user account preferences and tick the box to show the debug toolbar in the control panel. Then you can drill down the response timeline to find the bottleneck. Do you have any plugins installed? Commented Feb 15, 2022 at 11:48
  • 1
    I have always found Nitro too slow, so I switched to Lando which is fairly straight forward, easy to setup and a lot quicker then Nitro is. Now, 10-15 seconds per pageload is slow: even for Nitro. So I suspect it is something with Docker. Can you confirm this by running any other docker application? Have you given Dockere enough resources? Is WSL2 installed correctly? Something else I noticed with WSL2 when I still used to develop on Windows was that it gets slowed down A LOT by all virus scanners (also windows defender) Maybe try playing with that?
    – mike
    Commented Feb 15, 2022 at 13:57
  • 1
    You may also need to do some Docker tuning if you haven’t already.
    – Matt Stein
    Commented Feb 15, 2022 at 17:33
  • 1
    Nobody has ever accused me of that @ÁlvaroFranz, but thank you and I’m glad that solved it for you!
    – Matt Stein
    Commented Feb 16, 2022 at 22:42

1 Answer 1

2

So, in this case the performance issue was caused by the fact that I had my Craft installation inside the Windows filesystem, while running Nitro in the WLS filesystem.

The communication between Windows and WSL is not optimal, so it gets solved by moving your Craft installation into the WSL filesystem.

enter image description here

You can access your WSL with \\wsl$ in the address bar in the Windows filebrowser.

With that change my page load went from 15s+ to 600ms.

More information: https://craftcms.com/docs/nitro/2.x/windows.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.