Request type and nginx caching

A few weeks ago, I published a new post and was immediately contacted by Aaron Brazell reporting that the page was blank. A few moments of testing couldn’t reproduce the issue before it “resolved itself,” so I attributed his trouble to some transient problem and thought little more of it. After all, I’d received just one inquiry about this over the last several months of regular publishing.

I should’ve investigated further, as the problem proved quite easy to reproduce.

Continue reading Request type and nginx caching

Planning for the post that Matt links to

For most of the time that I’ve had my multisite network and the underlying infrastructure that I’ve written about lately, I’ve been overly focused on performance and scalability.

I say “overly focused” because I average about 50 views a day here on ethitter.com, on a good day. I write about exceedingly technical–or exceedingly uninteresting–topics, so that’s no surprise.

It’s also no surprise that my two most-popular posts are both about Automattic: the first announcing my hiring, the second declaring that Matt will have to fire me to be free of me. Interest in our hiring process and company culture far exceeds that which exists for my blathering.

When Matt retweeted the latter post back in January, my heart paused, then skipped into overdrive. Beyond the excitement of Matt recognizing my post, I immediately feared the embarrassment of my site crashing.

As it turns out, I had nothing to worry about. The pageviews were, while meaningful for this humble site, insignificant as far as the infrastructure was concerned. No resource-usage alerts were triggered, nor did my provider inform me that I’d exceeded my plan’s allotments. Between Redis-based object and page caching, nginx microcaching, and a robust CDN, there was really no cause for concern.
Continue reading Planning for the post that Matt links to

Redis Object Cache for WordPress, the Accidental Effect of PHP 5.5

Last week, I went a little upgrade-crazy with the VPS that hosts this site. With SPDY 3.1 support in nginx 1.5, I upgraded. I also bumped PHP from 5.4 to 5.5.

The latter change is significant because PHP 5.5 drops support for APC, and I was using APC for both opcode caching at the PHP level and object caching at the WordPress level (thanks to Jaquith’s plugin). Since I’d lost my object cache, I’d also lost my page cache because I was using Batcache. Nice job, Erick.

Almost a year ago, I contributed two small changes to Eric Mann’s WordPress Redis Backend plugin. With Redis already running on my VPS for reasons unrelated to WordPress, it seemed an obvious choice over competing persistent caching options.

I spent some time updating Eric’s plugin (see https://github.com/ethitter/wordpress-redis-backend/commits/master for the fun I’ve had) and sent a massive pull request back with my changes. I’ve been using the plugin for a few days now without incident, though I wouldn’t rush to switch over just yet unless you’re adventurous. I’d watch Eric’s repo if you’re interested in what comes of my efforts.

How to Scale WordPress (WordPress Phoenix)

Today, Chris Lauzon (@squireX2) and I presented a talk at WordCamp Phoenix entitled How to Scale WordPress. Here’s how we described our talk:

Developing and managing an optimized WordPress site can be challenging for anyone not familiar with how to scale a site. This presentation will cover some of the basics of putting together a WordPress site designed for excellent performance and scalability, followed by discussion about more advanced infrastructure topics.

Running a high-scale WordPress site starts with code optimization, including effective use of WordPress’ APIs. We’ll discuss WP_Query and the advantages of using it instead of direct database queries. We’ll also delve into the appropriate and effective use of WordPress’ two native caching APIs, which will lead into the infrastructure portion of our talk.

There are a million options when it comes to hosting your WordPress site, such as shared hosting, managed hosting, VPS, etc. Each has its advantages, which we’ll explore while discussing when stepping up to the next level becomes appropriate. We will also cover different methods of caching, including using database optimization methods, and implementing a content delivery network (CDN).

Our slides are available at http://goo.gl/p92Ja. The video is available at http://wordpress.tv/2012/03/04/erick-hitter-chris-lauzon-how-to-scale-wordpress/.

Caching and Scaling Using Fragment Caching (WordCamp Miami)

This morning, I delivered a revised version of my caching presentation from last November’s Boston WordPress meetup. Using what I’ve learned working on the WordPress.com VIP platform, this presentation discusses caching techniques applicable to WordPress installations of almost any size.

The HTML version of my slides are available at http://slides.ethitter.com/wcmia-caching-scaling-2012-02-18/. A PDF version is available on SlideShare and is embedded below.

Caching, Scaling, and What I’ve Learned from WordPress.com VIP

Last night, I gave a talk at the Boston WordPress Meetup that talked about caching and scaling WordPress. Using what I’ve learned working on the WordPress.com VIP platform, this presentation discusses caching techniques applicable to WordPress installations of almost any size.

The slides from my talk are embedded below and available on Slideshare. The video is also available below.