Magento slow post


After an intense debug into Magento, we (Filipe Ibaldo and me) have found two problems in Magento code, related to slow Place Order with many products in cart (not many qty of a product).

One of the problems is the order item save, which is executed precisely in app/code/core/Mage/Sales/Model/Entity/Order/Attribute/Backend/Parent.php, on afterSave method, who spent many time on my machine (Core 2 Duo 2.26/4GB RAM), about 0.3 second for each product.

Considering the number of items average of customer’s cart is about 50 distinct products, this time, adding to another code executions and a high server load, is easily more than one minute, and this is unacceptable.

The found workaround is disable some observers from Mage_Downloadable and Mage_Rss, who execute in afterSave of each item in order.

In app/code/core/Mage/Downloadable/etc/config.xml, remove/comment the following lines:


The code above appears twice.

In app/code/core/Mage/Rss/etc/config.xml, remove/comment the following lines:


With this workaround, the save time of each product went from 0.3 second to 0.001 second, an incredible speed improvement.

However, if you are using downloadable products or Magento Inventory Management, this modifications can broke related features, so, be careful.

Another problem found is related with module disable feature into System > Configuration > Advanced > Advanced > Disable Module Output. If you disable some module, their observers did not disabled, and you need to remove their configuration or delete module folder.


Tags: php, magento, performance


comments powered by Disqus