Blog  Subscribe to our RSS feed RSS

Optimizing The Student Room

The Student Room

Site performance can be a complex issue, with all manner of interdependent factors conflicting and cascading in unexpected ways. When one of our clients’ sites starts experiencing problems which can quickly take a toll on their business, we take a methodical approach, examining all of the components that go into a website’s performance, and enacting a point-by-point plan which addresses front and back end issues. Here’s how we developed a solution for The Student Room, a high-traffic forum which ran into trouble after a routine software upgrade.

An Unexpected Problem

The Student Room is the UK’s largest online student community, and is home to over one million users. With over 38 million posts and an average of a million page views per day, TSR’s forums (powered by a highly customized vBulletin installation) need to be as efficient and user-friendly as possible.

The Student Room
The Student Room Forums. Note the fast posting rate and incredibly high numbers of posts.

A problem arose when TSR updated to a new version of vBulletin, however: users’ posting rates took a dramatic 30% drop, even though traffic was increasing. Monitoring revealed that page load times (especially on thread view pages) had increased by roughly 500 milliseconds. While that may not sound like a significant increase, it was enough to radically affect activity on the TSR forums; while the site’s established user base was still visiting, they weren’t interacting with and posting on the site nearly as much.

Most web optimizations involve rectifying obvious, drastic inefficiencies in software, but the problem presented in TSR’s case was a more subtle one: counteracting the effects of a minor and irreversible script update. In response, we fine-tuned the site at two levels: back-end database and server issues, and front-end script and HTML management.

Back-End: Rebuilding Server Architecture

The overarching goal of our back-end optimizations was to to reduce the load time of The Student Room’s main pages to less than 500ms, faster than they’d been even before the slow-down caused by the vBulletin upgrade. Here’s a breakdown of how we went about achieving that.

The Student Room
Server optimization is crucial to any plans for decreasing load times.

Server Infrastructure

  • We investigated TSR’s existing cluster setup and checked for bottlenecks using metrics like hard drive and memory utilization, processing power and bandwidth.

Code Profiling

  • We profiled PHP code using programs like XDebug and Cachegrind, New Relic‘s monitoring suite, and custom written profiling scripts to find bottlenecks and inefficient code.
  • We checked for and rewrote inefficient code.

MySQL Query Optimization

  • We investigatied the frequency and distribution of SQL queries, and optimized slow queries.
  • We reviewed and optimized query caching.
  • We optimized column indexing.
  • We reviewed and optimized the cluster’s MySQL server configuration to suit this specific use case.

Memcached

We cached heavy SQL queries and expensive functionality on a dedicated Memcached server within the cluster to reduce load on other back-end servers. After this, we reviewed and tested various setups to optimize this server. This process in particular yielded the most significant performance impact.

  • We studied and tested multiple Memcached PHP client libraries and decided to switch to the faster Memcached library.
  • We implemented support for the Memcached PHP client library in vBulletin.
  • We consolidated cached objects to reduce overhead.

Varnish

Varnish is a web application accelerator which caches rendered HTML pages and static content to speed up delivery and reduce server load by caching frequently accessed content, which we also integrated into TSR’s cluster.

  • We implemented Varnish caching of rendered forum pages for guest users, drastically lowering load times.
  • We also tweaked server settings in order to maximise Varnish’s impact.

The Student Room
Having a technical partner who can get the most out of your site’s servers can open new doors for your web performance.

Front-End: Designing a Smoother User Experience

We weren’t satisfied with simply retooling The Student Room’s server architecture. We set a goal of displaying the content of the first post in a thread in 2.5 seconds for a uncached page on a user’s browser, and took the following steps to make that happen.

  • First, we profiled the site’s existing front-end performance using GTMetrix, New Relic and SmokePing.
  • We reordered JavaScript and CSS to optimize the simultaneous downloading and processing of scripts and style sheets.
  • We performed JavaScript and CSS minification, removing superfluous data like whitespace and comments.
  • We optimized the distribution of static content between static servers to allow browsers to download more resources in parallel.
  • We consolidated images in sprites
  • .

  • 3rd party scripts (such as tracking code and social media buttons) are now loaded separately from and simultaneous to core pages, and are loaded in asynchronous order to prevent pauses in rendering of the core page.

The Results: Faster Loading, Less Server Costs

These measures prompted immediate and dramatic results. Main pages load times were reduced to 500 milliseconds; an over 100% speed increase for some pages.

The Student Room - Load Time

Perhaps most importantly, all of these changes had a marked effect on the original issue at stake: user participation on The Student Room. Posting rates returned to and exceeded pre-upgrade levels.

In addition to making their userbase happy, our optimization gave the people working at The Student Room plenty to smile about. Our back-end work decreased server load which allows for more traffic on the same hardware. The bottom line? A sleeker, faster site which costs substantially less to maintain.

The Student Room - Server Load
Charting load times.

Here’s what the team at The Student Room had to say about the optimization:

“The Student Room Group and Gossamer Threads have been working together for many years, overcoming countless technical challenges as the popularity and scale of www.thestudentroom.co.uk has grown. Websites need to be as responsive as possible and today’s sophisticated users demand speed. The upgrade caused a significant slowdown and our members reacted accordingly. We needed to act quickly and, with a multi-disciplined team implementing cutting edge optimization strategies, together with some state of the art hardware, GT greatly improved our response times, and variance was pretty much removed entirely.”

Get More From Your Site

As we’ve seen, website optimization can be a win-win scenario for both you and your users. Interested in finding out what a tune-up could do for your site? Let’s talk.