Learn why people are moving their WordPress setups to CyberPanel

CyberPanel is a web hosting control panel based on OpenLiteSpeed. As of July 2018, WordPress is the most used content management system (~60% by w3techs survey). WordPress contains a lot of PHP code which means sometimes it is resource heavy on the server. This is why people move towards cache plugins. Cache plugins are a big relief for resource-heavy WordPress websites, but there are too many plugins to choose from. So choosing the right WordPress cache plugin is not an easy task, but as you are reading this article today, you are in luck.

Caching and WordPress

Most of the WordPress cache plugins are PHP-side caches, meaning PHP is still forked, but when there is a cache hit all the heavy lifting is avoided and a page is served from cache. In this approach, PHP is still a bottleneck when there are multiple sites or server is under high load.

People use Varnish as a reverse proxy to fix this issue, but still running a proxy is another layer and thus more processing, resulting in a high server loads. Now there’s OpenLiteSpeed with a built-in cache module named LSCache. The LiteSpeed Cache WordPress plugin talks directly with this server-side module to generate static copies of your WordPress websites. If there is a cache hit for a page, PHP is never forked and there is no proxy layer.

Apart from that, the LiteSpeed Cache plugin has a very intelligent cache invalidation mechanism as well as many other features including Image Optimization, CDN support and much more. Let see how we can deploy a WordPress website using CyberPanel on OpenLiteSpeed along with the LiteSpeed WordPress cache plugin.

Step 1: Install CyberPanel!

CyberPanel makes deployment of WordPress sites on OpenLiteSpeed a breeze, with very few clicks your WordPress site is ready to use, the hard part is to make a site heavy enough that it can break the LSCache stack.

This one-liner can help you start CyberPanel installation:

sh <(curl https://cyberpanel.net/install.sh || wget -O - https://cyberpanel.net/install.sh)

This script will ask you if you want to install a single or double instance MySQL version of CyberPanel. I recommend a single instance version if the RAM is less then 1GB (512MB).

Step 2: Create a Website!

Before moving forward, we need to create a website first. Once CyberPanel is successfully installed you can access the CyberPanel interface at

https://[Server IP]:8090

Login as admin with the default password 1234567. It is HIGHLY recommended to change your password after doing so via Edit Profile.

create website

From the left menu click ‘Create Website’, enter your domain name and the other details and select PHP. It is recommended to select PHP version 7.0 or above.

Once the website is successfully created we can then set up a WordPress site using CyberPanel auto installer.

Step 4: Install WordPress!

To install WordPress navigate to:

https://207.148.121.168:8090/websites/domain.com/wordpressInstall

Replace domain.com with website address you just created in step 3.

Fill in all of the required details. If you choose an empty path, then WordPress will be installed at the doc root of your website. If you choose a custom path, it will be installed relative to doc root.

After you are satisfied, you can click Install Now. This will install WordPress along with the LiteSpeed Cache Plugin.

Step 5: Verify Cache is working properly!

You can verify via curl command if the cache is working properly.

curl http://domain.com --head
HTTP/1.1 200 OK
X-Powered-By: PHP/7.0.30
Content-Type: text/html; charset=UTF-8
X-Litespeed-Cache: hit 
Date: Mon, 23 Jul 2018 19:38:59 GMT
Server: LiteSpeed
Connection: Keep-Alive

On your first run of curl you will see X-Litespeed-Cache: miss (this gives OpenLiteSpeed a chance to cache your page). When you run the curl command again you will see X-Litespeed-Cache: hit, which means the cache is working as expected.

Step 6: Advance Cache Configurations!

With out of the box CyberPanel setup you are already getting the benefits of full-page cache. But if you want to go an extra mile you can do further optimizations via the LSCache plugin.

Image Optimization, Lazy Loading, and CDN

If you want to use the JetPack CDN that is totally fine. LSCache does not conflict with JetPack image CDN. To use it, set Image CDN to On (default is Off). JetPack also optimizes images on the fly so you don’t need image optimization either.

Minification, Combination, and HTTP/2 Push

LiteSpeed Cache plugin also enables you to do Minification and Combination, which is also compatible with OpenLiteSpeed, you can read more about this feature here.

Step 7: Benchmarks (CyberPanel stack vs NGINX Stack)!

Before we jump to any conclusions we need to run benchmarks and find out the actual performance. All the servers run following hardware (CyberPanel and NGINX Stack).

  • Ram: 1GB
  • 1 CPU Core.
  • 25GB SSD.
  • Same location and same provider.

Actual Hardware configs:

cat /proc/cpuinfo
processor: 0
vendor_id: GenuineIntel
cpu family: 6
model: 61
model name: Virtual CPU a7769a6388d5
stepping: 2
microcode: 0x1
cpu MHz: 2394.454
cache size: 16384 KB
physical id: 0
siblings: 1
core id: 0
cpu cores: 1
apicid: 0
initial apicid: 0
fpu: yes
fpu_exception: yes
cpuid level: 13
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc rep_good nopl xtopology eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm fsgsbase bmi1 avx2 smep bmi2 erms invpcid xsaveopt arat
bogomips: 4788.90
clflush size: 64
cache_alignment: 64
address sizes: 40 bits physical, 48 bits virtual
power management:

Benchmark command:

ab -n 5000 -k -H "Accept-Encoding: gzip,deflate" -c 25 example.com/path

CyberPanel (OpenLiteSpeed with LSCache)

ab -n 5000 -k -H "Accept-Encoding: gzip,deflate" -c 25 http://domain.com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking domain.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software:        LiteSpeed
Server Hostname:        domain.com
Server Port:            80

Document Path:          /
Document Length:        17841 bytes

Concurrency Level:      25
Time taken for tests:   1.826 seconds
Complete requests:      5000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    5000
Total transferred:      90800000 bytes
HTML transferred:       89205000 bytes
Requests per second:    2737.68 [#/sec] (mean)
Time per request:       9.132 [ms] (mean)
Time per request:       0.365 [ms] (mean, across all concurrent requests)
Transfer rate:          48551.02 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.1      0       2
Processing:     1    9   5.9      7      60
Waiting:        1    8   5.2      6      40
Total:          1    9   5.9      7      60

Percentage of the requests served within a certain time (ms)
  50%      7
  66%      9
  75%     11
  80%     12
  90%     16
  95%     21
  98%     26
  99%     34
 100%     60 (longest request)

NGINX Stack (PHP-FPM and W3 Total Cache)

ab -n 5000 -k -H "Accept-Encoding: gzip,deflate" -c 25 http://domain.com/
This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking domain.com (be patient)
Completed 500 requests
Completed 1000 requests
Completed 1500 requests
Completed 2000 requests
Completed 2500 requests
Completed 3000 requests
Completed 3500 requests
Completed 4000 requests
Completed 4500 requests
Completed 5000 requests
Finished 5000 requests


Server Software:        nginx
Server Hostname:        domain.com
Server Port:            80

Document Path:          /
Document Length:        18374 bytes

Concurrency Level:      25
Time taken for tests:   116.314 seconds
Complete requests:      5000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    0
Total transferred:      93325000 bytes
HTML transferred:       91870000 bytes
Requests per second:    42.99 [#/sec] (mean)
Time per request:       581.570 [ms] (mean)
Time per request:       23.263 [ms] (mean, across all concurrent requests)
Transfer rate:          783.55 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    0   0.4      0      12
Processing:    42  580 224.8    543    3601
Waiting:       40  578 221.2    542    3601
Total:         43  580 224.8    543    3602

Percentage of the requests served within a certain time (ms)
  50%    543
  66%    572
  75%    602
  80%    630
  90%    720
  95%    795
  98%    879
  99%    941
 100%   3602 (longest request)

NGINX stack took 116 seconds compared to CyberPanel OpenLiteSpeed stack which took ~1.8 seconds to complete the same number of requests. Its a great performance boost with out of the box setup.