Do you want your WordPress site to scale to accommodate high traffic volumes? This week, we published a brand new developer guide, “Scaling WordPress For High Traffic,” written by WP Engine developer Ryan Oeltjenbruns. In it, we arm you with best practices to get your site ready for massive traffic and major success. Here’s an excerpt:
SCALING WORDPRESS FOR HIGH TRAFFIC
Is your site ready for a high traffic event? Say a piece of content goes viral, or gets upvoted on HackerNews; can your site handle it, or will it topple over? Don’t let your site’s success be its downfall. Whether you’re a developer or a website owner, you want your site to stand up to any amount of traffic. In this developer guide, we walk you through steps you can take and tools you can use to fortify your site and ensure it will stay up and stay speedy amid a barrage of visitors. Following these steps will help you boost page load speed and guarantee your site can scale no matter how much traffic comes your way.
Do you want to perk up your page load speeds and quickly scale your site? If so, it’s time to roll up your sleeves, because we’re about to dive into how to scale WordPress for high traffic.
By breaking down the process of how your site delivers content to your users, we can identify the elements that may be holding your site back, and help you better prepare for peak or spiky traffic.
First, we’ll dive into some of the major performance quirks that sites experience as they gain traction. Then we’ll look at what may be hogging your server resources.
Plugins and themes can sometimes perform fine at certain traffic levels, but as visits increase and peak times hit, server resources can be pushed beyond their breaking points.
Think of it like this: there is only so much a server can work through. Eventually the server will have more work to do than it can accomplish, and it will become overloaded.
Serving high traffic
Hightrafficaphobia got you down? Never! The solution to scale is simple: less is more.
Ensure that the request to your site requires as few server resources and as little effort as possible to render and serve. To do this: serve less, serve more efficiently, or both. Let’s look at both the backend (e.g. MySQL) and the frontend to see where we can start tuning.
KEEP YOUR OPTIONS TABLE UNDER CONTROL
Overloading the Options table
In the Options table, the option_value is built to be a LONGTEXT column. In MySQL, this translates to columns that can store up to 4GB of data in a single row, but just because you can store that much data in one column doesn’t mean you should.
Autoloaded queries can be the silent page speed killer. If you’re having page load speed issues, try identifying how many queries are being autoloaded.
These queries assume the default table prefix of “wp_”
mysql> SELECT count(*) FROM wp_options WHERE autoload=’yes’;
A good rule of thumb is to shoot for fewer than 200 autoloaded queries on any given page (but having more than 200 isn’t the end of the world). Usually, an excessive amount of autoloaded queries indicates an established blog that still carries weight from plugins and themes of yesteryear. Help your blog chug along by getting rid of those old options!
To prep your site for massive traffic and avoid disaster, download the full Scaling WordPress For High Traffic developer guide now.