eZ Publish performance with PHP 5.3.0

The PHP Development team has recently released PHP 5.3.0. Early reports indicate there is a performance boost simply from upgrading from a previous version.

From community feedback it appears that eZ Publish using Windows is about 30% quicker with PHP 5.3.0. I decided to validate these reports and confirm the performance of eZ Publish using PHP 5.3.0 with a linux environment.

A short summary of the tests performed can be found below.

Test environment

I have tested the default homepage for eZ Publish 4.1.3 using the Website Interface 1.4-2 on my development machine.

Hardware

  • CPU: Core 2 Quad 3.5 GHz
  • RAM: 8 GB
  • HDD: SATA 7200 RPM

Software

  • OS: openSUSE 11.1 x64
  • PHP: 5.3.0
  • APC: 3.1.2
  • Apache: 1.3.41
  • MySQL: 5.0.67

Benchmark tool

ApacheBench 2.3

Tests

ApacheBench was run with following parameters:
-n 500
-c 25
As results may differ with each ApacheBench execution, the presented result is an statistical average from 20 test runs.

Results

eZ Publish was able to deliver 185.97 request per second using PHP 5.3.0 with APC enabled. This is around 5% quicker than PHP 5.2.10 with APC enabled, which could handle 176.7 requests per second. eZ Publish with EZP_INI_FILEMTIME_CHECK (check config.php-RECOMMENDED for more details) set to false on PHP 5.3.0 with APC enabled was able to deliver 203.88 requests per second. That gave an additional 9% in performance gain. Similar settings for PHP 5.2.10 gave a 10.22% performance boost.

PHP 5.3.0 PHP 5.3.0 (EZP_INI_FILEMT...) PHP 5.2.10 PHP 5.2.10 (EZP_INI_FILEMT...)
185.97 r/s 203.88 r/s 176.7 r/s 196.83 r/s

With the disabled APC extension, we can see that eZ Publish is about 19% faster with PHP 5.3.0 then with PHP 5.2.10. With EZP_INI_FILEMTIME_CHECK set to false on PHP 5.3.0, eZ Publish performance increases by around 23%.

PHP 5.3.0 PHP 5.3.0 (EZP_INI_FILEMT...) PHP 5.2.10 PHP 5.2.10 (EZP_INI_FILEMT...)
56.2 r/s 59.44 r/s 45.88 r/s 46.91 r/s

Conclusion

PHP 5.3.0 is faster then PHP 5.2.10 without any doubt. With applications such as eZ Publish the performance gain is as much as 20%.

These brief tests demonstrate that a PHP accelerator is essential for eZ Publish. The performance gain in sometimes over 3 times more than without an accelerator. During testing I reached a maximum of 247.7 requests per second with eZ Publish on single machine, which is about 1.8 time more then eZ Publish 3.8 delivered on 4 servers.

Comments

re: Test results

Hi Max,

Please check carefully the hardware spec. First of all this is not core 2 duo CPU, but core 2 quad (4 cores 3.5 GHZ).

Mac OS X is slower then Linux when it comes to the eZ Publish performance, I'm not able to get good results on Mac OS X as well.

Here is a requested result from -n 5000 -c 10

linux-y1s0:/usr/local/apache_php53/htdocs/ezp413 # /usr/sbin/ab2 -n 5000 -c 10 http://localhost/ezp413/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software: Apache/1.3.41
Server Hostname: localhost
Server Port: 80

Document Path: /ezp413/
Document Length: 22651 bytes

Concurrency Level: 10
Time taken for tests: 26.406 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 115410000 bytes
HTML transferred: 113255000 bytes
Requests per second: 189.35 [#/sec] (mean)
Time per request: 52.812 [ms] (mean)
Time per request: 5.281 [ms] (mean, across all concurrent requests)
Transfer rate: 4268.16 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.3 0 13
Processing: 17 52 37.0 43 541
Waiting: 4 35 24.1 31 535
Total: 17 53 37.1 43 546

Percentage of the requests served within a certain time (ms)
50% 43
66% 50
75% 55
80% 60
90% 82
95% 121
98% 174
99% 202
100% 546 (longest request)

and the one from -n 5000 -c 25

linux-y1s0:/usr/local/apache_php53/htdocs/ezp413 # /usr/sbin/ab2 -n 5000 -c 25 http://localhost/ezp413/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking localhost (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software: Apache/1.3.41
Server Hostname: localhost
Server Port: 80

Document Path: /ezp413/
Document Length: 22651 bytes

Concurrency Level: 25
Time taken for tests: 25.064 seconds
Complete requests: 5000
Failed requests: 0
Write errors: 0
Keep-Alive requests: 0
Total transferred: 115410000 bytes
HTML transferred: 113255000 bytes
Requests per second: 199.49 [#/sec] (mean)
Time per request: 125.320 [ms] (mean)
Time per request: 5.013 [ms] (mean, across all concurrent requests)
Transfer rate: 4496.68 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 3.2 0 47
Processing: 31 124 60.9 106 577
Waiting: 15 104 50.7 94 571
Total: 35 125 60.9 106 581

Percentage of the requests served within a certain time (ms)
50% 106
66% 122
75% 140
80% 154
90% 196
95% 240
98% 300
99% 375
100% 581 (longest request)

Those results are with EZP_INI_FILEMTIME_CHECK to true. So I bet that result will be above 200 r/s with EZP_INI_FILEMTIME_CHECK set to false.

Test results

Hi Lukasz,
as they said above, about the number of requests, to be honest I can't believe you could get 203 requests per seconds on a core 2 duo, unless 80% of those are timing out.
I can't manage to achieve such a performance even on a mac pro with 8 cores (unless I use Varnish or other static caches).

It'd be great to see a realistic test run, if you have time, with e.g. -n 5000 -c 5 or 10.

Btw, I have a comparison I did time ago between ezpublish running on the open source lamp stack and zend platform, which improves timings big time as well. I can send it to you if you're interested.
Max

Increase number of requests

Hi,

this a nice benchmark, I was thinking to make one like that. But I think can have more representative results by increasing the number of requests because with 500 requests and about 200 req/s, your test lasts less than 3 seconds so you can't see if the server is overloaded.

Cheers

Does mysqlnd make any difference

Are you using MySQL and does mysqlnd make any difference? We've been looking very long for beta and performance testers but nobody was brave enough to test mysqlnd before PHP called it GA (regardless if the code has significantly changed or not since months).

I'd expect no major difference.

Ulf

Appreciation?

My Amazon.com Wish List

eZ publish™ copyright © 1999-2010 eZ systems as