cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.4.2 slow with multiple stores

SOLVED

Magento 2.4.2 slow with multiple stores

Good morning people!
I come to ask for help with magento 2 configured for multiple stores, my problem is that when I have one or two stores it works normally, but our database has more than 20 stores registered and this causes a very long delay for the first load. Once the store is accessed it gets faster!

I've done several tests, increased the capacity of all services and had no improvements, database and services are optimized. We use instances on AWS EC2, AWS RDS database, AWS CLOUDFRONT CDN and AWS ELASTICACHE REDIS.

When you have one or two stores it takes about 1-2 seconds for the first load, but with all our stores it takes about 15 seconds for the first load.

Does anyone have a solution to speed up this initial loading?
We are using Magento 2.4.2 community.

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.4.2 slow with multiple stores

It seems like you have already made significant efforts to optimize your Magento 2 stores, but the long delay for the first load with multiple stores is still a concern. One potential solution to speed up the initial loading time is to consider using managed cloud hosting. Managed Magento hosting providers offer expertise in optimizing cloud infrastructure, fine-tuning server settings, and implementing advanced caching solutions like Varnish or Redis. They ensure automatic scaling for handling traffic spikes and provide proactive monitoring and support. Leveraging managed Magento hosting can potentially improve your website's speed and responsiveness, delivering a seamless experience to customers across all stores.

Avid learner and technical marketer at devrims.com

View solution in original post

7 REPLIES 7

Re: Magento 2.4.2 slow with multiple stores

Are you seeing the slowness at the frontend or the backend of the store? 

 

Do you use any Full Page Cache (FPC) like Varnish or LiteMage Cache?

 

What Web Server are you using? 

 

Is your MySQL properly tuned, especially relating to the InnoDB buffer pool? 

Re: Magento 2.4.2 slow with multiple stores

Hi, thanks for the reply.
Our slowness is for the frontend only!
We are currently not using Full Page Cache (FPC), but the varnish has
already been installed and configured and there has been no improvement.

In my tests I saw that the mysql that generates the slowness I will check
the settings you mentioned "buffer pool of InnoDB" and come back with an
answer.

Thanks a lot for now.

##- Por favor digite sua resposta acima desta linha -##

Re: Magento 2.4.2 slow with multiple stores

If the slowness is with the frontend only, a Full Page Cache like Varnish should help. 

 

Can you make sure that Varnish is setup correctly within Magento based on the following guide?

https://devdocs.magento.com/guides/v2.4/config-guide/varnish/config-varnish-magento.html

Re: Magento 2.4.2 slow with multiple stores

Magento2 works differently to Magento1, ourselves with the consultants have spent the past 6mths designing a cluster architecture which achieves 98% performance ranking on categories and 95% on product pages, this was the evolution on AWS, avoiding 'local' files so an update to the 'master' was reflected across the cluster.

 

1x LB / 2x DB Galera (Write & Read) / 3x Web (or more) / 1x Elasticsearch/Redis / 1x Varnish on Magento 2.4.3 with 4websites having 1store each

 

First release was to use EFS however as expected it was intensely slow.

Second release was to use Gluster, but on testing with 10,000 products was no faster than EFS.

Third release was to use Ceph, this is fast, but a beyond miserable experience to install for the consultants, however provides cross web cluster RAID with effective instant replication.

 

The standard topology for a Magento install is a load balancer with two or more Varnish instances which talk to the web server cluster, however, if you are looking for organic Google ranking there is a problem, you cannot shard the Varnish cache across instances and 'warming' fails as the product count increases.

 

They implemented an alternative approach which provides better performance for organic ranking by making the web servers the first entry point after the load balancer, not varnish, within weeks we had 10% of the site ranked by Google with zero advertising on 15,000products, working our way to 250,000+ products.

 

Magento slows the higher the product count, and especially the more stores you have which was a major problem in Magento 1x, using the AWS methods such as RDS are less optimal than raw servers with these installed, as our product count will be so high we had to provide maximum performance from the outset.

 

Most likely the problem is the combination of opcache/redis/varnish/database not working in sync but when it comes to performance, the devil is in the detail, high store counts are the worst of the worst for Magento and using AWS (which is already slower compared to bare metal) with their RDS/Redis services the load times will become unsustainable.

 

Is there a solution, try the dual varnish from load balancer in to a web cluster connected to a single redis instance, after that you will need a Magento performance optimized web cluster, Nexcess have them but charge $5k to $10k/mth, we had issues paying the 80% of that as their monthly management fees, so instead went the upfront route with the consultant cost and run on 15-20% of that monthly, if you can separate the 20stores in to multiple websites it should help.

MochiGroup.net

Re: Magento 2.4.2 slow with multiple stores


@JLHC wrote:

If the slowness is with the frontend only, a Full Page Cache like Varnish should help. 

 

Can you make sure that Varnish is setup correctly within Magento based on the following guide?

https://devdocs.magento.com/guides/v2.4/config-guide/varnish/market-promocode.ru 


I used this guide to test.

Re: Magento 2.4.2 slow with multiple stores

It seems like you have already made significant efforts to optimize your Magento 2 stores, but the long delay for the first load with multiple stores is still a concern. One potential solution to speed up the initial loading time is to consider using managed cloud hosting. Managed Magento hosting providers offer expertise in optimizing cloud infrastructure, fine-tuning server settings, and implementing advanced caching solutions like Varnish or Redis. They ensure automatic scaling for handling traffic spikes and provide proactive monitoring and support. Leveraging managed Magento hosting can potentially improve your website's speed and responsiveness, delivering a seamless experience to customers across all stores.

Avid learner and technical marketer at devrims.com

Re: Magento 2.4.2 slow with multiple stores

Cache != Performance.

 

How about you just use a code profile (new relic, tideways or similar)? You can see what code slows the site - from my experience it's either a 3rd-party extension or a custom theme.