Speed Up Magento 2 in 5 steps
Speed Up Magento 2 in 5 steps
Slow Magento?
Need Magento help?
Magento 2 TTFB Optimization –
34 steps to speed up Magento –
If you are still on Magento 1 – Upgrade before it’s too late! Here is a guide to help in the process –
Hire a Magento Certified Developer –
Hello! I am Konstantin, a Magento certified developer with goivvy.com. In today’s video I will share my 5 field-proven steps to help speed up Magento 2.
Why do we need to speed up Magento 2?
But first, why do we need to speed up Magento 2? Well, the answer is simple: no one likes slow checkouts. An e-commerce site should be fast, and Magento is known to be quite sluggish.
So, my 5 steps to optimize the performance of your Magento 2 site are:
1. Run a time to first byte TTFB audit.
2. Perform a 3rd-party extensions audit.
3. Choose the right hosting.
4. Set up production mode.
5. Use Full Page Cache and Varnish.
Step 1: Time to first byte TTFB audit
Time to first byte is how long Magento takes to generate HTML. This is your main performance metric. Good TTFB, or server response times, are around half a second. In fact, half a second is the TTFB for a fresh copy of Magento 2.
Things that could affect TTFB are customizations, custom themes, and 3rd-party extensions. If you struggle with a slow M2 site, a time to first byte audit is the first step you should take to speed things up.
To help yourself with a TTFB audit you can use XHProf. XHProft is a PHP extension that profiles code and then outputs a trace like this.
To find abusive functions you just sort by Excl. Wall Time then analyze the first couple of entries to see which ones are taking long.
By the way I composed an extensive tutorial on how to optimize Magento 2 TTFB. You might find it interesting. I put the link to it in the video description.
Step 2: 3rd-party extensions audit.
Now Step 2. Remember how I said that one of the reasons Magento 2 sites are slow is because of 3rd-party extensions? Now we are going to find all of those abusive plugins and eliminate them.
How do we do that? Easy. Let’s go to the Magento 2 backend menu by clicking Stores – Configuration – Advanced – Advanced and get a list of all extensions that are installed. You’ll want to ignore those that start with Magento_.
Now go through the list and disable the plugins one by one. Benchmark the speed each time with www.webpagetest.org. If you notice a significant difference in speed once you disable an extension, then that plugin is an abuser. You should contact its vendor and ask for help or just uninstall it.
Step 3: the right hosting plan
A hosting plan is the foundation of a fast website. Magento 2 will give poor performance when paired with poor hardware.
How do you know if you need to change or upgrade your hosting plan? Here is a simple test to help you decide. Go and install a fresh copy of M2 on the very same server your live site is running on. This fresh M2 should be the same version as your live M2. Then benchmark the fresh copy against your live store. Is the fresh copy significantly faster? Then your hosting is alright. You don’t have to change anything. Is the fresh copy as slow as your live site? Then your hosting resources are not powerful enough to run Magento 2. Get a different plan. Sign up for a Magento optimized server instead.
Step 4: Production Mode.
This part is very easy. But from my experience many people are just completely skipping this step.
Magento 2 has three running modes: default, developer, and production. If you want maximum performance you need to switch on production mode.
To find out what mode you are in now run this command:
php bin/magento deploy:mode:show
To switch to production mode run this command: php bin/magento deploy:mode:set production
Step 5: Full Page Cache and Varnish
Magento 2 comes with Full Page Cache functionality. This means it can cache whole pages and can “hide” your performance issues under a caching layer.
You need to take advantage of this. Go to System – Cache Management and double check that Full Page Cache is on.
Full Page Cache supports Varnish as a Caching Application. Varnish is a special program that could cache and serve web resources efficiently. To setup Magento and Varnish go to Stores – Configuration – Advanced – System – Full Page Cache and set Caching Application to Varnish. Then you have to install and setup Varnish. You might need help from a system administrator. Or your hosting support team can help you. Just ask them.
So, those were my 5 field proven tips to speed up a Magento 2 site. They really work. I hope you enjoyed this video. If you have a question – please leave a comment. I will try and answer it. More Magento videos are coming up.
See more here
Hi – are you available for some freelance work ?
Magento eCommerce site needs a constant audit to ensure consistency in performance and user experience. It is highly recommended to follow all Magento coding standards as it reduces the chance of errors. The list of coding standards covers code demarcation, PHP, JavaScript, jQuery widget, DocBlock, LESS and HTML style guide. You can refer to all these coding standard documents in the official page.
Anyways, read the below. This might help.
https://www.namasteui.com/know-these-before-auditing-your-magento-2-website/
—
Regards,
Sourav Basak
Namaste UI
Have you been ignoring improvements on your Magento Store just because there are no resources to examine the not-so-prioritized weak lines that can give your online sales a significant boost? That’s precisely where Xcentric Magento Audit can help you out.
Click here for: HOW TO USE XCENTRIC MAGENTO AUDIT TO INCREASE ONLINE SALES
https://www.xcentricservices.com/xcentric-magento-audit-to-increase-online-sales/
Magento 2 Speed Optimization tips https://youtu.be/FK1F9u7467s
C'est clair et précis !
Good information.
Hi Konstantin, amazing video, i have a problem witm my ecommerce, when the customer buys a product, the system collapse for five minutes, but not at all, the plataform only process that sale, no other customer can buy a product in this 5 minutes. we try some things but no results, maybe you heard before about this problem, thank you so much for your answer, sorry for the bad english.
does nginx and varnish work together? my current provider says no, documentation on magento suggests atherwise
Thanks for this, what is median (good or bad) for an extension load time? Does the profiler check loading speed of each individual extension/module?
Hello, can you show what preparation we need to do for magento 2 professional developer? How can we prepare dor exam?what type questions they ask and how can I clear it?
Hey cool tips. Thanks for.it.
Can you show what things we need to do on server to optimize magento 2 performance? What steps we need to follow to follow to optimize on server side?
Also, how to write doc blocks during development? Which text editor are you using?
Any special tools are you using for magento2?
That's a great guide Konstantin, but I want to ask what's the difference between Varnish and Redis, because my web admin set up Redis on AWS. So do I need Varnish with Redis or they do the same thing with the same performance?
Your information is valuable.
Hi
could you add new video on
Backend to add custom field on bundle option ?
Thanks. Stores/configuration/advance/advance is moved. Anyboady know where it's been moved?
Great information. I've heard you guys are the best at Magento optimization.