Table of Contents

Should I Turn on Both PageSpeed and LSCache at the Same Time?

In some cases, you may want to know if mod_pagespeed works with LiteSpeed Cache. Let's find out with a testing benchmark experiment.

Introduction

Before we dive into the differences between LSCache and PageSpeed, let's take a quick look at the background of these two functions and their general characteristics.

Test Environment

Hardware

  1. Client: 4 cores of Intel(R) Xeon(R)E7-4870 @ 2.40GHz CPU + 4G RAM
  2. Server: 4 cores of Intel(R) Xeon(R)E7-4870 @ 2.40GHz CPU + 4G RAM

OS and Settings

  1. Client:
    1. CentOS 7*64
  2. Server
    1. CentOS 7*64
    2. LSWS v5.2
      1. Disable Keep alive
      2. Increase max connection 200000
      3. WooCommerce demo data, page size = 68k
    3. WP-Plugin v1.2.0.1
    4. mod_pagespeed rules
      1. pagespeed FileCachePath /tmp/lshttpd/pagespeed;
        pagespeed RewriteLevel CoreFilters;	
    5. htop v2.0.2

Testing Method

There are four scenarios in our experiment:

  1. Do not use LSCache or mod_pagespeed
  2. Only use mod_pagespeed
  3. Only use LSCache
  4. Use both LSCache and mod_pagespeed

Regardless of whether we are testing with LSCache or mod_pagespeed, we follow the same procedure:

Benchmarks

Comparison Table

Case LSCache Mod_PageSpeed Requests/s Memory usage(MB) CPU Load 1min
1 X X 16 210 7.33
2 X O 21 300 8.42
3 O X 8152 1 2.50
4 O O 4469 100 3.52

Comparison Chart

Requests per second

LSCache clearly dominates in the raw number of requests per second it can serve. The difference between cases with LSCache and cases without LSCache is too large to chart them side-by-side, so we've created two separate charts.

CPU Load

Memory usage


Remember, the results shown are good only for measuring relative (and not absolute) performance, as the tests were conducted locally on the server.

Conclusion

After going over the benchmark testing of both LSCache and mod_pagespeed enabled cases, you may have a better idea of which combination is more suited to your needs.

  1. Using LSCache and mod_pagespeed together is a workable scenario, but it will slow down your page loading time and increase CPU and Memory usage. If your LSWS includes LiteSpeed Cache already, then you don't need to enable the PageSpeed module to shorten the loading time.
  2. If your LSWS does not include LSCache, then PageSpeed does speed up your site by around 20%. It will require significant resources and should be avoided in shared hosting environment. For more information, please see Using a Control Panel in a Shared Hosting Environment.
  3. Seeing these results, you may want to add LSCache to your existing LSWS license.

We welcome your feedback on our forum.

Reference: