Sun Java System Web Server 7.0 Update 7 Performance Tuning, Sizing, and Scaling Guide

PHP Scalability Tests

PHP is a widely-used scripting language uniquely suited to creating dynamic, Web-based content. It is the most rapidly expanding scripting language in use on the Internet due to its simplicity, accessibility, wide number of available modules, and large number of easily available applications.

The scalability of Web Server combined with the versatility of the PHP engine provides a high-performing and versatile web deployment platform for dynamic content. These tests used PHP version 5.1.6.

The tests were performed in two modes:

The test executed the phpinfo() query. The goal was to saturate the cores on the server and find out the respective throughput and response time.

PHP Scalability with Fast CGI

The following table shows the Web Server tuning settings used for the FastCGI plug-in test

Table 6–12 Tuning Settings for FastCGI Plug-in Test

Configuration 

Tuning 

magnus.conf

Init fn="load-modules" shlib="path_to_web_server_plugin_dir/fastcgi/libfastcgi.so" funcs="responder_fastcgi" shlib_flags="(global|now)"

obj.conf

NameTrans fn="assign-name" from="/fcgi/*" name="fcgi.config"
<Object name="fcgi.config">
Service type="magnus-internal/ws-php" fn="responder-fastcgi"
app-path="path_to_php"
bind-path="localhost:9000"
app-env="PHP_FCGI_CHILDREN=128"
app-env="PHP_FCGI_MAX_REQUESTS=20000"
app-env="LD_LIBRARY_PATH=path_to_php_lib"
listen-queue=8192
req-retry=2
reuse-connection=1
connection-timeout=120
resp-timeout=60
restart-interval=0
</Object>

mime.types

type=magnus-internal/ws-php exts=php,php3,php4

The following table shows the results of the PHP with FastCGI test.

Table 6–13 PHP Scalability with Fast CGI

Number of Cores 

Average Throughput (ops/sec) 

Average Response Time (ms) 

876 

114 

1706 

117 

2475 

121 

The following is a graphical representation of PHP scalability with Fast CGI.

PHP Scalability with Fast CGI- Number of cores

PHP Scalability with NSAPI

The following table shows the Web Server tuning settings for the PHP with NSAPI test.

Table 6–14 NSAPI Plug-in Configuration for PHP

magnus.conf

Init fn="load-modules" shlib="libphp5.so" funcs="php5_init,php5_close,php5_execute"

Init fn="php5_init" errorString="PHP Totally Blew Up!"

obj.conf

NameTrans fn="pfx2dir" from="/php-nsapi" dir="path_to_php_script_dir" name="php-nsapi" <Object name="php-nsapi"> ObjectType fn="force-type" type="magnus-internal/x-httpd-php" Service fn=php5_execute </Object>

mime.types

type=magnus-internal/ws-php exts=php,php3,php4

The following table shows the results of the PHP with NSAPI test.

Table 6–15 PHP Scalability with NSAPI

Number of Cores 

Average Throughput (ops/sec) 

Average Response Time (ms) 

950 

105 

1846 

108 

2600 

115 

The following is a graphical representation of PHP scalability with NSAPI.

PHP Scalability with NSAPI- Number of cores