blog - tech - photos - portfolio

Archive for the "Web Dev" Category

Drupal Performance on IIS7 vs Apache

I’ve been doing a bunch of performance testing for one of my Drupal sites and decided to compare IIS7 vs Apache 2.4. I host several Drupal websites on Windows Web Server 2008 with IIS7 and love it. I’ve read more and more articles that show IIS outperforms Apache and other web servers in many situations. But I wanted to make sure I wasn’t loosing possible performance by hosting my site with IIS compared to Apache.

I created a local copy of my site and database on my desktop which is an Intel Core i7 920 OC@ 3.3Ghz with 6GB ram and an SSD. I installed the following software: IIS7, MySQL 5.5, PHP 5.3.13 & Apache 2.4. For IIS I also installed Microsofts URL Rewrite plugin. Besides that the IIS7 configuration is default. PHP settings are default besides upping the memory_limit to 256MB. For my first tests I also left Apache with its default config.

I used Microsoft’s cool testing tool called WCAT. My tests were to see how many pages each server could load in a 20 second period, with a 5 second warmup. The following is my wcat .ubr settings

WarmupTime 5s
NumClientMachines 1
MaxRecvBuffer 64K
CooldownTime 5s
ThinkTime 0s
NumClientThreads 80
Duration 20s
Comment Test Server

SET KeepAlive = TRUE

classId = 1
weight = 100
server = “localhost”
URL = “http://trailforks.local/”

For the Drupal side, I tested my Trailforks site which contains over 100 modules & a custom theme. I created a blank page with a blank template using a custom module, so its the most basic drupal page. I disabled drupals cache and the Boost module cache. These are the initial results.

  1. IIS – 192
  2. Apache – 53

I was rather surprised with the results, IIS blew Apache out of the water. The next test was to enable boost and test serving basically just a simple html file.

  1. IIS – 207,677
  2. Apache – 84,436
Again IIS more than doubles Apache’s numbers. I also tried with IIS’s built-in “Output Caching” and the result was prety close to Boost at 219,374. Now another advantage to IIS is that the default configuation of IIS7 and of PHP 5.3 when using the PHP Installer is pretty good, I wouldn’t change much. Its been several years since I had used Apache, but I knew that the default Apache config is not great. So I did a bit of looking around and added a couple things to the httpd.conf along with disabling all but the minimum Apache modules needed to run Drupal.

KeepAlive On
MaxKeepAliveRequests 150
KeepAliveTimeout 5

<IfModule mpm_winnt.c>
ThreadsPerChild 250
MaxRequestsPerChild 0

This increased the Apache number only slightly from 53 to 62.
I also wanted to test each platforms most popular PHP Opcode cache extension, Wincache & APC. I installed the newest version for each and gave both lots of memory (same amount for both).
  1. IIS – 683
  2. Apache – 544

So once again IIS with Wincache beats out Apache with APC. Also nice to see that the opcode more than triples the performance!

Another quick test was to enable a “web garden” on the IIS application pool for the site. Changed the max worker process to 10. this increased the IIS number even further to 936.

Doing these tests has defiantly reaffirmed my choice to use Windows & IIS for hosting my sites. Not only does it outperform Apache in these specific tests but I find it MUCH easier to manage with the excellent UI’s and tools. Ever since Microsoft moved the HTTP.sys into the Windows kernal and rewrote IIS from 6 to 7, its been a solid competitive option. With Windows you also don’t have to worry about tweaking TCP like you have to on most Linus distros for optimal web hosting performance. Microsoft has also invested a lot into PHP & FastCGI on Windows over the past several years and PHP on Windows/IIS is just as good as LAMP now. One of my favourite things about IIS is “application pools” and how each site is isolated from everything else, so if it crashes, or is running slow, it doesn’t effect the others. This also helps for security and application pools can be configured to recycle when it detects problems. Another huge bonus is most config changes you make with the IIS Admin GUI or by hand editing a web.config file take effect instantly! No restarting Apache every time you change a setting.

I know doing any kind of benchmarks is never perfect and I want to do more tests. I’m planning on running more tests with a higher concurrent to see if that changes the comparative results at all. Additionaly if anyone has any suggestions on how Apache might be better tweaked please let me know!

Easy WCAT setup I created with simple .BAT files to run creating the server & client for testing:


How Politwitter Works

A new blog post on Politwitter detailing some of the background mechanisms that make tick.

Politwitter Launches Government Social Media Aggregator is a companion tool to Politwitter that tracks social media activity by Canadian government departments, institutions & organizations.

Many of the features, & statistic tracking from Politwitter is now available to help track & analyze how the Canadian government is using social media and how citizens are interacting with it.

Back in 2009 after launching I thought about creating sub-sites for local government, newsmedia & government. In 2009 I started creating but soon realised there was not much interest. I created to start collecting municipal twitter data, but also realised I didn’t have the time to maintain a database of all the municipalities in Canada. Keeping Politwitter going with federal & provincial politics is already a big undertaking.

I started on a Government site but with federal & provincial elections on the go I was focused on Well in March 2012 a new site created a directory of Government Twitter & Facebook accounts so it reminded & prompted me to finish the Politwitter GOV site. Keeping a directory of Governments social media is manageable, the numbers aren’t huge. But as with the main Politwitter site the directory can be updated by anyone.

Politwitter not only lists government Twitter & Facebook accounts but also includes Youtube, Flickr & indexing of photos & links. Politwitter also aggregates all of this government social media data for permanent archival and analysis, with features & tools people have loved on the Politwitter political side.

Politwitter allows sorting, filtering, searching and statistics of the Government social media. More statistics will become available once more data is collected.

I don’t mean to step on Zegov’s toes, but I’ve had this on the backburner for 2 years and already had all the infrastructure built for Politwitter. Using the Politwiter platform gives much more functionality than exists on the Zegov website. I’ve also seen several projects like these popup over the years that fizzle out or aren’t maintained. Politwitter has a proven track record which media, politicians and government already rely on. I can also share data between the government & political sites for deeper analysis going forward.

I’m always open to working with others or having people help develop Politwitter, but for the most part no one takes me up on that offer and it’s been a solo undertaking. Of course if you’re not a web developer you can always help by keeping the directory updated, telling others about Politwitter or donating.

If you have any suggestions for the new Government Politwitter let me know! If you see a government twitter account missing you can add it here.


Finally pulling the wraps off a project I’ve been working on called is a community-powered mountain biking trail database currently focused on BC.

The core functionality of Trailforks is a database for mountain biking trails. Trailforks is a crowd-sourced community site and users can help populate and keep the database updated. The data & features for each trail is tailed specifically for mountain biking. There is a high focus on getting GPS data for every trail & maps are a big part of the site. Each trail page has a map and GPS data and each riding area has a Google Earth 3D map with all the trails plotted on it dynamically. Just upload a GPS track of a single trail and all the rest is handled automatically. (Example the Mount Fromme Page)

The site has loads of other features like photos, videos, skill parks, news, business directory, local products, events, forums, bike profiles, riding routes, route challenges, group ride planning & more. But one feature I really want to promote is “Trail Reports”. A Trail Report is a quick entry posted by users indicating the status of a trail and describing any problems or things needing attention on a trail. A trail report can also be a log of work done on a trail and “trail days”. I hope that local riding associations and trail maintainers might start using this tool. Most pages on the site offer RSS feeds and I can create custom widgets for associations so they can display trail status and reports on their own sites. I also have a REST API that accepts and outputs data in XML, JSON or Serialized PHP.

To help encourage people to build the database users earn points for all the content they contribute and credit is given to the user. The site also has points & gaming style achievements that users can unlock by helping contribute content or just by using the site. For example one of the achievements is “Ridden 100 Trails” earned by marking 100 trails as “ridden”.

Trailforks now also integrates with my “Ridelog” Facebook App.

Updates to

I’ve been working hard on Politwitter this past week, adding many new exciting features along with several bug fixes.

I just finished adding a new statistics page that tracks the sentiment of tweets mentioning MPs. The results are grouped by party and interesting charts are shown.

I created a page listing all the Twitter hashtags for House of Commons committees and will now index all tweets using these hashtags.

I created a list of all 308 federal ridings
You can click on any riding to view that ridings social media page, showing all related content for that riding.

I also started a federal riding hashtag format based on the riding EDID number for people to tag their tweets about local riding issues. To help people find your EDID hashtag I created this lookup tool

I remade the main menu using a multi-column dropdown format, allowing for much more links in a user friendly format.

I created a system to collect the total number of tweets each parties MPs make each week then to automatically tweet out those stats for each party using 4 Twitter accounts I have for each party. So people can follow which ever twitter account they are interested in. The stats can also be viewed on this page:

I remade the “election fever” page updated for 2011 and switched the charts to use the new interactive Google visualization.

I did some major backend work to allow the site to start tracking MPs & MLAs that are not on Twitter but do have other social networks. Previously everything was tied to a twitter username, so I wasn’t able to add MPs without Twitter.

Along with that I started creating new directory pages to list the politicians on other social networks than Twitter

Also related are the new ‘profile overview’ pages for tracked users, which give a summary of all their social media content indexed by Politwitter. Example:
I’ve also added ‘Klout’ score to all MPs profiles.

I started populating the stats page on MPs profiles, here is an example:

There is now a “Bills & Votes” landing page and I’m working on indexing all tweets relating to any bill in parliament, then listing all the bills with related tweets.

The MP & Riding search was also improved. You can enter an MP or MLAs name, riding name or a postal code and get a list of MPs and ridings that match.


And finally I added a new blog post asking for Donations to help fund the continuing development, upkeep and hosting of

Read the post here:
Donate here:


I’m excited to announce a new project I’ve been working on, a social media aggregator & directory for webcomics. Webcomictweets allows you to follow all webcomicers in one convenient location. The site brings in content from Twitter, facebook, formspring, pictures, ustream, youtube, tumblr, deviantart and more!

Webcomictweets offers a loads of functionality, with features like conversations, tweeting from the site, a follow and “like” system and much more.

The site provides many statistics of webcomics and their Twitter & social media usage. With features like rankings, popularity, influence, social media scorecard and more. The site also tracks the content that receives the most views, likes, retweets and so on, allowing visitors to view the most popular content.

There are too many features to talk about in a single post. If you’re interested visit the site & start exploring or watch the horribly narrated introduction video here.

Facebook App for tracking Mountain Bike Rides

I was trying to remember the other day how many rides I went on last year and I couldn’t remember. So for this year I decided to create a ride log and I’ve made it as a Facebook application that anyone can use.

Its very simple at the moment, which is not a bad thing, I don’t want to clutter it up. But I do have plans for more features if people actualy start using it!?

Basically all the app allows you to do now is enter in a database each ride you go on. With fields like location, trails you rode and friends you rode with. The app is integrated with facebooks friends system and has an option to post a message to your wall when you add a ride.

You can try it out here:


Future features:
- Profile tab
- Profile box showing latest rides added
- upload images
- stats page showing most popular locations, trails, top riders and so on
- location & trail names clickable
- global page to view everyones ridelogs (if public)

If you have any suggestions please let me know!

New Website!

For some random reason I decided to totally re-make my personal site. I changed the focus from being a portfolio site to more of a personal blog site. I decided to give WordPress a whirl since I had recently written a plugin for a friend. I spent the all of yesterday trying out various plugins, fiddling with code and creating a theme.

I am very impressed with how good wordpress has become, its way better than it was 3 years ago when i last tried it. The plug-and-play plugin system is awesome and there are so many great plugins available for free. The admin control panel is also now so much nicer as of version 2.7.I was also able to import all my old blog posts using the RSS import method. I am going to try and actual update the blog now!

Some features of the new site include.

  • Integration with twitter
  • blog posts create a  tweet
  • Facebook photos viewable from this site
  • ‘Facebook Connect’ visitors are able to login to this site using there facebook login. This makes logging in to comment super easy and fast!
  • Livestream feed
  • Tagging and search highlights, auto-tagging
  • tabbed widgets
  • Threaded comments with comment notification option
  • Mobile versions of this site for Windows mobile and iPhone

I am testing the plugin feature to add photos from my facebook to blog posts.

False Advertising claims its forums are the 'fastest growing political forums in Canada', but the data shows otherwise. In fact it's a major stretch of a claim for them to make considering their growth rate is among the lowest.


The data says otherwise:


and here is the growth rate compared:



New CKA Shop finaly rolling

After spending a fair amount of time adding loads of new designs and making my new shop site I am finaly starting to make some sales on this new system. Just sold my 50th shirt since start of march.

Check out my new shop with tons of Canada themed designs but not limited to that! I have some very neat designs from a friend in the Canadian armed forced as well some from spikecomix.

Tags: ,