Posts Tagged ‘performance’

Improving the Performance of a Local Magento Install

Magento is great, but it needs a good amount of hardware behind it.  Developing locally can get slow and cumbersome unless your environment is tweaked properly.  Here are a few tips for boosting Magento performance without impacting the rest of your development environment.  Please keep in mind that the memory allocations work well for my machine (dual core, 4 gigs of ram).

Database
Install innoDB.  Magento can use the in-memory buffer pool to cache table indexes and data.

Configure my.ini:
innodb_buffer_pool_size  = 64M
innodb_thread_concurrency = 4 (or 8 if you have dual core)
query_cache_size = 64M
query_cache_limit  = 2M

apache
enable mod_expires in httpd.conf

php
in php.ini enable:
realpath_cache_size = 16k
realpath_cache_ttl = 120

Install the eAccelerator binaries for php.  APC is a better solution but is less compatible with windows.  If you need to compile these, click here for instructions. Then configure it:
extension=eaccelerator.dll
eaccelerator.shm_size=64
eaccelerator.cache_dir=C:\PHP\tmp
eaccelerator.enable=1
eaccelerator.optimizer=1
eaccelerator.check_mtime=1
eaccelerator.shm_max=0

Install memcached.
add the following lines inside the config of epp/etc/local.xml
<cache>
    <backend>memcached</backend>
    <memcached>
        <servers>
            <server>
                <host><![CDATA[localhost]]></host>
                <port><![CDATA[11211]]></port>
                <persistent><![CDATA[1]]></persistent>
            </server>
        </servers>
        <compression><![CDATA[0]]></compression>
        <cache_dir><![CDATA[]]></cache_dir>
        <hashed_directory_level><![CDATA[]]></hashed_directory_level>
        <hashed_directory_umask><![CDATA[]]></hashed_directory_umask>
        <file_name_prefix><![CDATA[]]></file_name_prefix>
    </memcached>
</cache>

Admin Backend

  • Keep the indexes up to date (System > index management)
  • Compile Mage classes (System > tools > Complilation)
  • Enable all cachine (System > Cache Management)
Technology

Optimizing for speed

Interesting point from Scott Porad on optimizing page load times. Hint: it’s not about the images; it’s about the http calls.

In other words, the frequency of visits as a factor in reducing empty cache visits is counteracted by the frequency that a site’s content is updated. Of course, this makes sense because unless a site updates it’s content frequently users don’t have a reason to return frequently.

The bottom line: reducing HTTP requests continues to be most important for improving site performance.

Scott found a research report that notes 20% of users have no cache, making local caching a moot point. (I know this first-hand; on my creaky old Windows box at Clarins, I set my own cache to zero, because it minimized the internal RAM and hard drive needs and sped up page rendering.) More important, especially in this era of Ajax, is to minimize server requests, which create the bottlenecks.

Considering Google’s new inclusion of site speed in PageRank this is going to be a key performance metric in 2010, and one to monitor regularly.

Technology