Hello community,
I have a big problem for several years now and we dont get rid of this. The Api calls in, for example, the big cart or on checkout-page make the whole shop very very slow.
This pages take up to 5-7 seconds to load.
For example, the big cart:
https://i.ibb.co/1b0fmdw/Screenshot-2021-12-06-170531.jpg
The "totals-information" call of the Rest API takes 3,13 seconds. Everything else is fast.
Sometimes its even more, up to 7 seconds. Almost all API calls are very slow, not only "totals-information".
We have a quite perfect setup of all Magento-Performance-Optimizations: Varnish Cache on all static pages (of course they are fast as hell) or even the best possible JS and CSS bundling... we even have a very fast cluster webserver system. (We already tried on different systems... the system is not responsible for this kind of slow API calls.)
When i look into other fast Magento-Stores of other companies, i see the API calls like this:
https://i.ibb.co/7XWbfFN/Screenshot-2021-12-06-171136.jpg
120 MS ! So fast... how is that even possible?
I also tried to figure out if one or more modules are responsible for this performance-leak.
I deactivated one module after another... no big difference, till it came to "Braintree". Then it got 2 seconds faster. From ~5 seconds to 3 seconds.
Still very slow.
So i have no idea left what can be wrong. How is it possible to get to a 100 to 500 milliseconds fast API call?
I would really appreciate any help.
(We use magento 2.3.5p1)
Hello @muhamann,
Greetings!
Mostly it can be possible because of the size of your server. But here are some common steps that can boost up the speed of your API.
1. check the extensions you are using are secure or of good quality.
2. Check your system requirement.
3. Minimize Javascript or CSS.
4. Enable varnish cache.
5. Upgrade your Magento version to the latest.
I hope this will help you to speed up your API calls.
If not, feel free to contact us.
If worked, click KUDOS and accept as a solution.
Thank you!
Hello @namitapare2a78
no sorry, it does not help at all, because i intentionally mentioned and explained all your suggestions. I did this to point out that we have a really good and optimized system with all performance-boost there is.
Best JS and CSS minimization+bundling, varnish, cluster-server, CDN...
Also i pointed out, that i deactivated all extensions one after another to find out, if there is a "bad" extension, but nope.
So thats why i asked for help here.
Because we are out of ideas, why this API-calls are that slow.
Hello @muhamann,
Greetings of the day!
Other than this, We've to check. Because those are the common reasons that you might check.
If you allow us then, we'll check and tell you the exact issue.
Let me know your thoughts.
Thank you!
@namitapare2a78 Sure, i would be really happy, if you could check the bahaviour.
I can send you the access-data to one of our DEVs via private message? Or do you prefer another way?
Thank you
We tried was caching the data using Memcached (Or something like Redis would work, too), though you now have to worry about how often to update the cache, from where, and things like that. But, it does achieve the goal of retrieving data much, much faster. I think whether or not this is a good option will depend on exactly what you're trying to do.
Hello @LitCommerce Expert
We already use Reddis for Sessions and also for the Magento System.
Also without updating the Cache (or doing anything in the Admin) and then checking the API-call-times its no difference, still worst: Between 3 and 7 seconds.
Any API Call from big cart, or "into-cart action" or loading the checkout, like:
V1/guest-carts/D4FDMggvohljL0sZXUO8gFSKn3hxpGFU/estimate-shipping-methods
or
/rest/de/V1/guest-carts/eUWbvqOA4xi6FjQ6hjXCclKLsPwqTqAX/set-order-custom-field
need 3 to 7 seconds and make the whole checkout very very slow.