Magento is a great piece of software, but people often complain about it’s performance. Speeding up Magento is therefor one of our favourite challenges. We did some tests to determine how we can improve our configuration to speed up the Magento installations hosted on our servers.
Speeding up Magento tests
We took a basic Magento install (v1.1.2) with sample data using this script from the Magento wiki. We then tested the opening time of the front page against different server configurations. Every configuration was opened 300 times with a GET command and the wall clock time was logged. The tests were done during the working day thus with considerable load on our webcluster.
We used four different hardware setups:
- byte cluster: our shared cluster as available for the customers
- web13: a server removed from the cluster (called web13), so same hardware but no interfering traffic
- localdisk:the same web13 server but the site was installed in /var/www, thus on a server’s local disk
- localnfs: web13 but on a local NFS mount (/var/www-local exported and mounted as /var/www to test NFS impact without network latency
Other configuration options were:
- mod php/cgi – the site was run as mod_php or as a standalone CGI script
- php opcode caching / nocaching – we tested APC and XCache
- the use of NFS has great impact on performance when using mod php
- Magento run with mod_php over NFS is very slow.
- opcode caching gives visible performance gains for mod_php installations on a local disk
- opcode caching does not help with CGI (which is logical – the code is cached every time the script is run)
- Why is mod php so slow when served from NFS? It must be some locking issue, but is it due to Magento using
flockor is it rather a Apache/mod_php + NFS issue?