Tuning Magento 2 performance can be a challenging task. We’ve launched ten Magento 2 sites at this point, so we’ve learned quite a bit, the hard way. For an example, check out Virota with over 400,000 products:
If you’re struggling to get your new site to load quickly, you may find some guidance here. Let’s start with a quick list of considerations:
- Server hardware – Requires a current processor (doesn’t need to be high end), fast storage (like SAS drives or solid state drives) and 1 GB of RAM.
- PHP 7 – Magento 2 will run on an older version of PHP, but it will be noticeably slower.
- Production mode/caching – Keep in mind it runs like a snail in development. Its not a bug, it’s a ‘feature’.
Really Technical Items
Here are a couple really specific configuration settings that are important to tuning Magento performance tuning. If you’re using a good Magento hosting provider, they’ll have done this for you. If you’re using GoDaddy… well, you’re getting what you pay for.
First, optimize PHP and MySQL settings out of the box.
- Compression turned on – enabled in the HTAccess file as well.
- memory_limit must be set to 1024M
- in addition, open_basedir set to none
- finally, always_populate_raw_post_data set to -1
- Turn on Query caching
- Increase INNODB buffer pool size
- Another possibility… Some sites benefit from using Flat Catalog indexes for products and categories. You’ll need to experiment with your particular site.
Troubleshooting Magento 2 Performance Problems
OK, so you’ve got the server configurations set, but it’s still a dog. Here are a couple proven trouble spots worth investigating.
- Extensions – Disable all the extensions then look at performance. Many Magento 2 extensions are new, and still have some performance issues.
- Custom coding – Obviously Magento 2 is a sophisticated application. It’s easy to introduce slow custom code. Set it back to the default Magento code and give it a spin.
- 3rd party integrations like Google Analytics – If their servers are slow, they can slow your page loads. Can’t tell you how many times clients complain about a slow page load, only to find it had nothing to do with our code or servers.
- Image sizes – In addition, put a 2MB JPEG on the home page, and try to load it over your iPhone. Seems obvious, but not every person managing a site understands how large image files are, or how to compress them. As a result, limited mobile bandwidth clog.
A couple exciting technology updates are just a few months away. They’ll speed your site’s load time, when configured to support them.
Running under TLS – First, a number of changes are coming to SSL/TLS. In the past, running under SSL slowed the data transfer. Upcoming changes to TLS will actually provide better compression, fewer server connections and more speed tools. Read more at istlsfastyet.com.
HTML 5 – In 2017 and 2018, HTML 5 appears in web servers. When installed on your web server (APACHE, NGINX, etc.), the site appears to load faster. For example, it learns the images that get loaded on every page. The web server starts sending the images when requested. It doesn’t wait for a request for the images.
In conclusion, Magento 2 performance is determined by many factors. Looking for some help speeding up your site? Contact Us!