Benchmarking Zend Server Community Edition with Drupal

Published Thu, 2009/04/09 - 23:01, Updated Tue, 2009/08/18 - 11:26

Zend have had their own proprietary PHP server product for quite some time now. This week, they announced their Zend Server Community Edition, with the intention to disrupt Java, and grow PHP specially in the current economic conditions.

Since they a) offered DEB packages, b) supported Ubuntu Server, and c) had a zero cost community edition, there was no hesitation on our part to give it a road test and see how it compares to the free/open source alternatives. Zend's Optimizer has been long known to offer really good performance.

So, we decided to benchmark Zend Server Community edition with Drupal 5.x against Apache PHP fcgid with APC, which we have benchmarked recently.

Environment

We used our in house lab servers. They are two physical boxes, each with a Quad core AMD and 4GB of RAM. One server is a web/application server, and the other is database server. They are interconnected

Both servers are configured with 64-bit Ubuntu Server 8.04.2.

For Drupal, we used a copy of a client site that we recently optimized that ran Drupal 5.x.

Installation

Installing Zend Community server was fairly easy, and well documented for DEB on Zend's site.

However, since we got conflicts because PHP was already on the server, we opted to remove PHP manually first via the command:


aptitude remove php5-common php-pear php5-cgi php5-cli php5-dev php5-curl php5-gd php5-ldap php5-mysql php5-sqlite

We then installed Zend using the following command:

aptitude install zend-pe

The installation ran successfully except for the error:

Syntax error on line 18 of /etc/apache2/conf.d/php-fcgid.conf:
can't get fastcgi file info: /usr/bin/php-cgi(/usr/bin/php-cgi), errno: 2

This was leftover from out fcgid install, described in more detail in the aforementioned link. So, we just ran a2dismod and disabled fcgid.
Now starting Apache works fine, with mod_php from Zend enabled inside it.

Benchmark

We used Siege to simulate 10 concurrent users, logged in, and hammering the site as fast as they could for a total duration of 2 minutes.

Results

Apache fcgid PHP with APC
Response time: 0.55 seconds
Requests: 2,167
Requests per second: 18.06

Zend Server Community Edition
Response time: 0.47 seconds
Requests: 2,552
Requests per second: 21.34

Resource utilization was comparable in both cases overall. Memory utilization per php-cgi process was 86M vs. an overall size of 50M per Apache process when Zend is used.

However, since Siege does not request the static files that compose the page (e.g. .css, .js, media files, ...) the impact of these components being requests and the overall server utilization with the default Zend configuration were not assessed in this benchmark, which focused on Zend as mod_php.

Conclusion

Zend Server Community Edition is faster than PHP with APC in fcgid by about 15%. Installation is fairly easy. It is a strong candidate for those who want to run Drupal and are not bothered by running a closed source version.

In the future we would like to explore Zend mod_php vs. Ubuntu's Apache mod_php, and Zend fcgid vs. Ubuntu's fcgid. If you do run those benchmarks, please add a comment below.

funny

funny, so you compared apache-fcgid with apache-mod_php (Zend)?

It can test lighttpd, apache

It can test lighttpd, apache and ngnix with drupal. What is better?

I'd love to see this vs nginx + php-fpm

Latest nginx (0.7.50) + php-fpm.

Sounds like this would be a drop-in replace for php-fpm possibly. (Does it answer using FCGI? or does it require apache+mod_php?)

I haven't looked through it enough but I would hope it can run standalone and be webserver agnostic.

Zend is mod_php

The Zend implementation is Apache mod_php. The secret to its speed is ZendOptimizer+.

They distribute a standalone PHP in the package, but it seems that this is for their GUI application, which is lighttpd based.

The nginx available for Ubuntu Server LTS 8.04.02 is 0.5.33 only, so it means "build from source", and "no updates" from the repository.

yeh, i've been building nginx

yeh, i've been building nginx debs for myself for a long time.

it is horribly outdated in the repos.

i guess it's useless for me then as i steer clear of apache nowadays, and if they created a zend server that listened over fastcgi it would probably lose its edge...

Apache is good with fgcid

I understand the frustration with Apache. However, the criticisms for it are true when PHP is running as an Apache module.

Once you use something like fcgid, performance is still good, but memory utilization goes down significantly.

See our article: Apache PHP fcgid: acceptable performance and better resource utilization for more details and graphs.

Zend Server fastcgi

So how do you plan on testing Zend Server fastcgi when they provide only the client version of the php executable. I cannot understand why they do not provide also the php-cgi with Zend Server.

Also I could be wrong but I checked everywhere for the php-cgi but did not seem to find it.

MySQL does not work

Zend Server comes with a php-fcgi-zend-pe package.

So, I assumed I could use it, judging from package name.

Looking closer today, it contains the executable /usr/local/zend/gui/lighttpd/sbin/php (which is for the GUI).

When I configure fcgid like so:

DefaultInitEnv PHPRC "/usr/local/zend/etc"
FCGIWrapper /usr/local/zend/gui/lighttpd/sbin/php .php

I can get PHP up and running, but there is no MySQLi nor MySQL drivers.

re: MySQL does not work

Hello,

You are correct in your statement the php-fcgi-zend-pe is meant to be used by the ZendServer web UI but you can also use it for your own purposes if you wish.

Regarding the MySQL extensions, no reason why the ones placed /usr/local/zend/lib/php_extensions

If you run:
# /usr/local/zend/gui/lighttpd/sbin/php -c /usr/local/zend/gui/lighttpd/etc/php-fcgi.ini -m|grep mysql

You should get:
mysql
as output.

You should probably prepare your dedicated INI file for your own purposes and not use the UI's one [/usr/local/zend/gui/lighttpd/etc/php-fcgi.ini] but you may use it as a starting point.

You're welcome to drop me a line by mail to jess zend com if you need more help or have questions,

Zend Server non-CE

I recently installed the non-CE version of Zend Server on a customer site, and it adds an additional page caching component over the CE version, which apparently (not measured, though) add a significant boost to non-logged-in page requests.

One thing to mention, too, is that when deploying on Windows XP or 2003, the response times on a default configuration are drastically better than using a default configuration of WAMPserver.

(full disclosure: I don't work for Zend, but am a french distributor of their products)

'Closed Source'

Just for the record, only the 'glue' around the administrative pieces (such as the GUI) with Zend Server CE are closed source. The PHP, Apache, MySQL, etc are all the full open source versions from their respective locations.

Eli's comment is correct but

Eli's comment is correct but I would like to elaborate a little:
Zend patches the PHP sources in the event bugs or security issues are found, these patches are then returned to the PHP community project but it is possible for ZendServer to include them before the stable version from php.net does, depending on the timing. Also, Zend will usually compile its PHP against the latest libraries in the event they are security sensitive, like OpenSSL for example which provides added value.
The full PHP sources as patched by Zend are always available with the product.
The Apache and MySQL [on MAC and Windows] are not patched by Zend but it is possible such patches will be made in the future, if so, they too will be returned to the projects respectfully. When installing the DEB or RPM versions of ZendServer, the product utilizes the distros Apache and MySQL packages and they are not bundled by Zend.
The closed source components of the product are the Zend extensions, such as: Optimizer+ [for op code caching], Data cache, Zend Debugger and Zend Guard loader [the Zend Guard decoding extension].

Hope this helps to clarify some points.

ZendOptimizer+?

What about the most important part: ZendOptimizer+? I don't think it is open source, is it?

Is your Drupal or WordPress site slow?
Is it suffering from server resources shortages?
Is it experiencing outages?
Contact us for Drupal and WordPress Performance Optimization and Tuning Consulting