Jul 31
Chicago Board of Trade
icon1 Donncha | icon2 Uncategorized | icon4 07 31st, 2008| icon3Comments Off

The Chicago Board of Trade (CBOT) is the world’s oldest futures and options exchange. It was established in 1848 and since 1930 has operated out of this building on 141 West Jackson Boulevard, Chicago according to this Wikipedia page.

Possible Batman “The Dark Knight” spoilers ahead. Don’t read on if you’re going to watch the movie!

La Salle is the street directly in front of the building and the location of a scene in the latest Batman movie, “The Dark Knight”. Watch out for the statues and clock in the scene where Batman goes up against the Joker in his truck. It’s quite visible in the background. Moments later you can see the text, “Chicago’s finest …” in a shop window. I thought it was very sloppy of them not to hide those signs of the locality.

Related Posts

Tags: , , , , , , , , , , , , ,
Jul 31
The Thieving Duck Photoshoot
icon1 Donncha | icon2 Uncategorized | icon4 07 31st, 2008| icon3Comments Off

Many moons ago I posted the infamous Thieving Duck that went viral when someone robbed it, added a funny story and emailed it around. Apparently it’s been seen all over the world which is kinda cool. It even made it to snopes.com too!

Anyway, I can finally reveal a few more shots from that photoshoot in Chicago. All the talk about the new Batman movie got me digging into my old Chicago photos and I found these shots I took on State Street way back in 2005.

[View post for gallery]

Related Posts

Tags: , , , , , , , , , ,
Jul 31
404s and WordPress Server Load
icon1 Alex | icon2 Uncategorized | icon4 07 31st, 2008| icon3Comments Off

A few months back we launched a site redesign/redevelopment project for a client, and made a simple mistake that had some interesting ramifications. It’s worth posting here so others don’t make the same mistake.

What Happened

When redeveloping the site, we moved the WordPress instance from the web root:

/public_html/wp-config.php
/public_html/wp-includes/
/public_html/…

to a subdirectory within the web root:

/public_html/wordpress/wp-config.php
/public_html/wordpress/wp-includes/
/public_html/…

I consider this to be a best practice for WordPress powered sites, as it makes version upgrades a bit easier (among other things).1 Some plugins don’t work well with symlinked “plugins” directories, but those generally have easy fixes (use ABSPATH, not dirname() in your plugin).

These changes were made and thoroughly tested on our dev server with historical data. We then made the changes in a staging environment under a beta.example.com style domain name before pushing the changes live. In short, we were pretty careful and tested pretty well.

The Result

When we finally pushed everything live, the production server was brought to its knees. Yikes!

A little poking around, some bug reports, and very shortly thereafter we figured out the problem. We had failed to set up a rewrite rule to map content from:

/wp-content/uploads/

to:

/wordpress/wp-content/uploads/

where it was now located.

An omission like this wouldn’t have had much effect on server load in some site configurations, but one of the wonderful features of WordPress - its lovely permalinks - has a hidden caveat that can be exposed if someone makes a configuration mistake (like we did).

WordPress’s permalink system basically works like this:

  1. See if a file exists in the location that was requested; if the file exists, serve it. This is how images, media, non-WordPress files, etc. are served without conflicting with WordPress.
  2. If no file is found at the location that was requested, then pass the URL to WordPress and see if WordPress can figure out what to show.

It’s a really elegant system and works very well. However, it also means that 404 requests - http requests that result in a “file not found” message - have a much higher impact on the server than a traditional 404 request does. For every 404, the server instantiates WordPress, does some database work to try to see if it can figure out what to serve, etc.

When we didn’t set up proper redirects for the content in “uploads”, we basically increased the server load by a factor of 20. Instead of a single request going to WordPress and 20 requests serving static content by Apache, all 21 requests were being sent to WordPress.

The increased load on the server had some… adverse effects on performance. Yeah.

Why We Missed It

So this should be a pretty easy thing to catch, right? If the URLs to the images are broken, we’d all be seeing a bunch of broken images all over the place in our testing - right?

Not exactly, and for two different reasons:

  1. When we tested on the production server using the beta.example.com hostname, the content was still pointing to example.com and the live production server was dutifully serving the images. It wasn’t until we pushed the changes live that the images were no longer at the previous URLs.
  2. Even when the images were no longer in the proper place, our browsers that we were testing in were showing the images properly. This was due to longer expires headers we had just implemented for media on the server in order to reduce overall server load. In casual testing, everything looked to us to be working properly.

Once we tested in browsers that didn’t have the images cached, we immediately saw the problem.

Easy Fix

Luckily, this is a really easy problem to fix. A simple mod_rewrite rule (placed before the standard WordPress rewrite block) fixed everything right up:

RewriteRule ^wp-content/uploads/(.*)$ /wordpress/wp-content/uploads/$1 [L,R=301]

(alternate code, improvements to syntax welcome)

With this in place, the old URLs were redirected to the new location and no longer were spinning up WordPress on every image request.

Hopefully this will be useful to people who might be doing something similar, or who have made the same mistake and are looking to recover from it. )

  1. Corey has a nice writeup on the file structure he uses. [back]

ShareThis

<!-- -->
Jul 30
Plugin Competition
icon1 Matt | icon2 Uncategorized | icon4 07 30th, 2008| icon3Comments Off

The WordPress plugin competition at WLTC is now open for voting.

Jul 30
Using WordPress as a CMS
icon1 Matt | icon2 Uncategorized | icon4 07 30th, 2008| icon3Comments Off

Things To Consider When Using WordPress as a CMS. Would love to see more articles like this.

Jul 30
11 Years of Amazon.com
icon1 Ryan | icon2 Uncategorized | icon4 07 30th, 2008| icon3Comments Off

I went on a nostalgia trip and started browsing through my Amazon order history.  My first order with Amazon was on July 6th 1997.  Damn, time flies.  I’ve chewed through a lot of books since then.  Who among you are Amazon old schoolers?  Do you remember when Amazon used to send free schwag for Christmas?

Jul 30
Looking for a parking space
icon1 Donncha | icon2 Uncategorized | icon4 07 30th, 2008| icon3Comments Off
Looking for a parking space

You’re in town and desperately looking for a parking place. Where do you go? All the on-street parking has either been removed because of road works or taken by everyone who went shopping at 9am. Just look up. There’s a multi storey carpark somewhere near you. Probably.

Front of the car park on The Grand Parade. Shot after I said goodbye to Phil and the others a few weeks ago.

Related Posts

Tags: , , , , , , , , , , , , , , , , , , , , ,
Jul 29
ALA Survey
icon1 Matt | icon2 Uncategorized | icon4 07 29th, 2008| icon3Comments Off

The new A List Apart for survey is up.

Jul 29
Western Star Cork
icon1 Donncha | icon2 Uncategorized | icon4 07 29th, 2008| icon3Comments Off
Western Star Cork

The Western Star in Cork was a favourite haunt of UCC students for many a year but now it looks like it’ll be demolished! Looks like development has been on the cards for quite a while:

Permission was granted to Tom O’Riordan carry out development namely, permission for part demolition of existing public house and removal of existing timber outhouses, construction of 12 medical suites over 29 no. ground floor level car parking spaces and associated entrances, roadways and site works with vehicular access medical sites from the grounds of the Bon Secours Hospital at the Western Star, Western Road, Cork in accordance with plans and particulars submitted on 16/08/05; further information requested on 07/10/05; further information received on 04/04/06; clarification of F.I. requested on 26/04/06 and clarification of F.I. received on 31/05/06 Ref. T.P.05/30005

Related Posts

Tags: , , , , , , , , ,
Jul 28
Cuil
icon1 Matt | icon2 Uncategorized | icon4 07 28th, 2008| icon3Comments Off

I like Cuil. There’s just something very intuitive about the interface that fels comfortable to me, but I’m not sure how to articulate it. And it’s fast! Going to try it out as my default search engine for the next few days. Downside? Sometimes the images seem completely random, and I do see some spam in the index.

« Previous Entries