My website is loading very slow.
I'm using Amazon AWS Instance with specs (2 CPU + 4 GB Ram).
When I see my website is slow, I check the CPU & Ram usage, I see the CPU is using 25% and the Ram is using 25% (Check this screenshot: https://prnt.sc/tw0uwr).
When I try to import any products by excel sheet, I see the CPU is using 50% and the Ram is using 25% (Check this screenshot: https://prnt.sc/tw0sca).
Do you think my server specs are low or there is something else that might cause this slow loading?
It can be due to any number of factors but for your case it is most likely software level optimizations or the lack of it.
Are you managing the server yourself or do you have a managed provider that can help you take a close look at the server and diagnose the cause of the performance issue?
I'm managing the server with myself.
Tell me any suggestions that might cause this issue and I'll test it on the server
There are many cases which can make your site speed fast, some basics I am sharing:
1).It maybe due to disabled caching,
you can check by command :
php bin/magento cache:status
if any cache value is 0, you can enable it by :
php bin/magento cache:enable {CACHE_NAME}
2). Enable Varnish Cache. (https://www.mageplaza.com/kb/how-to-configure-full-page-cache-magento-2.html#configure-vanish-cache)
3). Follow this Store > Configuration > Catalog.
Then click on Catalog which is under the Catalog tab. In here, you will see the Storefront section.
When you have seen it, find two fields which are Use Flat Catalog Category and Use Flat Catalog Product, and change these fields to Yes.
4). Go to Store > Configuration > Advanced.
Under the Advanced tab, click Developer. In the Javascript Settings section, change the values in three fields Merge JavaScript Files, Enable JavaScript Bundling and Minify JavaScript Files to Yes. Then, change the fields Merge CSS Files and Minify CSS Files in the CSS Settings tab to Yes.
5). Main issue can be of Images Optimisation, so check that also.
There are lots of thing you can do to increase site speed, check my above suggestions first, if still they don't help check this reference :
https://www.mageplaza.com/devdocs/speed-up-magento-2.html
1) Cache is already enabled
2) Varnish Cache is already enabled, check these screenshots:
https://prnt.sc/two259
https://prnt.sc/two2hr
3) Catalog >> Use Flat Catalog Category and Use Flat Catalog Product is already set to Yes
4) I changed it
5) My image sizes are small
Then it seems issue of bad code.
- You can check what is eating up the speed in option 1 and option 2 .
- And also you can check in network that what is taking so long to load.
- Do you have any testing/dev environment ? if yes, remove/disable all the modules and run all commands and test the speed if speed is increased, then enable modules one by one and deploy everytime after disabling/enabling.
(It is time taking process but totally worth it and you'll know better which module is specifically making speed down)
PS: Magento 2.3 has issue of disabling cache on disabling modules so check caching status also after that process.
- Optimise Javascript and CSS by minifying
- Use CDN
Confirm if you are using Production mode (not default/developer), which is obvious.
If possible share Your production URL here so we can observer it.
@gaurav_harsh1 wrote:
3). Follow this Store > Configuration > Catalog.
Then click on Catalog which is under the Catalog tab. In here, you will see the Storefront section.
When you have seen it, find two fields which are Use Flat Catalog Category and Use Flat Catalog Product, and change these fields to Yes.
4). Go to Store > Configuration > Advanced.
Under the Advanced tab, click Developer. In the Javascript Settings section, change the values in three fields Merge JavaScript Files, Enable JavaScript Bundling and Minify JavaScript Files to Yes. Then, change the fields Merge CSS Files and Minify CSS Files in the CSS Settings tab to Yes.
Just to point out that Magento no longer recommends the use of a flat catalog as a best practice as of version 2.1.x and above.
You can read more about it here:-
I truely agree with that but as in the post you shared also says that there are some modules which uses flat tables and despite having caching and everything enable if some still struggling with speed so much, then only I would recommend to use flat tables.
And I assume that if usage of flat table is vulnerable for performance and other security issues, then they might have already removed it.
well that article helps to get knowledge about flat tables, thanks for sharing.
Ok, I changed Use Flat Catalog Category and Use Flat Catalog Product, and change these fields to NO.
Do you think the website became slow because I'm having a huge number of products?
Actually I have 50,000 products.
Also, when I try to upload products using the (Import) method with uploading products more than 1000, the products are uploaded successfully but the website is showing the uploading loading icon forever and don't show me the results if it's a success or there are some errors.
Check this screenshot: https://prnt.sc/tx8i6s
Any update guys?