[1] Secrets of PHP+MySQL Tuning With Ultrafast WordPress Virtual Machine KUSANAGI

In this series of articles, we will explain the middleware and techniques that support Prime Strategy’s free open source Ultrafast WordPress Virtual Machine KUSANAGI (hereby referred to as KUSANAGI). In part 1, we will introduce KUSANAGI and its middleware and acceleration techniques.

About This Column

According to W3Techs statistics, the open source CMS WordPress is used in 26% of the world’s websites, and makes up a 59% majority share of CMS software. From the beginning, WordPress has been offered to everyone for free with a GPL, and its use as a blogging platform spread rapidly, but in recent years its worth as a developing platform and overwhelming market share has seen a rise in its use in the enterprise field as a web application framework.

WordPress is a PHP+MySQL-based dynamic CMS software, and one of its merits is that it can be used as a web system. With its usage increasing in the enterprise field, there has been increasing demand for more performance in regards to speed, and more security, stability, reliability, and availability in high-load environments.

We developed the Ultrafast WordPress Virtual Machine KUSANAGI as an answer to those demands. When compared to a standard LAMP environment, KUSANAGI is capable of executing WordPress at 10-15x the speed.

In this column, which is geared towards infrastructure engineers and application development engineers, we will explain the server techniques and each middleware that KUSANAGI uses to achieve its performance.

KUSANAGI is designed as a high speed execution environment for WordPress, but in reality it can also be used in any CMS software or framework that is based on PHP and MySQL. You can utilize the server techniques explained in this column in any PHP+MySQL system, and even the principles of the WordPress techniques we will delve into can be translated to other PHP+MySQL systems.

KUSANAGI Overview and Features

KUSANAGI was developed by Prime Strategy, and it is a free open source high speed WordPress execution environment based on CentOS 7 available as a virtual machine image (virtual appliance).


As of March 2016, the virtual machine image is available on 9 cloud platforms: Microsoft Azure, IBM SoftLayer, Amazon Web Services, NTT Cloudn, IDC Frontier Cloud, Sakura Internet Cloud, GMO ConoHa, GMO Z.com, and Suzuyo Shinwart S-Port Cloud. It is available for free on all clouds (fees for each cloud service apply).

Its biggest feature is speed. In the results of a performance test conducted on Prime Strategy’s private cloud, at maximum performance with a quad-core CPU, KUSANAGI is capable of executing WordPress in 3 milliseconds with over 1000 requests per second, without using page caching. We compared our results to a standard CentOS 7-based LAMP environment on the same instance and found that KUSANAGI executes WordPress at 10-15x faster.

However, since KUSANAGI was originally developed with the needs of enterprises in mind, there are several other objectives that we have in order to satisfy the requirements in the enterprise field.

For example, KUSANAGI’s middleware and libraries are all managed by a yum repository, and you can update using the command “yum update” to get the latest technology, such as HTTP/2 and Let’s Encrypt, and newest security patches as they are released.

Also, we only use standard and mainstream technology for our middleware and OS in order to eliminate dependency on any one environment, and prevent KUSANAGI from turning into a black box.

Furthermore, we use Apache and Nginx for web servers, and PHP 7, PHP 5, and HHVM for PHP processors, so that with a single command you can create an Apache+PHP 7 or Nginx+HHVM environment with the same virtual machine. This configuration can respond to the needs in any situation, such as wanting to use htaccess, wanting to test compatibility with middleware using the same virtual machine, or wanting to have a fail-safe when trying out new middleware.

Because of this, learning about the server techniques that comprise KUSANAGI means learning about the various new technologies available, and you will gain standard knowledge that is not dependent on a single platform.

Some of you may be wondering how KUSANAGI can perform so well when it only uses CentOS 7 and other standard technology. It is because KUSANAGI has been fine-tuned to high speeds on every layer, from the OS to middleware to applications.

With seven components comprising the web application, if you theorize improving performance by 50% by tuning each component, that means that once you have tuned each of them to 150% you will have an overall performance boost of 17x the original (1.57). This is the secret to KUSANAGI. In this column, we will discuss each layer of the server techniques supporting KUSANAGI.