One of my sites apps went live unexpectedly at midnight on the blackberry store a few days ago, and downloads went from 20 a day to 400 in one day. This seemed to push things slightly over the edge without me watching, so I had quite a shock when I woke up.
Normally server loads hover between 2 and 4 (I have 4 processors, so anything over 4 means something has to wait for a processor), but by the time I woke up I was on a load of 10 with spikes over 20???.
Anyway, I had to look into optimising my code. I re-wrote a section to cache a number of values, which helped a fair amount, but in doing so I also noticed that there was an empty field where I would have preferred a zero. Empty fields don't bother php, but on the java side on the phone, it kept requesting more data as it didn't understand the blank. That damn zero was creating havoc and I never even knew! Happily load now stays under 1 mostly, so I could even cut my processors in half if I felt like it, or triple the traffic to my sites without needing an upgrade
Here's what clean code can do