author img

Michał Kloczkowski

HOW TO HAVE A STABLE AND HIGH-PERFORMANCE ONLINE STORE USING MAGENTO 2 AS AN EXAMPLE

Quality control and clean code are the main factors for maintaining good performance for online stores based on Magento 2 (and beyond). Below are 6 specific tips to help you maintain a high standard.

The principle to follow to keep your e-commerce engine running efficiently while keeping costs rational is the age-old truth that the less we have to maintain, the easier it will be for us.

A similar principle applies when creating new solutions - KISS (Keep It Stupid Simple) - meaning "create things ridiculously simple." The "less is more" principle is not always about sacrificing, but often we accumulate unnecessary code or incur technical debt where it's entirely unnecessary.

Below is a list of elements where transparency and simplicity are particularly important:

#1 Clean and lightweight frontend

One of the most popular topics in Magento (and beyond) is the market for ready-made templates. Why pay tens of thousands of złoty for a layout when you can buy a template for $299? I won't judge if it's worth it or not, but consider the following:

  • pay attention to whether the template you have doesn't have too many unnecessary JavaScript plugins like JQuery (though it's challenging to eliminate that entirely from Magento). The more unnecessary animations and "bells and whistles," the worse it is for user browsers and the more unnecessary kilobytes load the page in performance tests. Meanwhile, a pretty animation on a button rarely affects conversion rates.


  • external module support - a good practice when creating Magento modules, even open-source ones, is their compatibility with Magento Blank / Magento Luma, the native Magento templates. The closer your layout is to the original, the cheaper it will be to adapt technologies.


Is PWA or Hyva a good choice to speed up Magento? I think both solutions are suitable for conscious store owners who use them knowing exactly what to expect. At the end of the day, both Hyva as an intermediate solution and a store with a multi-service architecture and PWA front can significantly speed up your store due to a different approach to architecture, but they can also be a pain in various areas. Before reaching for them - which usually ends up being a bigger project for existing stores - make sure there are no easier paths to optimize your service.

#2 Remove unnecessary modules

One of the significant advantages that people mention when asked about Magento's strengths is modularity. Thanks to Magento's modular structure, we can easily add functionalities by creating or installing ready-made modules. Unfortunately, using this advantage excessively can quickly turn it into one of the biggest drawbacks.

Too many modules can seriously affect the performance and stability of our service. This happens for several reasons, and one of the main ones is the questionable quality of ready-made modules (not just the free ones), which becomes especially apparent when dealing with a large scale. Additionally, modules are often created by unrelated authors and may conflict with each other.

Ask your developer for a list of modules that make up your Magento and get rid of what is unnecessary. Most of them (over 300) are system modules that come with Magento from its installation - and interestingly, quite a few of them are unnecessary as well. Get rid of what you know you won't need anymore and/or ask the person responsible for the technical maintenance of your store for recommendations.

#3 Maintain the cleanliness of the error log

Most services and modules keep error logs that occur during the system's operation in a structured way. The problem is that in most cases, we only check the logs when there is a specific need or when something is happening.

However, it's good practice to do this more often, at least once a month. Although most error messages may seem insignificant (if they mean anything to you at all), they can negatively impact the performance of certain processes or disrupt them entirely. The most interesting logs are, of course, those from the production environment.

Request production logs and have your development team analyze them. Of course, this task can take a lot of time and money, so what should you focus on first? Choose periods during which your store experienced problems and ask for a review of the messages from that period. Another effective method is to review what repeats most frequently.

#4 Check your checkout process

One of the most commonly rebuilt functionalities in Magento is the checkout process. Probably because the default version of the checkout in the Magento Luma theme leaves much to be desired, especially in terms of UX. As modifying such a large functionality as the checkout is quite expensive, online store owners often opt for ready-made solutions - especially popular one-step-checkout plugins.

Although most one-step-checkout vendors praise their impact on conversion rates, our experience is entirely different. Not only have we never been able to prove their positive effect on conversions, but we have also measured much higher resource consumption (in terms of simultaneous Magento application requests to the database) and problems with order data at a large scale.

So if you have performance issues or are losing data in orders, such as parcel machine codes or postal codes, consider reverting to the native Magento checkout. It only needs some adjustments in XML and CSS to be truly user-friendly in terms of UX, while maintaining high performance and reliability during use.

Checkout in native Magento Luma

Checkout in our Magento 2-based template

#5 Make sure you are operating in production mode

Like many mature systems, Magento has several operating modes. Besides the well-known "maintenance mode," used to block traffic during maintenance work, there are developer mode and production mode. The latter, as the name suggests, is used to put the application into maximum performance mode on a production instance.

This is such an obvious thing that it's rarely controlled by online store owners, and unfortunately, we have taken over quite a few stores in a state where "Magento is not building." What does that actually mean? Magento that cannot be put into production mode is one whose code cannot be compiled, meaning it is unable to generate its target and resulting code form. Some functionality must be constantly recalculated, and some code cannot be compressed, taking up more space and not fully utilizing the cache.

The first sign that your store may be running in developer mode is the presence of the "Developer" tab in the Advanced section after entering Store > Configuration - you can ask your team about this. Usually, a specific problem or set of problems is behind the issue with Magento's production mode. Depending on how long the problem has been ignored, this may mean that the source code is already far from the original, and restoring it to its original form may be a time-consuming process - but it's worth doing not only for performance reasons but also for security and update costs.

#6 Check integration processes

Are you sure that all integrations are working correctly, or at least are you aware of all the integration processes happening in your online store? Integrations are often the heart of online stores, not just large ones, and are often the least controlled element of the service.

A significant portion of the integrations we have dealt with are written inefficiently or generate errors. If you haven't done so already, create a list of all integration processes occurring in your service and ask for measurements or times of their execution. Check if some of them take proportionally more time compared to others. Perhaps you will find some that can be easily optimized or have their frequency reduced (if applicable) during peak sales periods.

Also, check if processes are hanging or generating errors. Well-written integrations should show everything in the error log (I mentioned this in the previous paragraph). Sometimes individual products, customers, or orders can cause a recurring process that results in the integration hanging.

Measure resource usage during integration execution as well. Code optimization is not always the only solution. Sometimes changing the timing of processes to avoid overlapping or adding a bit of power to the server is enough to increase the comfort of using the service by its users.

How to assess the state of my Magento 2?

Ask for a quote for updating your store to at least version 2.4.5. If the price astounds you, and the software house or your developers are evasive, it means you need to follow the previous 6 steps, and probably many more.

Are there other methods? Of course, there are. We usually perform a simple audit and a trial installation of the service - you can ask us about it - there are also other, often much more extensive audits available on the market. However, the aforementioned update is a good indicator of the service's condition - the more often it is performed and the smoother it goes, the less likely there are problems hindering your service's current development.

Read also: