Whos.amung.us goes down taking out numerous client websites

Realtime web analytics service whos.amung.us has been completely down for at least the last 3 hours (as of sept 12 4:28pm UTC). Thousands of webmasters (myself included) use this widget to gather realtime traffic stats for websites. The current outage has caused big problems to the sites implementing this widget. Lets look at their widget implementation. <script type="text/javascript" src="http://widgets.amung.us/small.js"></script><script type="text/javascript">WAU_small('unique-site-tag')</script> This is bad! The base javascript uses document.write, hence cant be made to load asynchronously. Moreover, they write an img tag into the document which too must be be loaded before the window.onload event can be triggered. This incident was somehow not critical FAIL for me cause I am aware about frontend SPOF issues and placed this widget just before </body>, so it didn't completely mess with my page, but still caused the following problems.
  1. Delayed the window.onload event, delaying executing of other scripts made to run after onload.
  2. Showed "waiting for .... " in the status bar of the browsers for a long time before timing out, indicating to the user that the page is still not ready.
  3. Makes Google think your site is really slow and doesn't deserve to rank!
Now, for webmasters not aware about these issues the problems is possibly critical. In case the widget code is before the main content of their site, they are in for a hard time. Their site would stop loading at the point the widget is located in the html, giving the users an impression that the website is broken. I understand that today is a Sunday, and not all the engineers/OPs can be on standby 100% of the time to fix these issues. Downtime is inevitable, but when you FAIL, don't take your customers/users down with you. Their javascript serving server was still more stable than the server. Here is a Webpagetest.org result for my site during the outage. Its the dynamic counter image which SPOF'd. If they must use document.write, write a div, give it a name, and attach the image into it using dom manipulation after the window.onload. Moreover, when the servers come under high load, there should be a mechanism to FAIL early with an appropriate status code. Respect your users, don't take them for granted! Disclaimer: My current secret project is somewhat related to real-time analytics.
Tags: site performance
Categories: Webmaster Things