<update>Magento 1 now supports PHP 5.4</update>
I woke up this morning with a burning desire to do load tests. Actually, I woke up with a burning desire to not do the same thing I did yesterday and needed a slight change, so I decided to do a load test. I wanted to see what the performance difference for Magento was between PHP versions 5.3, 5.4 and 5.5RC3.
As you may know, Magento only supports 5.3 and 5.2. Personally, I would not even be thinking about running any kind of remotely serious ECommerce site on PHP 5.2. But with work on PHP 5.5 pushing towards GA it means that some time soon support for 5.3 willing be going away. This might be a bit of a problem for software that isn’t supported on 5.4+. One of the reasons for this is that there are bugs in PHP that are holding back support. I don’t know what they all are but this one regarding XML processing is one. There might be others, but that’s one that I know of.
But enough about bugs, what about performance. For PHP 5.3 and 5.4 I used Zend Server with Optimizer+. This is partially because I use Zend Server on my local machine and also because it would give a good comparison with PHP 5.5 since Optimizer+ has been open sourced and will be included.
The configure settings I used for PHP 5.5 is this
./configure --with-config-file-path=/etc/php-5.5 --with-config-file-scan-dir=/etc/php-5.5/php.d --disable-debug --enable-inline-optimization --disable-all --enable-libxml --enable-session --enable-xml --enable-hash --with-pear --with-layout=GNU --enable-filter --with-pcre-regex --with-zlib --enable-simplexml --enable-dom --with-openssl --enable-pdo --with-pdo-sqlite --with-readline --with-iconv --with-sqlite3 --disable-phar --enable-xmlwriter --enable-xmlreader --enable-mysqlnd --enable-json --with-gd --enable-soap --with-curl --with-apxs2 --enable-ctype --with-pdo-mysql --prefix=/opt/php-5.5 --enable-opcache
My 5.5 opcode cache settings were this
zend_extension=opcache.so opcache.memory_consumption=128 opcache.interned_strings_buffer=8 opcache.max_accelerated_files=4000 opcache.revalidate_freq=60 opcache.fast_shutdown=1 opcache.enable_cli=1
I make no guarantees that these are the optimal settings.
I used Siege as the load test running against a single URL that had some relatively complex logic in it. I was using Magento Enterprise 1.13, but had full page caching turned off. I ran with only 4 concurrent sessions since that’s how many CPU’s are on the machine I was testing. This was not a test of server capacity, but of raw performance. I suppose that a single concurrent session would have been better, but se la vis. I didn’t see a drop in response time until I went to 5 concurrent sessions anyway so I doubt this was an issue.
The first chart is the throughput per second, so higher is better.
As you can see, PHP 5.4 and 5.5 faired better than 5.3. 5.5 faired just a little better than 5.4.
This next chart shows the slowest, fastest and average times for each. Lower is better.
The slowest time is not really all that interesting since every load test will have a few hickups. I suspect that if I took the 95th percentile that it would look pretty close to the average. But overall 5.4 and 5.5RC3 did better in all the data points that matter.
Now to get those bugs fixed so Magento can support those two…