Anyone watching in the past weeks would have noticed the CFA and DSE websites struggle under unusually high load from visitor traffic.
Taken from Tuesday 24th, 2008 Financial Review – “In order to keep this valuable resource online, techies at Google took the CFA’s data and overlaid it onto Google Maps to create a map of the state dotted with coloured balloons showing the location and status of each blaze”
“The number of queries went from two per second to more than 200 per second within less than 24 hours”
If the database server is overloaded because the site is making live queries – that is, queries based on user page-requests, it could easily be resolved by outputting the query data to a static .html file, which is then served to clients by the web server. The query for generating the file could be run as often as every second, giving people ‘to the second’ information which would still only equal 1 query per second on the DB server, an improvement on the the claimed 200 queries per second during the bush fires.
Something like the below code stops the client browser caching any pages, and gets the new version from the server with each request.
header("Cache-Control: no-cache, must-revalidate");
header("Expires: -1");
Now the web server is doing all the hard work, and that is limited to serving static text based content to clients… which is much easier to manage.
Something like this would improve performance assuming the database server and web server are network connected (ie, not both the same box).