If you don't already have a dashboard monitoring your website's performance and giving you key insights into what you can't anticipate then you're missing half of the picture!
One of the most important things you should know about how your site is performing is your TTFB (Time To First Byte). This is the time taken from the moment your web server receives a request from the client, to the moment the webserver begins sending back the first byte of the response to the client. Measuring this number can be done quite simply in Apache httpd using the mod_log_firstbyte module. This allows you to log the time, in microseconds, for first byte of the response in your web server's access log. However, simply thorwing this metric into an access log file that's out of sight also keeps it out of mind and thus becomes less useful to you. In order for this information to give you any real insight into how your web site is performing on a regular basis it must be monitored and presented in a digestable manner.
One of the easiest ways to look such information is on a graph. This makes it easier for your brain to absorb and comprehend the bigger picture with a single galnce. You're not likely going to be staring at this graph all day long so it should be updated on a near- time or real time basis. Making it useful for the occosional darted glance.
There are many ways you could do this. You could go out and find a turn-key solution that does all of these things for you, or you could roll your own.
Since I write code and solve problems for a living, I decided to tackle this challenge myself. It turns out this is not nearly as complicated of a task as it may appear. The most critical piece is actually just collecting the data and doing the aggregation. There are plenty of free open-source and paid solutions to putting it all on a sexy looking dashboard (e.g. chartjs or geckoboard).
So in this article I'm going to explain how I came up with the webSAT library, which makes it possible for you to collect such data for real time analytics from one or even thousands of servers with very little code, setup, or maintainence cost.
For those of you who used to follow my blog regularly, you may have noticed it went down for a while. To all my readers, I sincerely appologize for the inconvenience. The VPS I used to host my old blog on had an irrocverable hardware failure and I lost all my data. So I've decided to use Github Pages to host my new blog instead!