// 15.Nov.2009

Shopping for Nurses

I’d like to show off the latest website in my portfolio, nursesstore.co.uk. I was hired by Step Online to do the coding and build of this store “for the healthcare professional” and I’m pretty pleased with how it’s turned out. This is the first ecommerce site I’ve done for quite a while and I had to come out of my WordPress comfort zone to meet the specifications required.

The PSDs I received from the designers featured lots of rounded corners, subtle gradient-transparencies and drop-shadows — all of which, I knew, were going to cause me some implementation headaches with the Internet Explorer family.

In the end I think I did a fairly decent cross-browser adaptation — even with IE6 — but I had to kick IE around a bit in order to get it to behave.

My task here was made considerably easier when I discovered CoRD, “a Mac OS X remote desktop client for Microsoft Windows computers using the RDP protocol.” With CoRD I was able to connect to a remote Windows XP box, on which I had installed IE versions 6 through 8, and access it in a window on my OS X desktop. Perfect for testing the site under each version of IE right the way through the development phase.


Viewing the website with IE6 running on Windows XP, displayed in a window on my Mac OS X desktop via CoRD

Now I know that in this day and age, and with all the virtualisation software that’s available for Intel-based Macs, seeing Windows on an OS X desktop is nothing knew. But this isn’t virtualisation, there’s no version of Windows installed on my Mac because my PowerPC-based machine doesn’t support it. What we’re doing here with CoRD is interacting with an entirely separate computer, in another room. Yet we can operate it as if we were sat in front of it. It impresses the heck out of me! Oh, and before someone directs me towards Microsoft’s RDC software, I’ll tell you now that CoRD’s installed footprint is a mere 2.9MB compared with 17.3MB for Microsoft’s Remote Desktop Connection Client for Mac 2. You do the math! CoRD is fast too, and stable. What’s not to like?

Zend Server, PHP & MySQL: A Fast Web Application Stack

One thing that was new for me on this project was the Zend Server platform that it’s built upon. I’d heard that Zend PHP bytecode caching resulted in decent performance but I didn’t expect it to be anything like as fast as it is.

Browsing through the nursesstore.co.uk website and working in its back-office has opened my eyes to what can be achieved with a decent PHP stack. I’ve never seen PHP run this fast. I’m reminded of my extensive mod_perl work from a few years ago - the performance is that good!

Profiling the nursesstore.co.uk home-page with Safari supports this claim:

That’s with an empty cache too. Safari reports consistent delivery times of around the 1 second mark for every page on the site.

With my curiosity fully aroused (stop snickering) I ran the ab benchmarking program against the site a few times. Here’s a representative report from ab:

Concurrency Level:      10
Time taken for tests:   63.110 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      16123114 bytes
HTML transferred:       15835253 bytes
Requests per second:    15.85 [#/sec] (mean)
Time per request:       631.097 [ms] (mean)
Time per request:       63.110 [ms] (mean, across all concurrent requests)
Transfer rate:          249.49 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       33   47  12.5     44     112
Processing:   251  581 385.5    486    6136
Waiting:      113  308 249.7    247    4597
Total:        299  628 385.2    534    6185
Percentage of the requests served within a certain time (ms)
50%    534
66%    622
75%    686
80%    745
90%    918
95%   1161
98%   1630
99%   2137
100%  6185 (longest request)

Running 1000 requests with a concurrency level of 10, ab tells us that 95% of requests are serviced at around the 1 second mark. 50% of requests are serviced in just half a second!

ab also showed me that nursesstore.co.uk is capable of servicing between 15-20 requests per second… and the crowd gasps in awe and wonderment.

All this performance from a website running on a bog-standard shared server, from a commodity hosting provider. I think that’s pretty impressive. What do you think?

Last Revision: November 22nd, 2009 at 01:55


2 Comments for “Shopping for Nurses”

  1. Very nice job mate. I love doing the backend coding for websites but I’m absolutely hopeless at making things look pretty. Probably because my graphic design skills are non-existent. I can’t draw a straight line with a ruler.

    We’re a mod_perl shop here and I can attest to how blazingly fast it can be. ab is a fantastic benchmarking tool isn’t it?

  2. Same here Kevin - no design skills whatsoever. I’m a development guy rather than a designer.

    I absolutely love mod_perl. I still don’t think anything comes close when you need high-performance from a web application. I used to build everything in mod_perl myself (although, when really pushed, we used to build performance-critical parts of our web apps in C), but the growth and adoption of PHP has forced me to cross-over - not out of choice - simply because this is where I seem to be getting all my work. Working with the Zend framework has piqued my curiousity though. I’ll certainly be doing some more work on top of the Zend stack.

    I agree that ab is an outstanding benchmarking tool. Flashy GUIs, wizzy graphs and masses of features are all well and good - but, let’s be honest, it’s the data we’re interested in. We don’t need it to be pretty, we just need it to be accurate. ab fits the bill perfectly. I use it for all my benchmarking.