Loading..
Processing... Please wait...

Product was successfully added to your shopping cart.



Magento 2 slow in developer mode - 3 simple fixes

Magento version 2 might be slow while in developer mode. 60s page load time makes it almost impossible to debug your extension or new theme.

I myself struggled with that problem for some time. I will present to you 3 simple fixes that helped me speed up Magento 2.

 

1. Disable CSS & JS merge / bundle / minify

That trick alone helped me reduce TTFB from 50s down to 2s.

Go to Stores > Configuration > Advanced > Developer > Javascript Settings and CSS Settings and make it look like this:

Disable CSS/JS merge | Magento 2 slow in developer mode Disable CSS/JS merge | Magento 2 slow in developer mode

What happens here: in developer mode Magento 2 will have to locate and merge CSS/JS files on every page request! Turning this behavior off we greatly reduce page load time.

Here is a my stackexchange answer that proofs this tip works - Why is Magento 2 local developer mode site with nginx and xdebug enabled is super slow? (check out comment section)

Many people complains Magento 2 is slow on localhost. Disabling CSS/JS merge/bundle/minify might help in that case.

 

2. Move to PHP7

While magento 2 works great on php 5.6 a move to php7 alone can improve performance by 25%.

All major hosting companies support PHP7. If you are maintaining your own VPS or dedicated server spend some time and install php version 7.

 

3. Server resources

Magento 2 is a complex system. Especially in developer mode it requires powerful hardware. If you run M2 on an old notebook you borrowed from your grandma expect no magic.

Avoid virtualization. Make sure you allocate at least 2G of RAM to M2.

SSD disk is a must.

Use cheap VPS like linode - for only $10 you can setup a decent Magento 2 environment. I run M2 on $10 linode myself with great success. See m214.goivvy.com

PS: Magento 2 runs OK on MacBook Air 2014+.

 

Do you have an advice that helped you speed up Magento 2? Don't hesitate to share it in comments!

 

If you find this post interesting do not hesitate to sign up for our newsletter and join the 811 people who receive Magento news, tips and tricks regularly.

Thank You!

 

 

3 thoughts on “Magento 2 slow in developer mode - 3 simple fixes”