Announcing WP SureStack, a WordPress infrastructure leveraging the power of the AWS cloud
We’re excited to announce our latest product, WP SureStack, which is available now on the AWS marketplace.
While a VPS like Amazon Lightsail can be an easy place to start, it can be difficult to scale. WP SureStack takes the VPS architecture to the next level by integrating with AWS services. It is designed to handle heavy traffic in production environments, while being performant, stable, and easy to maintain.
WP SureStack is a CloudFormation template that spins up a fully configured WordPress infrastructure in minutes. WP SureStack integrates WordPress with AWS services like Aurora, S3, CloudFront, and CloudWatch, so you can take full advantage of the cloud, regardless of your comfort level with Linux or AWS. It also uses FastCGI Cache and other optimizations to help you get the most out of your server.
WP SureStack spins up an entire WordPress environment from scratch, which looks something like this:
The Database is served by Aurora, a managed database service.
The entire network is provisioned, including a VPC, public and private subnets, Internet Gateway, Elastic IP, and route tables.
Image assets are copied to S3 and served by a CloudFront CDN.
We’ll go into more detail on how everything works in the remainder of this blog post.
1. Full page caching and cache invalidation
FastCGI Cache gives you the biggest bang for your buck when it comes to performance. It works by caching full dynamic pages at the web server level. Once pages are cached, your WordPress site performs like a static site.
Nginx serves static HTML for cached pages. These pages load much faster because you’re not involving PHP, WordPress, or even the database. This in turn frees up resources, so your server can handle a lot more concurrent users.
FastCGI Cache is built into Nginx. Although FastCGI Cache does require some configuration, the WP SureStack CloudFormation template handles this for you. To learn more about FastCGI Cache configuration options, check out this tutorial from Digital Ocean.
Caching pages is the easy part — the challenge is invalidating the cache. There are existing plugins that require a custom Nginx build, or lack certain features. To overcome this hurdle, we developed a free WordPress plugin called Cache Sniper for Nginx that automatically purges the cache for a single page when there’s an update or comment. Here’s a full list of features:
- Works with the default Nginx install
- Purges the entire cache
- Purges the cache for a single page
- Automatically purges the cache for a single page whenever it is updated
- Automatically purges the cache for a single page whenever it receives a comment
- Supports configuration via the WP CLI
WP SureStack takes care installing and configuring the Cache Sniper for Nginx WordPress plugin, so both caching and invalidation work on first launch.
2. Maintenance-free database
Amazon Aurora can help improve your database layer in several ways. It’s a managed service, so you don’t have to worry about managing or maintaining the database. Backups are automated, and you can even restore your database from a single point in time. Storage scales automatically, so you don’t have to pre-provision storage. And you can achieve high-availability at the database layer just by spinning up an instance replica in another availability zone (Aurora does the hard work of syncing the storage layer across AZs).
While it’s tempting to use a VPS that combines your web server and database on the same box, there are some drawbacks to this approach. You have to be more diligent about security, since your database is on a public-facing server. You have to spend ongoing maintenance hours on database administration — patching, monitoring, and performing backups. And there’s no way to scale out because there is so much server state.
WP SureStack provisions an Aurora DB cluster inside a private subnet, which is a security best practice. The CloudFormation template also sets up all the networking: VPC, route tables, public and private subnets, and Internet Gateway (to make a subnet publicly addressable).
3. Object caching
Another good practice is to upload your images to S3, and serve them through CloudFront. S3 protects you against data loss, and CloudFront reduces latency for international site visitors.
It’s risky to store the sole copy of your images assets on the local server. You can’t always prevent accidental deletions, but you can take measures to help recover quickly. One best practice is to automatically copy your images to S3. This gives you a redundant copy of your images assets, and S3 itself is durable storage. Once your files are safely stored on S3, you can protect yourself even further by enabling bucket versioning, which lets you restore files that are deleted or overwritten.
S3 isn’t a CDN, so you want to use CloudFront to serve your images. CloudFront caches static files in edge locations around the world. This reduces latency, especially for overseas site visitors.
The WP SureStack CloudFormation template provisions an S3 bucket and CloudFront CDN. It also uses the W3 Total Cache plugin to connect WordPress to these AWS resources.
4. Server optimizations
WP SureStack provides a couple of server optimizations that makes ongoing maintenance a little bit easier.
First, it creates a swap partition, which gives you some virtual memory to help handle traffic spikes. Without swap space, Linux terminates processes when it runs out of memory, and this can make your server unstable.
And second, it installs CloudWatch monitoring scripts, which report server metrics such as memory, swap, and free disk space. It’s a good idea to set up an alarm or dashboard to let you know when you’re running low on memory or disk space.
How much does WP SureStack cost?
WP SureStack costs as low as 6 cents per hour:
- Aurora (t2.small): $0.041 / hr
- EC2 (t2.micro): $0.0116 / hr
- AMI Software cost: $0.01 / hr
- Other fees: You get charged for data-transfer-out, so this cost depends on your website traffic
The AMI Software cost for WP SureStack is based on the EC2 instance type (see here for pricing details). T2 instances are burstable, and they’re ideal for development and testing. But for production, we recommend running at least an m4.large to handle sustained traffic loads.
WP SureStack can help get your next WordPress site up and running on AWS quickly and easily. WP SureStack does the hard work of integrating WordPress with AWS services like Aurora, S3, and CloudFront. It also comes preconfigured with a powerful caching layer that’s easy to manage. It’s never been easier to spin up a performant WordPress stack that’s optimized for the AWS cloud.
Click here to head over to the AWS Marketplace to launch your instance of WP SureStack.
Also, we’d love to hear your feedback on the product. Email us at the address above or tweet at us @thorntech.