PHP/MySQL: T2000 as a heavy SAMP web server

In this first part of our T2000 review, we look at the T2000 as a heavy Apache, MySQL and PHP web server (or SAMP web server). You do not buy a T2000 to offer some basic web services or to serve up some static HTML.

There are two ways that the T2000 could be useful as a web server. The first one is to use Solaris zoning (a.k.a. "Solaris containers") techniques to run a lot of light/medium web servers in parallel virtual zones. As virtualisation is still something that requires quite a bit of expertise, and we didn't have much experience with Solaris Zones, we decided to test the second scenario.

As a side note, the T1 has a built-in support for a hardware called Hypervisor (which is a first for Sparc), which might make virtualisation quite a bit faster. It also makes OS support easier (once your OS can support running inside the Hypervisor, there'd be little porting left to do), except for new features. Basically, the Hypervisor virtualises the chipset, giving a consistent view to the OS. Sun is helping to make sure that Linux and BSD gets ported to the T1.

Back to our web server testing. The second scenario is a heavy web server, which gets a lot of traffic on dynamically generated content that requires quite a bit of number crunching.

We have two real world examples: one using JSP and Sybase, and the other one using PHP/MySQL. In this article, we like to introduce you to the first example.

The PHP test script retrieves hourly-stored weather information out of a MySQL database, which can be overviewed by month. An 'opening page' displays all months that are stored in the database, and if you open a 'detail page', the month you have selected is submitted by query string parameters.

On that new opened page, you see the following information for that month:
  • Overall Minimum, Maximum & Average Temperature for that month
  • Minimum, Maximum & Average Temperature by day and by night, for that month
  • Average temperatures for each day in that month
  • Minimum, Maximum & Average wind speed
  • percentages for the wind direction (for example: for 20% of the time, the wind direction was WEST, 10% SOUTHWEST, etc.)
  • the script execution time
Bert Devriese, who wrote the PHP script, explains how the script behaves:
"When the page is requested, first thing the script does is checking if all $_GET variables, such as 'm' and 'j' are set. If somebody requests the page without these $_GET variables, the script will not continue because it has insufficient parameters to continue.

Next thing that happens is the 'cache-file check'. I haven't used any type of PEAR class, or other frameworks that support caching, to enable caching in the weather-script. I simply check if the cache file exists (the cache file contains the regular HTML output that the browser of the client normally would receive), and if it's not older than one minute. If so, the file will be included, and the php 'exit' command will be executed so that the script thinks that it has 'ended' and the output will be sent to the browser.

If the cachefile does not exist, or if it's older than one minute, the script will simply continue, but the ob_start() function, to start 'output-buffering', will be executed. All regular scripts and several MySQL queries will be executed, and at the end of the file, a new file will be created with fopen($file,'w') (the 'w' makes sure that if the file already exists, it just will be blank and it will seem as if you're writing to a 'new' file. If the file does not exist already, it will be created). When the script ends, the output buffer contents will be retrieved with ob_get_contents(), and all this output will be written to the new cache-file with fwrite(). At the end, ob_end_flush() will flush the output buffer contents to the browser of the client..."

He included a nice diagram for us to make the process clearer.

For benchmarking, httperf was used in conjunction with autobench, a Perl script written by Julian T. J. Midgley, designed to run httperf against a server several times, with the number of requests per second increasing at each iteration. The output from the program enables us to see exactly how well the system being tested performs as the workload is gradually increased until it becomes saturated. In each case, the server was benchmarked with 5 requests per connection.

The Slim T1 CPU The T2000 as a heavy SAMP web server: the results
Comments Locked

26 Comments

View All Comments

  • drw - Friday, March 24, 2006 - link

    Based on the kernel versions listed, I assume that a 32-bit distro was used?

    If so, am curious how a 64-bit distro would compare, as both Apache and MySQL benefit greatly by 64 bit.
  • JohanAnandtech - Friday, March 24, 2006 - link

    Fully 64 bit. uname -a clearly indicates 64 bit
  • defter - Friday, March 24, 2006 - link

    quote:

    At first sight, Sun has won the performance/watt battle for now


    Dual Opteron 275HE had 5% higher power consumpion (198W vs 188W), but it was 5-30% faster (depending wherever or not gzip was used). These results would suggest that dual Opteron has won performance/watt battle in this benchmarks.

    Pricing is also quite important. What's the price for dual Opteron 275HE server with 8GB of memory? About $5000-7000?
  • PeterMobile - Friday, March 24, 2006 - link

    Definitely interesting to see a 3. party review of the T2000. I think it could also be interesting to compare both the Sun machine and the x86 servers to an IBM p5 510Q. That's a 4-way 1.5 GHz Power5+, which including 4 GB RAM and 2 Ultra320 disks lists for $8,536.
  • Calin - Friday, March 24, 2006 - link

    I saw there is almost no loss of performance for compressing data... how about encrypting it?
  • cxl - Friday, March 24, 2006 - link

    quote:


    The very common ADD instruction is executed in one cycle, but it takes no less than 29 cycles to multiply and 104 to divide. Faster mul and division would have taken up much more die space and consumed much more power. Considering that those instructions are very rare in most server workloads, this is a pretty clever trade-off.


    Actually, MOD operation can be very important for servers, as it is basis for any hashing operations, commonly used in many server applications. E.g. to identify variable in a script, interpreters routinely use hashtables.

    114 cycles per MOD operation is performance disaster.
  • Calin - Friday, March 24, 2006 - link

    The performance in the tested configuration was quite good - I wonder how other benchmarks and maybe other "twists" of the benchmark tested would look like.
  • cosmotic - Friday, March 24, 2006 - link

    quote:

    Last, but certainly least, Sun’s solid engineering has impressed us.


    Did you mean certainly NOT least?
  • JohanAnandtech - Friday, March 24, 2006 - link

    definitely ... Fixed. Just checking if you read it carefully :-)
  • cosmotic - Friday, March 24, 2006 - link

    Why no graphs? It makes reading benchmarks SO much easier.

Log in

Don't have an account? Sign up now