Magento Efficiency Optimization – Deployment and Beyond

Wed, Dec 26, 2012 at 11:44 AM By: magento2themes

A lot more frequently than we thought we’re receiving inquiries from customers regarding a Magento deployment that is not performing to the degree they predicted. In this business the responsiveness of a client’s web site is extremely crucial. If the browsing encounter is awful possible customers are heading to move on to a competitor.The single most efficient configuration item for improving the performance of Magento is cash – Essential Web hostingThird party magicMagento Optimization Service: Magento Speed UpIf the web site is intolerably gradual possible buyers will go back to the Google and choose the up coming seller in the listing for the product they are looking for. Generally, clientele with the most difficult of these efficiency concerns clients stop up getting in touch with the group Hybrid Forge for an evaluation and a resolution. Because the Magento eCommerce system is based on the MVC brilliance of the Zend Framework we know that its extremely versatile and powerful. However, with great energy arrives fantastic duties. In the rush to re-platform an existing eCommerce bundle this kind of as ZenCart, osCommerce, AspDotNetStoreFront, and so on to Magento we’ve observed some completely tragic hacks of this framework.Some of the much more disconcerting illustrations are modified documents in the /app/code/main (damaged upgrade), completely copied default design and style directories with only a single or two modified files and modifications pinned to certain database version (pre-one.2.1). Let us get this straight – the studying curve is steep and perilous and you are going to get what you spend for if you pick a company with little verifiable encounter. Although assessing and solving these challenges is great for our enterprise I feel we all concur the world be would be a much better location if we could avoid Magento missteps in the first spot. The perform isn’t carried out when the software is introduced possibly. There are a amount of logging tables that will expand unchecked significantly less you carry out normal servicing on the database. The latest offender we encountered in a current audit is the “report_event” table. This certain Magento deployment experienced been working for a couple of months and collected nicely over a 150,000 data in the “report_event” table. By truncating this table we instantly realized a five hundred% enhancement in php webpage execution time. Permit me say that once again, by truncating this solitary table we decreased page load time by 5X!The recent Magento Business Whitepaper contains some extremely beneficial configuration insight. If you have not read it but obtain the Magento Business Version Whitepaper on Strategies and Very best Practices for High Overall performance eCommerce today.The processes Hybrid Forge has created for deploying, preserving and analyzing Magento installations is constantly evolving because Hybrid Forge subscribes to a philosophy of steady advancement. Nevertheless, there many typical elements to each and each and every deployment and this submit serves as a abridged manual to some of the key technical elements gathered from both private encounter as effectively as fellow Magento authorities.Abridged Magento Linux Installation and OptimizationWe are inclined to deploy Magento on Centos five.three running Apache 2.two.x, PHP 5.two.x and Mysql five.x. One of the first tips is that PHP 5.2 is not obtainable in the standard yum repositories. In purchase to install PHP 5.two you will need to get and put in the remi repositories via rpm wget http://download.fedora.redhat.com/pub/epel/5/i386/ epel-release-5-3.noarch.rpm wget http://rpms.famillecollet.com/el5.i386/ remi-release-5-7.el5.remi.noarch.rpm rpm -Uvh remi-release-5*.rpm epel-release-5*.rpmNow obtain PHP 5.two – really don't get tempted by the 5.3.x release of PHP. Magento, as of this submit is not compatible with PHP 5.three so save your self the suffering of rolling back again the PHP edition and just say no (for now). yum –enablerepo=remi install php-common-5.2.10-1.el5.remi yum —enablerepo=remi install php-5.2.10-1.el5.remi yum install gd gd-devel yum –enablerepo=remi install php-mcrypt-5.2.10-1.el5.remi php-xml-5.2.10-1.el5.remi php-devel-5.2.10-1.el5.remi php-imap-5.2.10-1.el5.remi php-soap-5.2.10-1.el5.remi php-mbstring-5.2.10-1.el5.remi php-mysql-5.2.10-1.el5.remi yum –enablerepo=remi install php-mhash-5.2.10-1.el5.remi php-gd-5.2.10-1.el5.remiPut in APC (Alternative PHP Cache) yum –enablerepo=remi install php-pear php-devel-5.2.10-1.el5.remi httpd-devel pear install pecl/apc echo extension=apc.so > /etc/php.d/apc.iniNow open up the /and so on/php.d/apc.ini and contemplate incorporating the adhering to: apc.enabled = 1 apc.shm_size = 128 apc.include_once_override = 1 apc.mmap_file_mask = /tmp/apc.XXXXXX1 a lot more setting to think about and which is: apc.stat = 0If stat is disabled APC will NOT verify for up to date versions of PHP information instantly. Apache must be restarted to examine for PHP file changes. It is useful in production servers in which PHP code is not modified regularly and offers an improve in overall performance.Apache ConfigurationThe Mozilla Firefox Firebug Net tab and the incorporate-on Y-Slow will expose if apache is configured to each compress files and send expiry particulars to visiting browsers.Enable Apache Content material ExpirationTrack down your httpd.conf and adding the subsequent section. Truly feel totally free to modify the expiration lengths if which is not steady with your front-end update technique. Pay particular focus to the .css file expiration. ExpiresActive on ExpiresByType image/gif “access plus 1 month” ExpiresByType image/jpeg “access plus 1 month” ExpiresByType image/jpg “access plus 1 month” ExpiresByType image/png “access plus 1 month” ExpiresByType text/plain “access plus 15 day” ExpiresByType text/html “access plus 1 second” ExpiresByType text/css “access plus 1 day” ExpiresByType text/javascript “access plus 1 day” ExpiresByType application/x-shockwave-flash “access plus 1 day” ExpiresByType application/x-httpd-php “access plus 1 second” Enable Apache Output Compression AddOutputFilterByType DEFLATE text/html AddOutputFilterByType DEFLATE text/plain SetOutputFilter DEFLATE Following changes are produced to the apache configuration you will of training course require to restart the apache daemon.MySQL ConfigurationWide open the /and so forth/my.cnf file and evaluation the cache configurations for MySQL. In a well spec’d server internet hosting a solution catalog of up to ten,000 items these settings are a good principle of thumb. Magento makes use of Innodb kind tables so the dimensions of the innodb_buffer_swimming pool_size is very correlated to enhanced overall performance. query_cache_type = 1 query_cache_size = 64M innodb_buffer_pool_size = 256M thread_cache_size = 16 table_cache = 512 key_buffer = 32M.htaccessAlongside with the normal Magento rewrite situations avoid duplicate content material issues by redirecting non-www requests to the www.mydomain.com. RewriteCond %HTTP_HOST ^mydomain.com [NC] RewriteRule ^(.*)$ http://www.mydomain.com/$1 [L,R=301]File permissionsReset your file permissions by running the subsequent instructions in the root of the Magento set up: find . -type f -exec chmod 644 {} \; find . -type d -exec chmod 755 {} \; chmod o+w var var/.htaccess includes includes/config.php app/etc chmod 550 pear chmod -R o+w mediaIn purchase run Magento Connect you may want to Briefly loosen file permissions by executing these instructions in the root of the Magento set up: find . -type d -exec chmod 777 {} \; find . -type f -exec chmod 644 {} \;

  1. No one has commented yet.

Post a comment