A Siege On Benchmarks

My regular readers (and perhaps the irregular ones as well ūüėČ know that I have been obsessed with baseline-responsiveness benchmarking of frameworks for years now. ¬†The idea has always been that, in order to know how far you can optimize your framework-based applications, you need to know the limits imposed by the framework itself. ¬†Only then can you have an idea of where to spend your limited resources on improvement. ¬†For example, if you need 200 dynamic requests/second, but the framework itself (with no application code in use) is capable only of 100, then you know that no amount of application or database optimization will help you — it’s time to start scaling, either horizontally or vertically.

To perform these benchmarks, I have only employed the ab tool provided by the Apache web server. ¬†It was easy to use, and relatively easy to parse the output to automate reporting. ¬†However, it turns out that ab over-reports responsiveness of Apache when serving static HTML files, and when serving minimal PHP scripts such as <?php echo "hello world"; ?>. ¬†I discovered this just recently when attempting to find out why PHP appeared to be faster than HTML, and then only with the assistance of Paul Reinheimer, whom I now owe a bottle of vodka for his trouble. ¬†ūüėČ

It turns out that the siege tool from JoeDog Software is more accurate in reporting static HTML and PHP responsiveness.  This is confirmed through Paul Reinheimer as well, who reported the expected responsiveness on other systems.

The over-reporting from ab means that all my previous reporting on benchmarks is skewed too low when comparing framework responsiveness to PHP’s maximum responsiveness. ¬†As such, I have re-run all the previously published benchmarks using siege instead of ab. ¬†Previous runs with ab are here …

… and below are the updated siege versions. ¬†As with previous attempts, these benchmarks are performed on an Amazon EC2 “small” instance. ¬†There is one difference to note: previous runs used Xcache for bytecode caching, but these use APC; I don’t suspect this change in caching engines has a significant effect, but I have not tested that assertion.

framework rel avg
baseline-html 1.1878 985.69
baseline-php 1.0000 829.82
cake-1.1.10 0.0938 77.84
cake-1.1.11 0.1277 105.96
cake-1.1.12 0.1288 106.84
cake-1.1.16 0.1166 96.77
cake-1.1.17 0.1165 96.70
cake-1.1.19 0.1298 107.69
cake-1.2.0-rc2 0.0516 42.79
solar-0.25.0 0.1852 153.66
solar-0.26.0 0.1789 148.43
solar-0.27.0 0.1734 143.93
solar-0.28.0 0.1671 138.64
solar-1.0.0alpha1 0.1706 141.58
symfony-0.6.3 0.0629 52.22
symfony-1.0.0beta2 0.0758 62.91
symfony-1.0.6 0.0746 61.91
symfony-1.0.6-dw 0.0820 68.03
symfony-1.0.6-fp 0.0853 70.78
symfony-1.0.17 0.0744 61.73
symfony-1.1.0 0.0745 61.84
zend-0.2.0 0.2176 180.56
zend-0.6.0 0.1998 165.78
zend-1.0.0 0.1268 105.25
zend-1.0.1 0.1263 104.80
zend-1.5.2 0.0951 78.93

Note the baseline-html and baseline-php numbers.  Using ab previously, these were reported as 2100-2400 requests/second and 1100-1400 requests/second, respectively.  The siege tool reports a much lower number for both, but the dropoff between static HTML and dynamic PHP is much smaller; with ab it looked like about 40-50%, but now with siege it looks like only about 15-18%.  This behavior is much more like what we would expect from a memory-based PHP script.

Note also the separate framework requests/second; they are very similar between ab and siege.  This means that the framework responsiveness numbers are almost unchanged.

Because the nearly-identical framework numbers are compared to a much smaller baseline PHP number, the frameworks now appear to be doing much better in relation to PHP’s maximum responsiveness. ¬†For example, Solar-1.0.0alpha1 with ab appeared to run at about 11% of PHP’s max, but with siege it looks close to 17%. ¬†All of the frameworks tested see this kind of comparative gain in their reporting.

However, when compared to each other, the framework rankings are the same as before:  Solar has the highest baseline responsiveness, followed by Cake and Zend (their respective releases are very close to each other in responsiveness), and Symfony trails with the lowest baseline responsiveness.

In summary, using ab skewed the “percentage of PHP” comparisons because it over-reported PHP’s maximum responsiveness, but the framework requests/second numbers and the framework comparative rankings are unchanged from previous reporting. ¬†The Google project for the benchmarking system has been updated to use siege, so all future reporting will reflect its results, not those of ab.