Cal's Blog
![]() |
Cal Evans Director of PCE |
| Cal Evans is the Director of the PHP Center for Expertise at Ibuildings. He has been involved in IT development and management for the past 26 years and for the past 9 has developed primarily in PHP and MySQL. Cal is the author of a book and many articles on PHP development and can regularly be seen speaking at PHP conferences around the world. Cal blogs regularly at http://blog.calevans.com |
Monday, August 31. 2009The Problem With BenchmarksTrackbacks
WinCache, Apache and a pretty graph!
I really wanted to focus this post on WinCache, rather than OpCode Cachers in general – but it turned into a general post with a star contender. From the Windows Cache extension for PHP website as Microsoft.com: Windows Cache Extension for PHP is...
Weblog: Technologist For Hire
Tracked: Feb 09, 20:24 Comments
Display comments as
(Linear | Threaded)
Hear, hear! and nicely written.
This has been a point I've been trying to make for a while as well. Why you can load stress your application, it really only helps to provide you information on where the bottlenecks are within your own application -- information useful for diagnosing where to spend time and effort, but not necessarily information for basing a decision regarding the selection of an application or its technology stack. For those, many other factors come into play -- the expertise of your team, the hardware you already have, etc.
I am about to start developing a small application for a global client to coincide with a release of one of their products and allows users to register the product and their details (which communicates with the companies CRM system using SOAP) and has some other db intensive operations, in a multi-step form/wizard approach.
The client has mentioned that the number of visitors could be upwards of 100k per day. Do you have any suggestions for how to go about bench marking or load testing the application to see whether it will be able to cope?
Clients never seem to be able to give the right information, so you need to gage this for yourself. Relying on 3rd party software should never be a direct dependency, as such I'd queue requests to the SOAP service (If feasible with the client).
As for database intensive operations, simply profile and optimize. Index appropriately, or break the queries apart. You would be surprised what constitutes a well optimized query. Load Testing: 1. Ensure your hosting provider can handle the traffic. (different data centers) 2. Tools (too many to list), iostat, vmstat, top, ps, iotop, tcpdump/maakit, etc... 3. Five tips for load test planning 4. [url=http://agiletesting.blogspot.com/2005/02/performance-vs-load-vs-stress testing.html] Performance vs load vs stress testing [/url]
Interesting post Cal. As I was reading I anticipated you to honing in on a specific example that's been on my mind lately. A post I've got in the hopper picks on Rasmus' "Hello World" benchmark. It continues to be a popular one amongst frameworks but I believe it's lost a lot of meaning since he first introduced it. Frameworks like Doo that have come out since the benchmark was introduced go to great lengths to absolutely kill on "Hello World" achieving an order of magnitude more "performance" over more established frameworks like ZF. A message I wrote to a mailing list explores the problems with this in more depth. The point and the problem with the Hello World benchmark is that it traces a single path that is supposed to represent a baseline.
When Rasmus introduced "Hello World" he set out to compare a group of world-class cyclists by having them compete in a 100 meter dash. It was interesting, then, because none of the cyclists trained for the 100 meter dash. The result was a generic measure of framework athleticism. Since the hello world 100 meter dash has grown in popularity new sprinters have joined the mix and, not surprisingly, they dominate the cyclists. Unfortunately there is no "Tour de France" PHP benchmark to give the 100 meter dash results any perspective (and, arguably as you point out in your post, the more systems behind a benchmark the less meaningful a benchmark becomes). At the end of the day the performance of real world applications tend look more varied like a Tour with a large number of routes, trips to the database, complex application logic, non-trivial views, etc, than they do short, repetitive sprints to break the 100m "Hello World" finish line. The PHP community would benefit from the perspective a Tour de France of benchmarks, or at least some measurement that pits the Usain Bolts, like Doo, on racing bikes against the likes of the Lance Armstrongs, like CodeIgniter. (Full disclosure: I am a contributor to the Recess PHP Framework)
Cal is perfectly correct, many factors account for the performance of any application. There are many forms of benchmarking and scenarios that can be tested such as profiling, stress, soak testing etc. Performance is also not the same as capacity, and the total throughput of any application.
Bottlenecks can/will occur due to misconfiguration, poor code, and may only arise due to unexpected spikes, usage or through time/changing trends. As a quick example with disk IO. Filesystem choices such as ext3, xfs, reiser offer differing limits, flexibility and performance. Filesystem configuration options, raid etc, all have varying implications that affect the performance of any application. None of which are application specific. Benchmarks will only highlight a very small part within your application, and will ultimately come down to capacity planning, ensuring that the application will be capable of delivering to your/clients needs. What benchmarks wont tell you are usage and trends, particular sections of the site that burden or negatively affect the overall performance. This can be very difficult to gage because you cannot test aspects of your application in isolation easily. Each component will have a differing affect on the overall infrastructure/application. |
Blog









