Processing... Please wait...

Product was successfully added to your shopping cart.

Why Magento 2 is slow? (5 reasons and 3 field-proven fixes)

Magento 2 might be slow. I see complains about M2 performance on various forums and StackExchange Q&A site too often. How do you make it fast? After all this new version should be more optimized than the old one...

I myself struggled with that problem for some time. Here is what the reasons for slowness could be:



Magento 2 is slow because of:


  1. It is in developer mode with CSS/JS merge/bundle/minify enabled.
  2. It is running on slow hardware.
  3. Some 3rd party extension breaks performance.
  4. SSD not used.
  5. Full page cache and other caches are turned off.


Now let us deal with every one of the above problems separately. First I will tell you what to do if magento 2 is slow in developer mode.

PS: Here is how to find out what M2 mode you are in:

cd magento_main_folder
php bin/magento deploy:mode:show


When you are in developer mode


This mode is needed when you are just getting your site ready for production. But wait time of 30s could be very frustrating and annoying. Here is 3 simple fixes you could try to speed up magento2:


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+.



When you are in production mode


What happens when have a magento 2 slow site even in production? That might be terrible and could lead to sloppy conversion rate. People tend to hate slow checkouts :)

No worries I have been there and I have again 3 simple fixes to boost performance.


1. Audit your 3rd party extensions


Magento 2 is greatly extendable with plugins and modules. But unlike core functionality that was coded by Magento Core Team a.k.a gurus and experts 3rd party extensions are developed ( in most cases ) by average programmers. With average skills. One poorly written module could slow magento down big time.

Get a list of all plugins you installed and disable them one by one. See if it affects performance in any way. Identify a bottleneck and contact vendor for assistance.

Go ahead and install a fresh Magento 2 with sample data on the same server. Compare its speed to your production site. If a default M2 is as slow as your customized magento store then go to step 2. If it is significantly faster then you know you have an extension that slows you down.


2. Server hardware makes magento 2 slow


You can simply find it out if you install a fresh M2 on the same server and compare its performance to your production site. If you don't see a difference then obviously your hosting plan is not suitable for magento2. Sign up for better hosting and secure more CPU/RAM power. Don't be cheap here!


3. Make sure full page cache is on


Did I tell you I have a client once with magento 2 slow problem? He complained a lot about how slow his site was. Long story short it turned out his employee disabled full page cache at System > Cache Management and forgot to turn it on. Simple solution to a big problem. It is never to late to check obvious magento 2 performance settings.


Struggle with slow Magento! We can help! Fill out the form below to get a free quote.


Other articles you might be interested in:

  1. Magento 2 hardware requirements (4 working tips for decent performance)
  2. Magento Performance Optimization - 7 steps to faster website
  3. Magento 2 and 1 Million Products
  4. Marius Strajeru, Jisse Reitsma, Rakesh Jesadiya talk about Magento 2
  5. Magento TTFB optimization to reduce time to first byte


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

Thank You!


6 thoughts on “Why Magento 2 is slow? (5 reasons and 3 field-proven fixes)”
  • amdas
    amdas December 2, 2017 at 4:22 am

    all this new version should be more optimized than the old one..

  • Czes
    Czes October 25, 2017 at 4:35 pm

    First thing you should make, is turn off unused magento stuff. ie. when you don't use API - turn off this sh*t! If you turn off 50% features and run FPC - your magento 2 will be (maybe) faster than 1.9

  • Bryan Veloso
    Bryan Veloso September 28, 2017 at 2:22 am

    M2 is frustrating, it's still very slow even if I already followed your instructions. T___T.

    Gotta stick to M1 until 2030.

  • Shara Jones
    Shara Jones June 9, 2017 at 2:17 am

    I read your blog, Konstantin, the 3 simple fixes are really informative! Thanks you for the ideas!

  • Konstantin Gerasimov
    Konstantin Gerasimov March 21, 2017 at 1:03 pm

    you are very welcome.

  • Fayyaz Khattak
    Fayyaz Khattak March 21, 2017 at 3:19 am

    Nicely written post. These are small tips, but they help to fix some real issues. Thanks for writing! :)