Steve's blog

A blog about what's going on in Analysis UK... New Feature and Performance Issues


This Friday (17 Sept 2010) (as well as the network of other forex websites), and (because it's on the same server) suffered a degradation of performance, this was due to me rolling out a new feature which included a nice little bug. Sorry to those of you effected by this.

As it turns out when you use JQuery's .fadeOut using css class selector the fade completed function gets called for each element that implements the css class. Well Dollars2Pounds has three of them, so the fade completed function got called three times. This caused a bit of a problem because I had it so that when the fade out was complete it would get the latest exchange rate from the server and fade that in. Net result, three rapid fire hits to the server for every browser that had Dollars2Pound open, and that was quite a few, so I inadvertently launched a distributed denial of service attack on myself!

Fortunately I was able to pick this up quickly as I run continuous monitors for site performance and page content under a local CCNET box (in addition to the basic SiteUpTime monitor which messages be if the site goes down hard).

The performance monitor is fairly relaxed allowing about a 5 second time-out for the page to load, but on Friday that went red. When I connected to the server it was running at 100% CPU and at the end of the day the log file was nearly ten times it's normal size, which was caused during the few hours it took to spot and fix the problem.

The good news is that this is now fixed and that Dollars2Pound updates the exchange rate it shows every minute (other sites are less frequent as I only fetch the exchange rate less frequently).

I've also become a big fan of Clicky recently, one thing I find fascinating is how repetitive the traffic to Dollars2Pound is. Here's a typical chart showing the same weekday one week previous, I'm amazed how similar the pattern is.

On the other hand, here's Friday's chart and the one for the previous Friday, you can see the effect that the performance issues caused, I would have expected the traffic to be similar, but as it happens lots of people gave up waiting for the page to load. So, as Google tells us, clearly performance matters!