Timing Page Loads

Posted on April 3rd, 2008 in Webmastering, system admin, system administration by Russ

Every morning, I had a client calling me and asking “Is our server abnormally unresponsive?” They were browsing their website and it seemed to them that the pages were taking longer than usual to render. Once I figured out why they were asking and what they were measuring with, I realized I could graph this amount of time, the important thing was figuring out how to get this information.

Here’s what I came up with: I was already running mrtg-rrd to do much of their graphing, so I wanted to create a MRTG Target line to correspond to “how long does our page take to render.” I wrote a script to run “/path/towget –delete-after -pq (page) -O /tmp/garbage” and display the amount of time it took. I wrote it in php because it was easiest.


$wget="/usr/bin/wget -pq --delete-after -O /tmp/garbage";
$toget = "$site";
$start=microtime(true);
exec( "$wget $toget", $out, $e );
$end=microtime(true);
$dur=round( $end-$start, 3 );
print "$dur\n";

The problem with this is that I was running it on their gateway; their gateway is also the monitor and grapher. It was taking less than a second to render the page ( because of local network speeds ). Instead, I wanted it to more closely correspond to what the client would be seeing. Their development server is at their office; so I put the script there and wrote the MRTG target to point at a local ( on the gateway ) script that got the value from the development server, printed it twice, printed the date and the name of the site. It looks like this:

$user='foo';
$password='bar';
$sitename='example.com';
exec("/usr/bin/lynx -auth=$user:$password --dump http://developmentserver.com/scriptname.php ", $out, $e );
$time=0;
while ( ($time==0) && (count( $out ) > 0 ) ) {
$time=(float) array_shift( $out );
}
print "$time\n";
print "$time\n";
print date("r\n");
print "$sitename\n";

A couple of important caveats. The day after I started running this ( it averages around 4.6 seconds, btw, much too long imho ), the displayed time doubled. It could have been a change to the page we’re looking for, but it turned out to be a DNS issue on the development server. So DNS is important. This doesn’t take into account the amount of time a browser takes to render a page; it’s just the time to download all the pieces. So processor intensive stuff, like super heavy javascript or super heavy tables, won’t show up here. However, if you keep in mind what the value is- how long to resolve and download all the pieces of a web page, this is a useful metric.

Internet Profiteering

Posted on October 15th, 2007 in Webmastering by Russ

Not really. Because Profiteering is like pirating. Sort of.

But I am trying to make some internet profits happen. Over at A Buck A Night I’m exploring internet passive income streams. I’ll let you know how it goes; so far it’s kind of depressing.

Open for Release

Posted on July 27th, 2007 in Webmastering by Russ

I made this theraputic purchase, and followed it up with a fair bit of work. When I asked, after I bought the domain, about some of the more “automagic” portions of the site, ones that I would expect; the seller laughed.

Anyway, I bought a Pagerank Checker service, and have put together some other changes. I have a few more things to put together, but for now, it’s working as I want it to.

IMified

Posted on May 17th, 2007 in Webmastering by Russ

I want to like IMified. I think it’s a terrific idea; a way to combine AJAX (Asynchronous Javascript And XML) and IMs; that’s what it is, really, a structured way to proces REST requests through your IM client.

Unfortunately, even with the plugins, it’s not very helpful to me. The most helpful ones would either be the network tools (ping, traceroute, etc) or the Basecamp tool- but unfortunately both of those require that I “push” the data to them. And honestly, I’d just as soon open a terminal window and use traceroute there. Or just go log into my basecamp account.

What would really help would be a rss feed tool, or some way for a service to send me an alert; I can totally see a place for Nagios to alert me via IM when a machine is down, and if it’s easier than the nagios plugin to configure, that’d be awesome.

IMified; keep an eye on it.

Top Five Essential Practices When Developing Software

Posted on May 16th, 2007 in Webmastering by Russ

Basil Vandegriend has written about five crucial practices when you’re developing software. Let’s take a look at what he has to say.

  1. Automated Tests
  2. Version Control
  3. Refactoring
  4. Repeatable Build and Deploy
  5. Communication

Obviously he’s coming from an Agile mindset. Agile methodologies are essentially to rewrite the specs in terms of “tests” and write those tests as scripts, break the code up into small pieces to match the tests, code quickly, and code in order to successfully pass those tests. And then go back over the code and refactor, tighten and clean up. Pretty straightforward.

That’s why he has the two items “Automated Tests” and “Refactoring;” they’re pretty much straight from the Agile handbook. And if you’re coding quickly, it’s important to run your tests frequently. And if you’re running your tests frequently, you might as well automate them. That way you can just happily burble along, coding up your test-hurdle-jumping scripts and just watch your email for the broken alerts. In fact, I think “Repeatable Build and Deploy” is right there along the automated tests- building and deploying should be as straightforward as typing “make” or “svn export (url);” the fewer different buttons you have to push, the more likely you are to push those buttons.

Don’t get me wrong; I totally agree with him about “automated tests,” “refactoring,” and “repeatable build and deploy.” However, his background and mindset pushes these items into his top five list. I agree for “automated tests,” and for “build and deploy” but I’m not so sure about “refactoring.” Because I tend to plan more in advance and try to figure out the functions and classes I will be needing, I don’t think refactoring is as high on my list.

“Version control” is an excellent suggestion; I really like subversion. I tend to forget stuff, so if I can figure out from the logs what I checked in on a particular day and what the log was (as well as any file changes), then I can figure out where I’m going a lot easier. Especially if you, like me, tend to work on projects and then drop them off, and then work on them after a while. And it makes “rolling back” a change very simple, in those rare (heh) cases where the client changes their mind.

Basil closes with his strongest topic; communication. I think this is hands down the most important essential practice when developing; whether it’s communication with the client or communication with other team members. If you don’t communicate with your clients, you won’t be needing those unit tests or the rapid deployment. If you don’t communicate with your teammembers, you won’t be able to pass your tests regularly. Communication really is the glue that holds the project together.

I think Basil did a good job with these five practices. While I don’t think I could come up with a better list, I’m not sure about his ordering, which, honestly, could be a solid oratory practice.

SEO Check-UP

Posted on January 10th, 2006 in Webmastering by Russ

If you’re anything like me, you’ve been around the internet a while. And you may think that you’ve soaked up some of the wild internet search engine information. If you’re more like me, you’d be wrong. Search Engines, like Google and Yahoo, can be a little more particular; and this is a good thing.  Search Engines aren’t about people making money or manipulating the results, what really drives Google is people using their engine to find accurate and relevant results. While Search Engine Optimization is important for web-masters, these people (us) need to remember that the search engines aren’t really working for the same purposes as most webmasters.
I generally presume that with solid, interesting content, excellent linking, good meta tags, page and image descriptions, and you’d be golden. Unfortunately, that’s not all it takes with the current Search Engines. Keyword density, link popularity, page freshness, all these and more can impact the weight of your site in the engines’ results.

This tool from Sitening helps iron out a lot of the fluff from your content and HTML(link) and optimize my site for search engines. Using it, I’ve found that several sites I’ve worked on could really use a helping hand. Some of the things this tool shows might not be weighted correctly, but it’s certainly one weapon you should have in your arsenal.
Sitening SEO Analyzer