Picture the scene. You’ve spent weeks and months working on your WordPress blog, carefully crafting some great blog posts about a subject that’s close to your heart. You’ve found or built a great WordPress theme that does a great job showcasing your content to the world. You’ve checked out countless Top 10 lists telling you about all the best plugins to use to make your blog the best blog it can be. You’re ready to take on the world. You slowly build a bit of a following to your site – building traffic day by day. A small trickle at first, maybe just a handful of visitors and not a single comment. But all the time you’re becoming a better writer. You get used to blogging. It becomes a habit. That trickle of users becomes a bit more steady and now you’re getting a bit more momentum. You’re traffic is still small but it’s growing all the time. Then one day you write a blog post that gets picked up by someone big and BAM! Traffic overload! It could be a write up by someone over at one of the big tech blogs like Mashable or Techcrunch. Or it could be a retweet from a major influencer in your market – or maybe both. All of a sudden you have a blog post that’s getting retweets and shares to beat the band. In a couple of hours you get more traffic than you’ve gotten in months – maybe more than you’ve ever gotten before. At first everything looks rosy. Just as you start to think about how you’re going to spend all those benjamins that will inevitably follow this new found deluge of traffic you notice something is up with your blog.
It’s not loading. Wait it is. Just realllly sloowwwwwlllyy. Weird. Everything was ok a few hours ago. You hit refresh. That little loading icon keeps on spinning. Weird 500 “a problem had occurred” errors start randomly appearing. It’s that damn webhost you convince yourself. Panic stricken about all those eyeballs who are invariably seeing that little loading icon while trying to access your words of wisdom you race to your web hosts live chat customer support. You tell them something is up with your blog and demand it to be fixed immediately. What they tell you breaks your heart. “There’s nothing wrong with our servers Sir. You’re running php scripts that are consuming too much memory on your account.” How can that be you wonder. After all you’re using one of the best shared hosting web hosts around who everyone told you is the best thing since sliced bread. You’re running the latest and greatest version of WordPress. Everything should be hunky dory you think. You’re left with the option of upgrading your account to a super duper expensive dedicated account to handle this influx of traffic – or worse still – your account being cancelled by your web host because you’re using excessive bandwidth. At this point you’re about ready to explode. All your hard work to build a following on your blog and finally get some recognition in the world has ended badly. Really badly. Your web host has let you down. WordPress has let you down. A lost opportunity.
Then you wake suddenly and realise it was all just a REALLY bad nightmare. Phew! Thankfully you had read this post series a few weeks before and were smart enough to get yourself a truly kickass web host and a WordPress configuration capable of handling hundreds of thousands of visitors every day without much of a blip on your server – and without paying an absolute fortune to do so. Huzzah!
Enter the High Performance WordPress Guide
Ok, so this is a bit of an exaggerated intro, but website owners running WordPress are faced with this nightmarish scenario every day. I’m writing this post series for a few reasons:
- to help you setup the best possible hosting environment for your WordPress based website/blog/soapbox,
- to help you prepare for a spike in traffic to your website, and, most importantly
- to help you avoid the nightmare scenario above.
Not all blogs will experience a massive spike in traffic. And that’s ok. For those who do experience it – well done! It’s a bit like winning the content lottery. You won’t make a million dollars from a traffic spike (unless you get a REALLY REALLY REALLY big traffic spike and you’ve got some seriously shit hot ad networks or some shit hot product!). Let’s assume for now the content lottery is enough of a reward for you. You’re being rewarded for your writing and for that you should be delighted. A spike in traffic to your website is something that you should be able to rejoice in – not have a panic attack. It’s should be something that gives your website a shot in the arm – not a killer blow.
The facts are very simple. If you operate a self hosted WordPress website on a shared hosting platform, chances are that should your website explode in popularity all of a sudden, you could be faced with the nightmare scenario we’ve just described. WordPress is great – but it’s not configured and optimised for scale out of the box.
The reality is that even if you think you’re website will never have thousands of visitors a day right now – the beauty of the web means that it could have – on any given day – at any given time – and if you’re serious about your blog, you should be prepared for it to happen.
This is what the High Performance WordPress Guide is all about. Your WordPress setup will go from zero to hero if you follow our weekly tutorials on how to configure the best damn WordPress setup that a little bit of time and the smallest amount of money possible will get you. So let’s dive in with Part 1.
Part 1 – Web Host Selection
The web hosting business is vast. There are literally thousands of options. You can spend days, weeks and months evaluating what’s best to meet your needs. Let’s short circuit that process. Why? Well I’ve spent those days, weeks, months AND years using dozens of different providers who all claimed to be the best.
Bye Bye Shared Hosting!
We’re going to significantly reduce the number of potential hosting vendors by removing ALL shared hosting options. Why? Simply put, shared hosts will never give you the flexibility you need to tune and configure a server for optimal WordPress performance. Yes you will be able to install some or all of the big WordPress caching plugins but after that your hands will be pretty much tied. Caching plugins will only go so far. Don’t get me wrong – shared hosting is a great option for some websites. If you’re running a personal blog or really small business website where downtime will not adversely impact on your business then fire away with shared hosting. But pretty much the rest of this guide will not be for you. Our starting assumption here is that you’re happy to move away from a shared hosting environment to a Virtual Private Server (VPS).
Virtualise me Baby!
While VPS servers are not a new technology, they have become more accessible in recent years as the cost per month becomes closer to what people are used to paying for shared hosting. As a result, the number of VPS providers is exploding at the moment. Chances are if you’re using a shared host at the moment, they may have a VPS option. Let me save you some time by identifying what I think are the best VPS providers for WordPress hosting.
Linode is our top recommendation for low cost blisteringly fast VPS servers. I don’t look beyond them for any of my hosting needs anymore. For the purposes of this post series, I will be assuming you select Linode as your hosting environment. If you don’t trust my judgement. No problemo – make your own decision on what you think is best. Three things stand out for me with Linode:
- World class customer support – I’ve frequently had fairly complex support tickets responded to within a minute or two with clear instructions as to how to solve my problem. My support tickets have never been about site uptime either. In fact, I’ve had some servers with 100% uptime for over 7 months since I started using Linode.
- Support Community – There is a great support forum with many active power users who are on hand to offer their assistance and expertise when it comes to highly specialised queries about performance tuning.
- Cost – the entry level Linode plan – Linode 512 – is $19.95 per month. This is probably a few dollars more than what you’re paying for with a shared host. But believe me, it’s totally worth it. The Linode 512 plan is what we’ll be assuming you’re using for this post series.
Other VPS recommendations
- Slicehost – Great alternative to Linode. Slightly more expensive. They have a great support community too and a great Library of articles. Rackspace (who own Slicehost) look to be in the process of rolling Slicehost back into Rackspace Cloud which is a crazy decision if you ask me and puts the long term health of Slicehost into question.
- Amazon EC2 – It’s hard to ignore Amazon as a really good option for WordPress VPS hosting. Some of the world’s most popular websites are running on EC2. Amazon also have some of the smartest engineers in the world leading the Cloud Computing revolution. There’s also the added benefit of a Free Usage Tier for new users which gives you 12 months free limited resource usage on the EC2 platform. More than enough time to experiment with a VPS/cloud environment before you make the jump if you like that sort of thing. Amazon have had their troubles of late with a massive outage and the lack of live chat/phone support is always a disadvantage for me.
- Rackspace Cloud – Some people hate Rackspace Cloud – others swear by it. I have a number of clients who I manage Rackspace Clouds on their behalf. Their control panel needs some serious work to bring it in line with the ease of use of Linode. (in fact they should just use the Slicehost one that they already own!) The standout features for Rackspace Cloud are the excellent support services they offer. Paying that little extra for the option of live chat and phone support will be important for some.
- VPS.net – I’ve included VPS.net despite having grave reservations about their tech platforms of late. About 12 months ago, I loved VPS.net. I had all my big sites running there. Many key influencers in the WordPress community run big big sites on VPS.net like Joost, WooThemes and Chris Pearson use VPS.net and for that reason alone you might want to check them out. But for now I’ve lost confidence in their service and can’t recommend them at this time. Why put them on this so? Chances are if you’ve been doing VPS research you’ve probably come across glowing reviews of VPS.net from the last 12-24 months – I just want to give people a heads up as to what their service has been like the last 3-4 months in 2011.
So in summary, save yourself hours of research and just go with Linode. Now let’s move on your server selection and setup.
Server OS and Location Selection
There’s a few things we need to decide on that are pretty fundamental to our server setup right at the start.
Account Plan Selection
We firmly believe that less is more. We’re going to get ourselves a shiny new VPS with just 512MB of RAM to start us off. 512MB will keep us disciplined and show us just how much traffic you can throw at an entry level VPS account once you’re running the right kind of web server and caching config.
Geographical location is an important consideration for your overall website speed. As a general rule of thumb you should pick a server location that is closest to the biggest chunk of your users. Linode offer 5 locations around the globe. 3 in the US, 1 in the UK and 1 in Canada. If you’re unsure which location to go with, I’d select Newark, New Jersey as it’s a good central location for both sides of the Atlantic.
Operating System (OS) Selection
I’m not a Linux expert by any stretch of the imagination but I have used RedHat, CentOS and Ubuntu quite a lot over the past decade. For me, Ubuntu has a lot going for it in terms of ease of use for a Linux newbie. Therefore, Ubuntu is what I’m recommending you select as your operating system for your new server. For the purpose of this tutorial series I’ve installed and configured the 32 bit flavour of Ubuntu 10.10 (Maverick Meerkat). Why 32 bit and not 64 bit? Well we’re only using 512MB of RAM and apparently the 32 bit flavour of Ubuntu works better on servers with lower RAM. If you’re intending on rolling out a server with 2GB+ of RAM then the 64 bit version is definitely the way to go. As of the time of writing 11.04 is in the wild but I’ve not experimented with it yet so I don’t recommend you do either. Some people might also suggest you use 10.04 rather than 10.10 because 10.04 is an LTS release. In my experience there’s not much difference between them and 10.10 is very stable – plus you’ll get newer packages out of the box. Go with 10.10.
So if you’ve gotten this far you’re probably wondering what’s next. If this is your first time operating a VPS account I strongly suggest your read over the wonderful tutorials in the Linode Library – in particular the Getting Started tutorial. In Part 2 we’re going to dive straight into our LEMP configuration and get your nginx powered web server up and running in no time. So sit tight sports fans and see you soon!