In April 2021, Google announced the upcoming rollout of what they call the “page experience update.” This update will change how Google ranks websites by making page experience a major ranking factor.
If poor performance plagues your Magento store, it will likely see a significant drop in its ranking and traffic after the update. Here are some common causes for Magento performance issues and their solutions to help you improve your website performance.
Magento provides merchants with several tools to improve page response and support higher throughput. But it often suffers from performance issues due to misconfigurations and user errors.
Let’s go over the common causes leading to performance issues and how to fix them.
1. Choosing the wrong theme
When merchants compete to provide their customers with engaging shopping experiences, they often lose sight of what’s important: performance. If you’re using an off-the-shelf theme, you’re doing yourself a disservice.
Ready-made themes are notorious for being bloated and poorly coded. They’re packed with general-purpose features and designed to appear attractive. However, when used on production websites serving live traffic, they can hurt website performance significantly.
The best way to ensure you have an attractive website without compromising on performance is to use a custom-made theme designed and developed to suit your business needs.
And if you don’t have the budget to build one from scratch, you can always opt for a ready-made theme and customize its design and functionality.
2. Excessive third-party extensions
Magento’s modular architecture allows merchants to provide their customers with feature-rich websites. And with the official Magento Marketplace offering over 3,800 extensions, it’s easy to go overboard installing extensions to increase website functionality.
Adobe thoroughly reviews the extensions on the Magento Marketplace for compliance with Magento’s coding standards. However, those available through third-party vendor websites don’t enjoy the same luxury.
Excessive extensions on a website can lead to unnecessary requests made to the server during page load and a strain on its resources. Therefore, it’s strongly recommended to make prudent use of extensions and opt for custom-built extensions when possible.
Doing so can help you provide your customers with a feature-rich website without compromising on performance.
3. Incorrect database configuration
Magento uses MySQL with an Entity-Attribute-Value data model to ensure space-efficient data storing, flexibility, and performance. Therefore, the Magento database is rarely a bottleneck to website performance, unless it’s misconfigured.
Starting with Magento 2.4, Adobe introduced support for MySQL 8. If you’re using Magento version 2.4 or above, you should upgrade your database to MySQL 8 because it’s up to twice as fast as its previous versions.
Magento stores using MariaDB 10.4 are likely to suffer from slow reindexing. To overcome this and improve performance, you should update the default database configuration and set the following parameters:
- optimizer_use_condition_selectivity = 1
Additionally, you should also set the indexers to ‘Update on Schedule’ instead of ‘Update on Save’. The latter can lead to performance problems when serving large volumes of website traffic.
4. Slow server
Another common cause for Magento performance issues is a misconfigured web server. Server-side problems can include:
- Slow CPU
- Inadequate RAM
- Misconfigured PHP settings
Magento is a CPU-bound platform. It needs a lot of processing power to ensure it can process incoming requests without queueing them.
Adobe recommends using this formula to calculate the number of CPU cores you need to run a fast website:
N[Cores] = (N[Expected Requests] / 2) + N [Expected Cron Processes]
When you expect an increase in website traffic, you can manually increase the number of cores to support heavy traffic periods.
You can also optimize your PHP settings for performance by:
- Setting the PHP memory limit based on your deployment.
- Setting the value for realpath_cache_size to 10M and realpath_cache_ttl to 7200.
- Enabling OPcache.
If you can’t figure out what’s right for your store, a Magento maintenance and support agency can help you simplify your server management tasks.
5. Incorrect operation mode
Magento offers the following operation modes out of the box:
The ‘default’ mode is how it operates when no other mode is specified. It enables deploying a Magento store without changing any settings. However, this mode isn’t optimized for a production website because static files are generated dynamically, impacting store performance significantly.
The ‘developer’ mode is used when the platform is being extended or customized. It doesn’t cache static view files and displays uncaught exceptions in the browser to allow easier troubleshooting.
The ‘maintenance’ mode allows taking a site offline during store updates and upgrades. Visitors are shown a “Service Temporarily Unavailable” page when Magento is running in this mode.
Finally, the ‘production’ mode is the only mode that’s intended for serving live traffic. It generates static files, caches them, logs errors to the file system, and doesn’t allow enabling or disabling cache from the Magento admin panel.
When you’re running a live website, you should use the ‘production’ mode to ensure optimal performance.
You can follow Adobe’s guide for setting the operation modes in Magento to check your website operation mode and configure it to run in the ‘production’ mode.
6. Misconfigured caching
Magento is built for performance. Its ability to support enormous traffic volumes without compromising performance is why it’s trusted by companies like The Coca-Cola Company and Jaguar Land Rover. But if you find your website struggling under heavy loads, there’s a strong chance its caching is misconfigured.
Magento is designed to work with Varnish and Redis for caching. Its default database and file system caching work in a development environment, but it cannot support a website in a production environment.
Varnish is a powerful HTTP accelerator perfect for caching the full-page cache in Magento. While Redis is a robust in-memory key-value data store perfect for storing Magento session cache files notorious for becoming bloated.
When appropriately configured, Redis and Varnish can make your website fly, allowing it to achieve page load speeds as low as 1–2 seconds. And if you think working with two new technologies is beyond your expertise, you can contact us to help configure your Magento store for optimal performance.
7. Flat catalogs
Magento developers and merchants have relied on using flat catalogs to improve website performance since the launch of Magento 2. This setting helps reduce the number of calls made by Magento to fetch data from the database and improves the efficiency of indexing it.
However, since the release of Magento 2.1.x, Adobe advises against using flat catalogs as it now leads to indexation issues and performance degradation. So, if you’re using Magento version 2.1.x and above, you should disable the flat catalog on your store to ensure optimal performance.
But before you disable it, verify that none of your extensions use flat catalogs. Then, log into the Magento admin panel and navigate to Stores > Settings > Configuration > Catalog > Catalog. Expand the ‘Storefront’ section, update the following values, and save the configuration:
- Set ‘Use Flat Catalog Category’ to ‘No’. (If required, uncheck the Use system value checkbox.)
- Set ‘Use Flat Catalog Product’ to ‘No’.
8. Excessive and unoptimized media
Successful ecommerce websites use images and videos to highlight their product’s best features and promote top sellers. But this can easily lead to an increase in page size and a reduction in page load speed.
While the most straightforward approach to overcoming this would be to reduce the media on your website, there are better ways. Optimizing your website media by serving it in next-gen formats like WebP can help you reduce the size of the files, and using lazyload to delay offscreen image loading can improve the browsing experience.
Additionally, using a CDN like Fastly or Cloudflare can help you store and serve website media from their distributed datacenters reducing the load on your webserver and improving your website performance.
9. Using database search
If you’re using a Magento version below 2.4, you might be using the default database search functionality. While it might seem more manageable than using Elasticsearch, it can hurt your website performance significantly.
Each time a customer pulls up your website and searches for a product, your database will be tasked to find what they’re looking for. And when several users perform concurrent searches while others browse your website and place orders, your database will become overloaded and slow down.
Elasticsearch is a powerful search engine that parses raw data from your store before processing and indexing it. It can help Magento store owners provide their customers with real-time search results on their website while freeing up the database to perform other essential tasks.
Adobe has detailed guides to help Apache and Nginx users configure their Magento stores to use Elasticsearch as the catalog search engine. Using it will help you improve your store performance while also providing your customers with a better search experience.
Optimizing your store performance requires a systematic approach consisting of identifying bottlenecks and fixing them. If you find dealing with technical aspects intimidating, you can always let Magento experts takeover your store maintenance.
Timely measures to improve your Magento store performance can help you prepare for the latest Google algorithm update. Focusing on delivering the best customer experience possible will ensure your website and business remain future-proof.
Author: Jan Guardian
Jan is the Chief Business Development Officer at Staylime, a Magento design and development company headquartered in Redwood City, California. He is a Member of the Magento Association and an Adobe Sales Accredited Magento Commerce professional. Jan is responsible for developing and leading the sales and digital marketing strategies of the company. He is passionate about ecommerce and Magento in particular — throughout the years his articles have been featured on Retail Dive, Hacker Noon, Chief Marketer, Mobile Marketer, TMCnet, and many others.