Simply Fast WordPress [2] Speeding up WordPress 250% with PHP Accelerator APC

This is a series of articles explaining how to speed up WordPress, the use of which is growing rapidly for CMS-based business sites and media sites. In part 2, I will explain how to speed up WordPress 250% by using the PHP accelerator APC. --Kengyu Nakamura, Prime Strategy Co., Ltd.

Last time, I discussed the need to speed up WordPress and the basic understanding required to do so. To speed up WordPress server side, you must have a basic understanding of page load time and requests per second. You now know that page load time is determined by:

1.    HTTP request time
2.    PHP execution time
3.    MySQL execution time
4.    Translation execution time
5.    HTTP response time

If you speed up each area you will speed up WordPress.

Using WordPress installed with CentOS 7 on Amazon Web Service’s (AWS) virtual cloud server Elastic Compute Cloud (EC2), I will explain the various techniques to speed up your website server side.

In this article, I will start with launching and installing CentOS 7, then teach you how to measure your results using benchmarking. You will install the PHP accelerator APC (Alternative PHP Cache) and see how your speed changes.

Launch CentOS 7 on an AWS EC2

First, we will prepare the server environment. If you have an AWS account, click “EC2” on the Management Console, then click “Launch Instance”, and search for “CentOS 7 (x86_64) with Updates HVM” in the Marketplace. Launch your instance.

If you don’t wish to use AWS, you can install CentOS 7 however you like and continue to use this guide in the same manner. Be aware that things such as your SSH login information and use of the sudo command will differ, and your server specs will produce varied benchmarking results.

Selecting CentOS 7 from the AWS Marketplace
Selecting CentOS 7 from the AWS Marketplace

Please choose a t2.medium instance. The t2.medium is a standard instance type that has a dual-core CPU and 4GB memory.

T2 instances use CPU Credits to utilize bursts of CPU performance to 100% in a single core. CPU Credits are accumulated when your instance is idle and does not go above baseline performance, and then they are used to burst during heavier loads. CPU Credits are generally accumulated when there is little traffic to the server, such as late night and early morning. And they will be used during peak traffic hours in the daytime. Once your CPU Credits have been used up, your instance’s performance will not go above baseline level. The T2 instances are specialized for cloud computing that uses resources only when needed.

The purpose of speeding up WordPress is so that you can achieve a high level of cost performance every time someone visits your site. It will increase page views, improve user experience, and optimize your search engine results. From this point of view, the T2 instances are the best-suited for an accelerated WordPress site.

Continue with launching your instance. Configure your security group with SSH, HTTP, and HTTPS rules. Then create a new key pair to log in to your instance via SSH, or use an existing key pair.

Once your instance is finished launching, you can assign a fixed public IP address from the “Elastic IP” menu and configure your public DNS. If you choose to use an Elastic IP, select “Allocate New Address” and change the network platform from EC2 to VPC.

EC2 Management Console after an Elastic IP has been assigned
EC2 Management Console after an Elastic IP has been assigned