The Art of Internet Connectivity

Everyone’s internet connectivity experience is unique and it can vary from minute to minute. Most internet users can sense slowdowns, and everyone can identify when a connection fails. Web developers absolutely rely on a web connection to build web pages. So, when our internet connection goes down our productivity comes to a halt.

I’ve lost count of the number of times I’ve reported to various tech support organizations that I wasn’t able to reach a particular website or web service and was told by the tech: “I was able to reach it just fine.” This happened again today when I called my DSL provider to inform them our internet service went down completely and then was degraded to 1/10 of what we were paying for (e.g. ~1.12 Mbps on a 12 Mbps service). They told me that the line was stable. Although I’m not real sure what stable means. Then the speed gradually increased back up to normal of over the next hour and a half. This has happened about a half dozen times over the last three months. 

As a web developer, you load web pages up to several hundred times per day. I almost always have monitoring tools hooked up that give the exact time to download a page and its associated elements. So, I have a good idea of when the internet is performing well, and when it isn’t.  Because of this I’ve become sensitized to small, millisecond changes in download times.

I also gained extensive knowledge of internet connections when working on high availability systems with up to five-nines uptime. We deployed systems that monitored web traffic all over the U.S. 24×7. I was amazed to see that internet traffic was very much like our roadways. Sometimes traffic is moving fast, other times it’s slow in spots, and sometimes it’s completely stopped or even re-routed.

In many cases, a modem (or router, as I’m using the terms interchangeably) simply locked up. This is quite common as these devices often run a small linux-based operating system that can occasionally flake out. I can say with certainty in the cases where my DSL modem/wireless router didn’t die, and there was no internet connection, then in 9 out of 10 of these cases it was a problem upstream with the carrier.

Guidelines. So, here are some guidelines for helping you narrow down where the problem might be:

– Check the modem connectivity lights. Usually if a modem is connected to the internet, the connectivity light will be a steady or flickering green. Red  or no connectivity light almost always means no connection. It should be a matter of reflex to simply restart the modem and see if that fixes the problem.

– If the internet connectivity light doesn’t come back after restarting the modem, then call tech support.

– On rare occasions (1 out of 10), restarting the server plus the modem restored connectivity.

– Still no service? You can go get a cup of coffee then come back later and recheck.

– Or, if the internet connection light is green, try blowing away the browser cache and try to reload? Sometimes old versions of pages can stick in the cache.

– Can you load any other websites? If you can, then your particular server or service is most likely down.

– Can you ping the server? (for servers that allow ping). Determines if the server has basic connectivity.

– Can you run a tracert? Let’s you look at the connectivity between you and the remote server.

– Document the problems so you have a record for future reference.

– If you need continuous monitoring with alert thresholds, then look into evaluating continuous monitoring tools such as Paessler.

– If you know how to get the basic troubleshooting out of the way, or if you’ve already done it, then insist on escalation when you call tech support. You need to get back to coding as fast as possible.

10 hard earned hints on how to increase your website uptime

Here are some tips on how to keep your website up and running from a hardware perspective. It’s these things that are often overlooked or underfunded that bring a website down. I spend all day working with software, but the hardware is often a mystery especially to software developers.

Twitter’s recent outage brought to light an important fact about any website: they can crash. Of course, Twitter’s outage affected perhaps a hundred million people globally, but the point is that your website can go down as well.

Let’s take a look at how uptime is typically calculated on a monthly basis. 30 days x 24 hours = 720 hours. If the website is down for 8 hours during that time period, it translates into an uptime of 712 hours. And, 712 divided by 720 equals an uptime of 98.888%.

Now generally that doesn’t sound too bad, and most outages are intentional due to maintenance and therefore occur in the middle of the night, or at some other time when web traffic is the expected to be the least. When you start noticing outages is when they occur during what you would consider as normal business hours. Because when that happens then your employees or visitors productivity can take a hit.

Oftentimes, for typical businesses very little focus is placed on the following. It’s my contention, for those of us who aren’t Twitter, you can easily reach near perfect uptime using the following guidelines. Even if you only have a handful of customers that hit your website a few times a week, if they experience an outage it will negatively reflect on you even if you are contractually covered. With a little work, you can significantly reduce down time.

  1. Use real-time monitoring tools or build your own. At a minimum you need to monitor: CPU, available memory, available harddisk space, current inbound bandwidth usage, and time to complete an HTTP request to at least your home page. Assign staff members who will get emails and text messages if the monitor detects a problem. Expect them to respond within a certain time period even on holidays and weekend.
  2. If you use a system monitor, host it somewhere other than where your server farm is located. This seems obvious but I’ve seen it happen where the monitor went down with the server since they were on the same machine, or located on the same site.
  3. Always, always, always take an image backup of the previous version of your website machine. Yes, I mean an image of the entire machine and not just a copy of the website directory. It’s easy to do, it doesn’t take long, and it doesn’t take much storage space these days to do what’s called a snapshot image.  With modern software, you should be able to do this with just a couple of clicks with your mouse.
  4. If you don’t use the cloud, have a cheapo spare server machine that can be swapped out for your more expensive super, ultra redundant machine. You can buy a decent quad-core, 16GB RAM server for a roughly $400 – $500 dollars as an insurance policy.
  5. Have a cheapo spare even if you use virtual machines. I’ve personally seen two instances of complete shutdown of all virtual instances when the master server blew out its memory.  Computer memory is like the engine in your car – when it dies your forward progress will come to a complete halt. I can tell you with certainty that most servers that you and I use don’t have redundant memory capabilities.
  6. If your primary server is down for some unknown reason you have several immediate choices: restart it and hope it comes back up, spin up a copy in the cloud, or direct traffic to your backup server. Now, all off these are great strategies as long as your site isn’t under a denial of service (DoS) attack or getting overwhelming amounts of standard, non-vengeful traffic. You can find this out by using the monitoring tools mentioned in #2. Here’s one possible approach. Whatever approach you use you should test it and document it:

    – Restart primary server. If it restarts okay then you’re golden.
    – If primary crashes, then plug-in either a hot-spare or spin up the stand-by copy.
    – If the backup copy crashes then go to the rollback snapshot copy that you made.
    – If the rollback snapshot copy crashes then you have no choice but to start doing a detailed investigation of log files and other forensics.

  7. Do your investigation or forensics after you’ve restored service. This should probably be rule number one! Your website visitors will appreciate this. I’ve been in several situations over the years where the focus was on figuring out why a system went down first while the users languished with no service. Do your best to get things started again and then worry about what happened.
  8. I’m going to mention ISP redundancy because it is definitely overlooked. If you have hosted your server at a major hosting provider, they often contract with multiple internet backbone providers. The backbone providers are the primary carriers of all internet traffic. And, the hosting facility will have multiple trunks from various primary carriers coming into their facility on different sides of the building in case one trunk is accidentally cut or has an outage. Check with your hosting provider for options on this.
  9. Universally everyone will tell you to cache your static content on a CDN. I agree with this although, to me, this is more of a performance issue than an uptime issue and that’s why I have it down here at number 9. It’s possible that if you have huge amounts of static content that this could prevent your server from crashing, but for most of us this is a performance boost.
  10. If you are getting overwhelming amounts of non-vengeful traffic, one concept I used to great success was to place a simple HTML file that was served up every so many visitors that said we were experiencing high traffic volumes. The simple file took very little overhead to serve and had an immediate and significant reduction in the load on the server. Naturally, when the event was over we took the message down.

I’m not going to address Denial of Service attacks since I’m not a security expert. There are plenty of papers on the web and experts you can call. I can say I have averted limited DoS attacks in the past by filtering IP addresses and working with an experienced network service provider. But, if you are under a widespread DoS attack get expert help immediately.

[Edited 6/23 – added a tenth hint! Fixed minor typos.]