2

I'm currently running my development on a Windows 10 machine with Laragon.

Php memory limit is set to -1. 8 Core(s), 16 Logical Processor(s). Installed Physical Memory (RAM) 16,0 GB.

Still when i run composer or magento upgrade, deploy and compile commands it is really slow. Really irritating.

The question is: How can i make Magento and Composer use more resources and perform faster? I use so much of my time waiting for these processes and it makes me very sad atm.

7
  • 1
    Deployment script uses system disk read/write. So your hard disk speed matters when you apply deployment script Commented Feb 6, 2019 at 8:03
  • Are you using any kind of editor like php storm or anything else that run indexing while updating code? Commented Feb 6, 2019 at 8:03
  • No php storm and resource monitor shows no peaks in any of the fields. Running setup:mode:set developer and back to production uses resources: CPU max 8%, Memory ~300mb and Disk Write Speed: 0-1% Commented Feb 6, 2019 at 8:24
  • let's start a step further: when are you calling setup:static-content:deploy? you will never need this when developing. you only need this when deploying. Commented Feb 6, 2019 at 8:35
  • 1) Because developer mode is so slow. 2) I'm not a professional 3) I make a lot of mistakes 4) I like to test things Commented Feb 6, 2019 at 8:38

1 Answer 1

2

Develop in development mode like suggested in comments:

bin/magento deploy:mode:set developer

This will greatly reduce the amount you need to run setup upgrade and deploy static content. New modules for example will need a setup upgrade run. Development mode for me is not actually much slower than production when you have atleast some caches running and just turn off what is not needed at the time. For example make sure configs are enabled turn off FPC, static blocks, and layouts and then just do occasional cache flushes if configs change. With that I get relatively decent performance of 2-4 seconds page loads, this is on a Ubuntu Virtual Machine.

The "Jobs parameter" can greatly increase atleast the deploying of static content however this does not seem to be available for other Magento CLI tasks.

bin/magento setup:static-content:deploy -j16
2
  • Thanks. I actually noticed that developer mode is a bit faster on my local env than before. But this does not answer the original question. Why php does not utilize resources like it should? Maybe it's related to windows? Commented Feb 7, 2019 at 6:10
  • I was just showing how to use more threads on the setup:static-content:deploy as was the main things that you said took a while. Working around having to use those commands I though would help as was making you sad. My ubuntu server is only really using 10-30%. apache will use a thread for each task so 6.25% 16 users simultaneously would knock it up to 100%. Running that command above with all 16 threads should see 100% utilisation if you try it (does for me). It's not designed for each user to throttle your computer a site would just die i guess when more than one user browses a site.
    – harri
    Commented Feb 7, 2019 at 12:04

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.