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 1, I will explore why speed is important, and explain the basic components that comprise page load time and requests per second. --Kengyu Nakamura, Prime Strategy Co., Ltd.
Why the need for speed?
WordPress is the most-used content management system (CMS) software in the world. According to W3Techs, it composes 24% of all websites on the net, and a 60% share in CMS-based sites.
WordPress has many merits, including development productivity, web standard source code, and a management interface that excels in design and user-friendliness. Thanks to these features, its usage is rapidly increasing for CMS-based business sites and media sites.
On the other hand, because of its dynamic nature as a CMS software created with PHP and MySQL, WordPress lacks in speed compared to purely HTML counterparts.
Moreover, in recent years, the trend for CPU development is to have multiple cores in the 4GHz range. Since WordPress uses single process sequential execution, it is difficult to improve its performance in an environment centrally based on hardware processing speed.
In these circumstances, there is a growing need to speed up WordPress itself, whether for user experience or SEO, or simply to increase pages views by decreasing site loading times.
Overview of this series
In this series, Simply Fast WordPress, I will explain the techniques and mindset needed to make WordPress operate at high speeds.
Using CentOS 7 as a base with HHVM, Nginx, Apache, PHP, MariaDB and other middleware, you will learn the techniques to manage bottlenecking and improve the speed of WordPress with only the server operating system. In later articles, I will introduce our company’s WordPress virtual machine KUSANAGI and how it can simplify this process.
In this article, you will learn the basic ideas behind accelerating WordPress.
This series is focused on WordPress, but you will also learn techniques about CentOS 7, HHVM, Nginx, Apache, PHP, and MariaDB, so you can use your knowledge with other PHP/MySQL-based software.
How to speed up WordPress
There are two major areas to keep in mind regarding WordPress acceleration.
The first area is “server side”. Specifically, the processing time needed for an HTTP request to be sent from the browser to the server, generate the information needed to display WordPress, and then send that information back to the browser. The following graph illustrates this process.
This series will mostly deal with server-side acceleration of WordPress.
Page load time and requests per second
The page load time shows the time it takes for the information gathered from the WordPress server by the HTTP request to be displayed by the browser as HTML.
Requests per second is how many times WordPress can be executed concurrently in one second.
Page load time and requests per second have direct correlation.
For example, if you launch WordPress on a 1-core CPU application server and the page load time is 500ms (1000ms = 1 second), you can assume that the requests per second will be 1000ms divided by 500ms, or 2. This is a simplification of course, and does not take into account transfer time. Also, it presumes the most efficient scenario of a single access in regards to WordPress’ execution time.
If you speed up WordPress and achieve a page load time of 50ms, your requests per second becomes 20, or 1000ms divided by 50ms. Then if you increase your server’s CPU to 4 cores, your requests per second will increase to 80 (20x4) but the page load time will remain at 50ms. This is because WordPress’ sequential single process nature will only utilize 1 CPU core. It is not capable of parallel execution.You can understand two things from this:
1. Requests per second will increase as page load time decreases
2. Increasing CPU cores or front end application servers will increase requests per second but not decrease page load time
In your own experiences, you may have thought about moving your site to a server with more CPU cores or considered switching to autoscaling. While this may increase your requests per second, it will not decrease your page load time. A slow website will not get faster without fine-tuning.
Page load time is based on relayed information before your browser renders it. Therefore, it is also important to consider requests per second in regard to optimizing your user experience and SEO.
Page load time components
The following graph shows each component that affects page load time. You will speed up WordPress by speeding up individual components.
1. HTTP request time
The time it takes for the browser’s HTTP request to reach the application server.
2. PHP execution time
The time it takes for the PHP comprising WordPress to be executed by the server.
3. MySQL execution time
The time it takes for SQL queries to be executed by the database or server.
4. Translation execution time
Since WordPress was originally written in American English, any other language installation, including British and Australian English, is translated in real time. Because of this, the cost of translation time on site speed is comparatively large. Strictly speaking, this is part of PHP and its execution time.
5. HTTP response time
The time it takes for the site information to reach the browser from the server.
Page load time reduction is essential
In this series, we will mainly deal with accelerating WordPress server-side. In order to do this, it is important that you understand the mechanics of page load time and requests per second.
It is also important to think of user experience and SEO.
Page load time can be understood by taking a look at each of the components that affect it. If you can speed up each individual component, you can speed up WordPress.
With the next article, I will go into the various basic methods to accelerate WordPress.