I have developed custom API with Magento(1.9 community edition) SOAP API V2 to fetch orders. The problem is APIs are taking more than 25 seconds to respond. There are couple of API calls involved.
- /login to get API key
- /customOrdersApi to get orders
Both calls are taking too long to respond. CPU utilization is also maxed out during calls.
An interesting behavior I found while monitoring Magento cache (var/cache), it created a WSDL file every time and deleted it after an end of execution. That WSDL cache file's id was in upper case mage---345_WSDL_CONFIG_GLOBAL. There was already cached WSDL file in lower case mage---345_wsdl_config_global but Magento didn't pick it. After that I dug deep in Magento core files and found in code/Mage/core/Model/Cache.php, function _id($id) was turning ids in to upper case. I commented that out and Magento started to pick cached lower cased WSDL file. Response time decreased drastically and both calls started to take less than 3 seconds.
FYI Magento Core API WSDL cache is already set to true.
Has anyone experienced this behavior of Magento? Is there an efficient way to improve the speed of Magento SOAP API?
Thanks