2

I install Magento 2 on MAMP Localhost on Mac but I don't know why It runs really slow on frontend and backend even I did turn on Varnish cache, minify CSS and JS, turn magento to developing mode and change php memory_limit to 1G. Can you guys please help? Here is my configuration:

Macbook Air 2015: - CPU: i5 1.6GHz - Memory: 8GB - SSD: 128GB

MAMP: - php: 7.0.22 - MySQL: 5.6.35

3 Answers 3

1

The following steps should help your speed up your dev box:

Disable CSS / JS minification or enable production mode

When developer mode is enabled, CSS and JS minifying / combining is processed on the fly. This process uses a lot of CPU usage and makes Magento very slow.

I'd recommend to either enable production mode or disable all CSS and JS related optimizations when using developer mode.

Close Chrome dev tools or enable browser cache

Besides the above, the front-end can take a very long time to load when chrome dev tools is open with cache disabled in the network tab. Closing dev tools or enabling the cache in dev tools will solve that issue.

Enable Magento cache except FPC

Enabling all caches except the FPC generally speeds up Magento 2 a lot, while allowing you to still work with it reasonably well.

Disable xDebug

If PHP xDebug is enabled, you should disable it and only enable it when debugging.

0

Due to many abstraction layers and software architectures, Magento 2 is famous for being resource hungry.

You can try installing Cache server such as Redis / Memcache and configure Magento to use them instead of file system.

Also try running php bin/magento setup:di:compile to reduce load time from the browser.

Giving php too much memory is probably not a good idea. You can try using https://github.com/meanbee/docker-magento2 to save time getting the right server configuration.

0

On top what @lemongrass suggested, upgrade your Apache to support http/2 protocol, it will efficiently reduce the number of requests using server push and you will find a difference.

Follow this for upgrading to http/2. I am not sure about how to in Mac. This guide may help you as reference. https://www.techrepublic.com/article/how-to-enable-http2-protocol-on-ubuntu-16-04/

For server push there is a Magento 2 module. Try installing it. No need to do any configuration.

https://github.com/yireo/Yireo_ServerPush

Note: make sure you have https enabled

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.