Posts Tagged‘iis’

Website Performance (or People are Impatient).

Way back when I used to host this server myself on the end of my tenuous ADSL connection loading up the web site always felt like something of a gamble. There were any number of things that could stop me (and the wider world) from getting to it like: the connection going down, my server box overheating or even the power going out at my house (which happened more often than I realised). About a year ago I made the move onto my virtual private server and instantly all those worries evaporated and the blog has been mostly stable ever since. I no longer have to hold my breath every time I type my url into the address bar nor do I worry about posting media rich articles anymore, something I avoided when my upstream was a mere 100KB/s.

What really impressed me though was the almost instant traffic boost that I got from the move. At the time I just put it down to more people reading my writing as I had been at it for well over a year and a half at that point. At the same time I had also made a slight blunder with my DNS settings which redirected all traffic from my subdomains to the main site so I figured that the burst in traffic was temporary and would drop off as people’s DNS caches expired. The strangest thing was though that the traffic never went away and continued to grow steadily. Not wanting to question my new found popularity I just kept doing what I was always doing until I stumbled across something that showed me what was happening.

April last year saw Google mix in a new metric to their ranking algorithm: page load speed, right around the same time that I experienced the traffic boost from moving off my crappy self hosting and onto the VPS. The move had made a significant improvement in the usability of the site, mostly due to the giant pipe that it has, and it appeared that Google was now picking up on that and sending more people my way. However the percentage of traffic coming here from search engines remained the same but since it was growing I didn’t care to investigate much further.

I started to notice some curious trends though when aggregating data from a couple different sources. I use 2 different kinds of analytics here on The Refined Geek the first being WordPress.com Stats (just because it’s real-time) and Google Analytics for long term tracking and pretty graphs. Now both of them agree with each other pretty well however the one thing they can’t track is how many people come to my site but leave before the page is fully loaded. In fact I don’t think there’s any particular service that can do this (I would love to be corrected on this) but if you’re using Google’s Webmaster Tools you can get a rough idea of the number of people that come from their search engine but get fed up waiting for your site to load. You can do this by checking the number of clicks you get from search queries and comparing that to the number of people visiting your site from Google Analytics. This will give you a good impression of how many people abandon your site because it’s running too slow.

For this site the results are quite surprising. On average I lose about 20% of my visitors between them clicking on the link in Google and actually loading a page¹. I shudder to think how many I was losing back in the days where a page would take 10+ seconds to load but I’d hazard a guess it was roughly double that if I take into account the traffic boost I got after moving to a dedicated provider. Getting your site running fast then is probably one of the most important things you can do if you’re looking to get anywhere on the Internets, at least that’s what my data is telling me.

After I realised this I’ve been on a bit of a performance binge, trying anything and everything to get it running better. I’m still in the process of doing so however and many of the tricks that people talk about for WordPress don’t translate well into the Windows world so I’m basically hacking my way through it. I’ve dedicated part of my weekend to this and I’ll hopefully write up the results next week so that you other crazy Windows based WordPressers can benefit from my tinkering.

¹If people are interested in finding out this kind of data from their Google Analytics/Webmasters Tools account let me know and I might run up a script to do the comparison for you.

 

IIS 7.5, WordPress and WinCache: A Match Made in Hell.

This blog has had a variety of homes over the past few years although you wouldn’t know it by looking at it. Initially it was hosted on a Windows 2008 server I built myself, sitting behind the tenuous link of my ADSL connection. Don’t get me wrong this is a great way to get started if you’ve got admin roots like me but inevitably my ADSL connection would go down or people would just plain give up waiting for it to load, what with my upstream only able to handle 100KB/s. Still for most of its life the blog remained in that configuration as I couldn’t find a hosting provider I was happy with.

Of course the day came when WordPress decided to stop playing nice with IIS and started returning internal server 500 errors. Thankfully it would usually right itself after a reboot but it was always a count down to the time when it would start erroring out again and being the busy man that I am I never had the time to troubleshoot it. Eventually I caved and set up an Ubuntu box to host it, figuring that all my woes would be solved by switching to the platform that everyone expects WordPress to run on. I’ll be honest it was a good change as I could finally use all the caching plugins, and traffic took an upward trend thanks to the faster loading times.

Unfortunately that didn’t last particularly long either as whilst the blog was particularly zippy the Linux VM would sometimes stop responding to requests and would only start behaving itself after a reboot. The cause of this I’m still not sure of as the VM was still up but it just refused to keep on serving web pages, including all the funky admin tools my PHPMyAdmin and Webmin. It was around this time I found myself in possession of a shiny new VPS that was only hosting my fledgling app Lobaco so I figured a small time WordPress blog wouldn’t be too much for it to handle. Indeed it wasn’t and the blog has been steaming along on it ever since.

However the unfortunate internal server errors returned eventually and whilst I was able to get around them with the trusty old reboot a couple times they became more persistent until I eventually couldn’t get rid of them. After digging around in the event logs for a while I eventually stumbled across references to php_wincache.dll which upon googling lead me to posts like these, showing I wasn’t alone in this internal server error hell. Disabling the plugin fixed the problem and all was well with the world. Of course many months later I found myself  trying to optimize my blog again and I started looking at the things I had removed in order to keep this thing up and running.

The first was the caching plug-ins which are unequivocally the best thing for performance on a dynamic PHP site. The vast majority of WordPress caching plug-ins don’t play nice with Windows as they make the assumption they’re on Linux and attempt to write files in all sorts of whacky locations that simply don’t exist. WP-SuperCache, although still suffering from some Linux based assumptions, can be wrangled into working properly with IIS and has been doing so for the past couple months. I also found that WinCache had been updated since I had unceremoniously removed it from my php.ini file so I decided to give it another try. Again everything was rosy for a time, that was until last weekend.

I fired up my blog on Saturday to find the home page coming up fine but I was logged out for some reason. This happens from time to time so I wasn’t worried but trying to login left me with the dreaded internal server 500 error. Poking around it looked like any non-cached page was failing meaning the majority of my site was unavailable. The event logs showed the dreaded WinCache dll failing again and disabling it brought my website back around again. It seems, at least for now, that I’ll have to give WinCache a miss as the last update to it was almost 3 months ago and its past performance has led me to believe that it’s not entirely stable.

So if you’re crazy like me, trying to run WordPress on IIS and all, and you’re WordPress blog seems to take a dive more often than not make sure to get rid of WinCache at least until they get their act together. I haven’t delved into my previous VMs to see if it was the culprit back then but my most recent set of problems can be traced directly back to WinCache wrecking havoc by attempting to cache PHP objects and if this post can save 1 person the headache of trying to track it down I’ll consider it a huge success

A Tale of Two Servers.

I’ve spent the last 4 days lost in a technical limbo. On Saturday I was making good progress with Geon and left it to spend the night out with a bunch of my great friends and to see Inception (well worth seeing by the way). However Sunday morning saw me stuck on what seemed to be the most simple of problems, wasting at least 5 hours trying to get past this point. To make matters worse my web server decided to give up the ghost and just stop serving out PHP pages and neither upgrades, reboots or the hours of troubleshooting I threw at it would bring it back to life. Since you’re reading this now you know that I’ve managed to fix it, but it wasn’t an easy journey.

You see I was running this blog from IIS 7.0 which is Microsoft’s web server. For the most part it’s pretty good, the administration tools are top notch and it only took me a couple weeks to get my head around the whole idea of hosting a web site. Before starting up this site I’d never really tried any web stuff, preferring to stick to my cosy little offline world. Still I knew when starting this blog that I was using the least preferred web server on the market and the tutorials I found for getting it all started seemed more complicated than they needed to be. But I had been given a free copy of Windows Server 2008 and I didn’t really feel like re-educating myself with Linux, which had burned me in the past.

For a long time everything was good, the site was always up (pending my Internet connection of course) and seemed to be quite responsive. Over the course of almost 2 years though I’ve added quite a lot of things to the site like photo albums, sexy comments and all manner of behind the scenes stuff. About 6 weeks ago though I started getting PHP timeouts on this site, but all the others were running fine. The weekend just past saw all of the sites die a similar death and nothing I could do seemed to revive them. I was then faced with a choice, either move this site to one of my external providers or rebuild the server completely. After considering my options I went for the rebuild and 2 days later I’m back online serving this page to you from an Apache web server running on a freshly minted Ubuntu server.

Now I’m no stranger to the world of Linux. I spent quite a good chunk of my University years programming in Linux and my time at the National Archives of Australia had me administering a couple Linux servers that were powering the Digital Preservation Project there. Still I shyed away from it mostly because it was always a pain to administer when compared to its Window’s cousins which I always able to get functioning after 1 or 2 Google searches. To its credit Ubuntu made this process far less painful that it had been in the past and the tools have matured to a point when even a Windows administrator shouldn’t feel out of place. Last night saw this website resurrected in all its glory and hopefully I’ll figure out how to get my other hosted sites up and running sometime soon.

So you might be wondering: what happened to your old server? Well it’s still there, sitting alongside it’s new Ubuntu brother on my ESXi box and it won’t be going anywhere for quite a long time. You see, as great as Apache is, it’s still not IIS and with all my code relying on many things that IIS provides I’ll still need it in some form for quite a while to come. Additionally I had it set up as my Microsoft SQL box, again for development, and whilst I could use MySQL or PostgreSQL to achieve the same end the integration with the Microsoft tools just isn’t there yet. Plus I get it for free because of my Technet subscription so the cost factor that usually accompanies it is a non-issue.

Hopefully the move to the new server will mean the site will load faster for you, won’t cause me anymore administrative headaches and will reacquaint me with the Linux world I once knew so well. It’s a load off my mind to finally see this site back up and running again, especially after 4 days of feeling like I couldn’t make progress in anything technical. We’ll be back to our regularly scheduled programming tomorrow and I hope to see you guys back here then 🙂