A website, especially in e-commerce, must respond quickly to the user. Therefore, this guide will show you how to optimize Shopware’s performance.
Some tricks can be useful to improve the performance of your Shopware website. But let’s start by seeing together what they are.
Choose a suitable Shopware hosting provider
A hosting provider should be reliable, efficient and secure. Furthermore, it should be able to offer its customers the possibility to update their hosting plan during the construction phase, if they need a more performant resource. In essence, the customer must be able to modify their offer according to the development and growth of their shop.
Not to mention that the support part must be fully effective. Continuous support can give you feedback in the unfortunate event that problems arise. Unfortunately, it can happen online. The important thing is that your provider can give you immediate and effective support.
Therefore, when choosing your hosting provider, you should consider the following arguments:
- Shared hosting vs. vServer vs. dedicated server
- 24/7 support
- Any previous experience with Shopware at hand?
- Customer reviews
By choosing the right hosting optimized for your platform, you can guarantee an efficient and fast service, so that your customers are fully satisfied.
How to Measure Performance
The first step is to measure performance so you can identify critical issues and know where to intervene.
When measuring the store’s performance, loading times can only be an indicator of the expected performance level. The features present in your store, ranging from item counting to internal structure or momentary capacity utilization, will always have a significant influence on loading times.
Measuring Performance with Firebug
To generate comparable measurements, we recommend installing the Shopware demo data plugin before running tests in your store. Firebug is a browser extension that can be installed directly through your browser. If installed, it will display the loading times for each component of the page in the browser’s network tab.
Particularly relevant are the loading times of the entire web page, most likely the first item in the list. To collect relevant measurements, it is necessary to load the target page multiple times, listing the pages and noting all the loading times.
Measuring Performance with the Apache Benchmark
To call the benchmark using a Linux shell, use the following command:
Here you should choose the average of all connection times (= total time).
Optimizing MySQL Configuration
The default configuration of many distributions is not ideal for production environments. But don’t worry, there’s a script for that! “Mysqltuner” provides suggestions for non-optimal configuration and parameter settings.
Tips for Improving Performance
Standard Sorting for Category Lists
If you have defined your sorting criteria, you should make sure that there is an index in your database for each of the columns in the table.
Changing Your Update Strategy
There are several processes active when you access one of the pages of your store. For example, SEO links are generated, the search engine cache is generated, and the data necessary to display best-selling items or other items of interest, based on similar customer behavior.
So you need to consider whether or not all of these features can be useful to your store.
For example, you can consider changing the update strategy from “live” (request per page) to “cronjob” (cumulative, timed). To do this, go to Configuration –> Cache/Performance –> Cache/Performance –> Settings (tab).
Look for the entries SEO (1), Search (2), Top sellers (3) and Referral Marketing (4) and you can make your changes directly. To use the cronjob features, you will need to first install two custom plugins, “Cron” and “CronRefresh”. With these plug-ins, you can control the timing of server requests and you should schedule them, most likely at night.
Enabling HTTP Cache
With Shopware, you can use caching instead of retrieving all data from the database in real-time for each user. Since each database access uses scarce web resources, consider also enabling http-cache. This will create a cache file, which incorporates the most important information from the article list and its detail page, thus preventing unnecessary database queries. This will also make browsing your store much faster and therefore more enjoyable.
With the cronjob we created above, we made sure that the cache file does not grow too large, as it is regularly deleted (default value: every 24 hours). This has proven to be quite practical as the HTTP cache could grow by 1-2 GB per day if used frequently.
Activate the HTTP cache via Configuration –> Cache/Performance –> Cache/Performance –> Settings (tab) > HTTP Cache and check the plug-in and all changes made for compatibility with your store.
We recommend running a test before activating the changes made.
Plugin Inspection
There are many cases where the use of plugins has had a serious impact on the performance of a store. To check whether or not a plugin can affect the performance of your site, it might be a good idea to disable all third-party plugins and compare the performance of the front end with and without plugins activated.
An easy way to do this is to run an SQL query in a test environment. Both queries shown below can be executed in phpMyAdmin and will disable a plugin that is not part of the default Shopware configuration.
Alternatively, you may want to use the plugin safe mode provided by the Plugin Manager from Shopware 5.3 onwards.
Once the store is running smoothly again, you can try to identify the plug-ins that are affecting your store’s performance by reactivating third-party plugins one by one. You can also reassess the need for each plug-in and tidy up your store’s backend a bit.
“Debug” Plug-in
Out-of-the-box Shopware comes with a “Debug” plug-in that can monitor and compare individual processes on a server. It will provide you with sufficient information on e.g. page request durations and will indicate processes, e.g. database queries, controllers, etc., that could slow down individual requests.
System Check
Shopware collects information about your system configuration and lists it in Configuration –> System Information. Here you will find entries like “memory_limit” (1). Exceeding the memory limit e.g. will harm performance. Keep in mind that memory limits can be changed and virtually enlarged, making a thorough examination of your system worthwhile.
Compiler Caching
By going to Configuration –> Theme Management –> Settings, you have the option to disable compiler caching. This is generally recommended during the normal production cycle of the store. Since compiler caching slows down a store considerably, it should only be used during development and infrastructure changes.
Source: Docs Shopware
That’s it, folks! Check out our blog for more information.
Free 30-days trial Hosting shopware Fast, Secure and Optimized
Switch to Bhoost with 30 days free and migration included
Free 30-days trial