Wednesday, 24 July 2013

Improving Magento performance by disabling logs

Magento need highly resource tuned system to work perfectly.
Whenever a magento site is live and as the traffic increaeses so it increase the various log db tables.
Also each actives follows a queries to the db which need heavy resources.
Following are the events for which magento generates logs :
controller_action_predispatch
controller_action_postdispatch
customer_login
customer_logout
sales_quote_save_after
checkout_quote_destroy
Steps to disabled these logs:
Step 1) Open file ~/app/etc/local.xml
Step 2) find the tag events
Step 3) Paste the below code that will disable logging.
<events> 
        <controller_action_predispatch> 
            <observers><log><type>disabled</type></log></observers> 
        </controller_action_predispatch> 
        <controller_action_postdispatch> 
            <observers><log><type>disabled</type></log></observers> 
        </controller_action_postdispatch> 
        <customer_login> 
            <observers><log><type>disabled</type></log></observers> 
        </customer_login> 
        <customer_logout> 
            <observers><log><type>disabled</type></log></observers> 
        </customer_logout> 
        <sales_quote_save_after> 
            <observers><log><type>disabled</type></log></observers> 
        </sales_quote_save_after> 
        <checkout_quote_destroy> 
            <observers><log><type>disabled</type></log></observers> 
        </checkout_quote_destroy> 
    </events>
Step 4) : Refresh all magento cache from admin System -> Cache Management or delete cache folder under the var from ftp
Enjoy–

No comments :

Post a Comment