David
29th Oct 2004, 08:13 am
Some of you may know that I recently moved the CADTutor forum from an account at Supanames where it had lived for 2 years to my new "load balanced" Linux account at Fasthosts. The move went well, thanks again to TextPad - I had to split the 32MB SQL file into chunks of less that 2MB in order to restore it. It was a days work moving the database and setting up phpBB (yes, I decided to stay in the Open Source camp and not go the IPB route) but there were no problems. I spent another day adding some mods and hacks to improve functionality and user experience and another day or so skinning the board. You can see the results here (http://www.cadtutor.net/forum). User feedback has been good and the forum feels very much faster than it did before - other users have confirmed this.
Over the last few days I had noticed some unusual behaviour by the forum software which puzzled me. During some experimentation I noticed that if I repeatedly refreshed the forum index page, the "The time now..." output at the top of the page jumped forward and backward by exactly one hour!
My first thought was - oh no, what have I done! Assuming that one of my hacks had caused the problem. To test this, I wrote a very simple php page containing this code:
<?
$time = date ('H:i:s');
print $time;
?>
All it does is get the time, format it in hours, minutes and seconds and then print it to the web page. You can see the page here (http://www.cadtutor.net/time.php). Loading the page into a browser and refreshing it a few times showed the "timeslip" effect but not as frequently as on the forum. I then fired up another browser window and loaded the same file. Refreshing both windows independently showed a greater incidence of the effect.
By this time I knew that the problem was with the server and nothing to do with the forum but I couldn't explain the behaviour. Then I realised that on a "load balanced" domain, the http requests are spread across a number of servers. It seemed obvious that at least one of those servers was not in synch with the others and that this was the cause of the problem.
I contacted Fasthosts support yesterday but have had no reply yet. I'll keep you informed. Just in case you're interested ;)
Over the last few days I had noticed some unusual behaviour by the forum software which puzzled me. During some experimentation I noticed that if I repeatedly refreshed the forum index page, the "The time now..." output at the top of the page jumped forward and backward by exactly one hour!
My first thought was - oh no, what have I done! Assuming that one of my hacks had caused the problem. To test this, I wrote a very simple php page containing this code:
<?
$time = date ('H:i:s');
print $time;
?>
All it does is get the time, format it in hours, minutes and seconds and then print it to the web page. You can see the page here (http://www.cadtutor.net/time.php). Loading the page into a browser and refreshing it a few times showed the "timeslip" effect but not as frequently as on the forum. I then fired up another browser window and loaded the same file. Refreshing both windows independently showed a greater incidence of the effect.
By this time I knew that the problem was with the server and nothing to do with the forum but I couldn't explain the behaviour. Then I realised that on a "load balanced" domain, the http requests are spread across a number of servers. It seemed obvious that at least one of those servers was not in synch with the others and that this was the cause of the problem.
I contacted Fasthosts support yesterday but have had no reply yet. I'll keep you informed. Just in case you're interested ;)