Skip to content

Magento extremely slow after migration to a new AWS instance

We are using t2.large as instance type and php v 7.2

Magento2 multi-store is taking 25 seconds to load
The product page is extremely slow We are Bitnami cloud image of Magento Does the server location affects the performance ?? Do I have to use a Load balancer?? I am using a built-in cache for Magento and flat category The store is in production mode all basic commands are already

php bin/magento setup:upgrade

php bin/magento setup:di:compile

php -dmemory_limit=5G bin/magento setup:static-content:deploy -f

php bin/magento indexer:reindex

php bin/magento cache:flush
rm -rf generated

I have upgraded Magento version to 2.3.5 as well but no performance improvement

I am not much experienced and looking up for suggestions??

GT metrix



There is no magic switch to make your Magento fast. The speed can be affected by many factors, including the configuration of the infrastructure/server, configuration of the Magento itself, what extensions and/or themes you are using much more.

To answer the 2 questions you asked:

Does the server location affects the performance ?? – Yes but I don’t think you should worry about it at this point (unless you are hosting the site in South Africa and your users are mostly from Sweden or you have a similar situation).

Do I have to use a Load balancer?? – I don’t think so. You should use a load balancer only when you have such big traffic you want to distribute the load across multiple servers/instances.

I would suggest going through the following as a starting point:

  1. Flat data is not that good at this point since Elastic Search is supported in Magento by default. I would suggest setting up that and turning flat data off. See the top description here for more information.
  2. Set up Varnish. That should give you a good boost if you are not using it.
  3. Set up a CDN. The simplest way to set it up is to sign up for Cloudflare and use that one. You can then tweak some speed settings there to help you achieve a better score.
  4. Enable JS minification. This can be done either in Cloudflare or Magento. Check what works out best for you.
  5. Ensure that the largest images on your website are sized properly. You shouldn’t use a banner image that is 4k or more and is very heavy in size. You can also use a tool such as TinyPNG to reduce the size of your images.
  6. As one already commented on your post – share the network tab of Chrome dev tools here. Also, Lighthouse or Measure results could come in handy. That will show more insights into what is causing that massive fully loaded time. Then find the biggest problem makers (what delays the website fully loaded time the most) and try to improve it.
User contributions licensed under: CC BY-SA
10 People found this is helpful