Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
litespeed_wiki:config:compare_pagespeed_and_lscache [2017/09/13 15:57]
Eric Leu [Testing Method]
litespeed_wiki:config:compare_pagespeed_and_lscache [2017/09/13 19:43] (current)
Lisa Clarke
Line 1: Line 1:
-====== Should I turn on both PageSpeed and LSCache at the same time? ====== +====== Should I Turn on Both PageSpeed and LSCache at the Same Time? ====== 
-In some cases, you maybe want to know does mod_pagespeed ​work with LiteSpeed Cache+In some cases, you may want to know if mod_pagespeed ​works with LiteSpeed Cache. Let's find out with a testing benchmark experiment.
-This article is going to show you the result by testing benchmark experiment.+
 =====Introduction ===== =====Introduction =====
-Before we dive into the differences between LSCache and pagespeed, let's take a quick look at the background of these two function ​and their general characteristics. +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. 
-  * [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache | LSCache]] is a server-side page cache. Page caches save time and resources, and they do so by storing the full content of dynamically-generated pages so that static copies may be served to the user. A page cache allows the server to bypass ​PHP and database queries altogether. It is an output cache for dynamic contents, so the usage is not limited to PHP pages. Unlike Varnish, LiteSpeed cache is built into LiteSpeed'​s web server, thus eliminating one layer of reverse proxy. This translates into higher efficiency for static ​contents+  * [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache | LSCache]] is a server-side page cache. Page caches save time and resources, and they do so by storing the full content of dynamically-generated pages so that static copies may be served to the user. A page cache allows the server to bypass ​the process of dynamic page creation ​and database queries altogether. Unlike Varnish, LiteSpeed cache is built into LiteSpeed'​s web server, thus eliminating one layer of reverse proxy. This translates into higher efficiency for static ​content
-  * Page Speed is an open-source module which automatically applies web performance best practices to pagesand associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow. This module can reduces ​website loading times by automatically optimizing web pages and the resources within them. +  * PageSpeed ​is an open-source module which automatically applies web performance best practices to pages and associated assets (CSS, JavaScript, images) without requiring that you modify your existing content or workflow. This module can reduce ​website loading times by automatically optimizing web pages and the resources within them. 
  
-=====Test ​environment=====+=====Test ​Environment=====
 ==== Hardware====  ​ ==== Hardware====  ​
   - Client: 4 cores of Intel(R) Xeon(R)E7-4870 @ 2.40GHz CPU + 4G RAM    - Client: 4 cores of Intel(R) Xeon(R)E7-4870 @ 2.40GHz CPU + 4G RAM
Line 24: Line 23:
     - mod_pagespeed rules     - mod_pagespeed rules
       - <​code>​pagespeed FileCachePath /​tmp/​lshttpd/​pagespeed;​       - <​code>​pagespeed FileCachePath /​tmp/​lshttpd/​pagespeed;​
-pagespeed RewriteLevel CoreFilters;​ </​code>​ +pagespeed RewriteLevel CoreFilters;​ </​code>​  
 +    - htop v2.0.2
  
-  * For verify ​pagespeed ​is working, ​you can follow ​[[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​enable_pagespeed#​verify_pagespeed_is_enabled | this article]]\\ +  * To verify ​PageSpeed ​is working, ​see [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​enable_pagespeed#​verify_pagespeed_is_enabled | this article]]\\ 
-  * For verify ​lscache ​is working, ​you can follow ​[[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​no-plugin-setup-guidline#​verify_that_pages_are_served_from_the_cache | this article]]\\ +  * To verify ​LSCache ​is working, ​see [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​cache:​no-plugin-setup-guidline#​verify_that_pages_are_served_from_the_cache | this article]]\\
  
 ==== Testing Method==== ==== Testing Method====
-There are four cases in our experiment:\\ +There are four scenarios ​in our experiment:
-Case 1: without lscache and mod_pagespeed\\ +
-Case 2: Only use mod_pagespeed\\ +
-Case 3: Only use lscache\\ +
-Case 4: Use both lscache and mod_pagespeed. We send request command with wordpress URL from client side to the Web server. \\//​Regardless of whether testing with lscache or mod_pagespeed,​ we followed the same procedure. //+
  
-  - The method to test these web servers ​uses ApacheBench (an HTTP server benchmarking tool). In each test, 10,000 requests ​are made for a 68 KB size page  +  - Do not use LSCache or mod_pagespeed 
-  ​Before each test the web server in question ​was restarted to clear out any potential caching or other issues that may interfere with results. +  - Only use mod_pagespeed 
-  ​Each test was run with the same concurrent numbers of requests to gauge performance ​at different cases.  +  - Only use LSCache 
-  ​The commands that are used in this test follow this format: \\ <​code>​ab -n 10000 -H "​Accept-Encoding:​ gzip,​deflate"​ -c 10 http://​$Server_IP/​wordpress/</​code>​+  - Use both LSCache and mod_pagespeed 
 + 
 +Regardless of whether we are testing with LSCache or mod_pagespeed,​ we follow the same procedure:​ 
 + 
 +  * Test the web servers ​using ApacheBench (an HTTP server benchmarking tool). In each test, the client sends 10,000 requests ​of 68kB each to the server'​s webpage. ​   ​ 
 +  ​Before each test the web server in question ​is restarted to clear out any potential caching or other issues that may interfere with results. 
 +  ​Each test is run with the same concurrent numbers of requests to gauge performance ​for different cases.  
 +  ​The commands that are used in this test follow this format: \\ <​code>​ab -n 10000 -H "​Accept-Encoding:​ gzip,​deflate"​ -c 10 http://​$Server_IP/​wordpress/</​code>​
 =====Benchmarks===== =====Benchmarks=====
    
  
-==== Comparison ​on a form ====+==== Comparison ​Table ====
 ^ Case            ^ LSCache ​   ^ Mod_PageSpeed ​ ^ Requests/s ^ Memory usage(MB)^ CPU Load 1min ^  ^ Case            ^ LSCache ​   ^ Mod_PageSpeed ​ ^ Requests/s ^ Memory usage(MB)^ CPU Load 1min ^ 
 | 1               | X         | X        | 16    | 210  | 7.33 | | 1               | X         | X        | 16    | 210  | 7.33 |
Line 51: Line 54:
  
   * CPU Load default average value is 0.3   * CPU Load default average value is 0.3
-  * Memory usage on record ​has already ​been subtract default value  +  * Memory usage numbers do not include the system'​s base memory usage, which has been subtracted from the total 
-==== Comparison ​on chart ====+==== Comparison ​Chart ====
 ===Requests per second=== ===Requests per second===
-LSCache clearly dominates in the raw number of requests per second it can serve. ​Due to numbers too much difference between with LSCache and without LSCache, we will show you the chart comparison separately by without cache and with cache.  +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-sideso we've created two separate charts.  
-  * Compare ​Case 1 and Case 2 by requests ​number ​per second, we can see there is 20% increase with mod_pagespeed \\ {{:​litespeed_wiki:​config:​cp-1.png?​500|}}+  * Comparing ​Case 1 and Case 2 by requests per second, we can see there is 20% increase with mod_pagespeed \\ {{:​litespeed_wiki:​config:​cp-1.png?​500|}}
  
-  * One will notice from this graph that with LSCache and PageSpeed both enabled ​that the numbers are lower than that of just LSCache but greater than just PageSpeed. The reason for this is that on a normal load of the webpage, LSWS will serve the cache file and all the static files that are requested without having to do any CPU intensive tasks. When PageSpeed comes into play LSWS will serve the cached page, removing any need of PHP so it will be quicker, but then it has to optimize all the other static content via mod_pagespeed before it gets served to the user. In return one receives optimized static files but at a cost of server resources and less requests per second.\\ {{:​litespeed_wiki:​config:​cp-2.png?​500|}}+  * You will notice from this graph that with LSCache and PageSpeed both enabledthe numbers are lower than that of just LSCache but greater than just PageSpeed. The reason for this is that on a normal load of the webpage, LSWS will serve the cached ​file and all of the static files that are requested without having to do any CPU-intensive tasks. When PageSpeed comes into play LSWS will serve the cached page, removing any need for PHP. This will be quicker, but then it has to optimize all of the other static content via mod_pagespeed before it gets served to the user. In returnone receives optimized static files but at a cost of server resources and less requests per second.\\ {{:​litespeed_wiki:​config:​cp-2.png?​500|}}
  
 ===CPU Load=== ===CPU Load===
-  * Compare ​all cases by 1 min CPU Load, we can see CPU Load is higher if your mod_pagespeed is enabled ​than other cases. \\+  * For this test, we continually send requests for the duration of exactly 1 minute. Comparing ​all cases, we can see CPU Load is highest with only mod_pagespeed is enabled. Cases 3 & 4, in which LSCache is enabled, are not overloading.\\
 {{:​litespeed_wiki:​config:​cp-4.png?​500|}} {{:​litespeed_wiki:​config:​cp-4.png?​500|}}
  
 ===Memory usage=== ===Memory usage===
-  * This is important to measure, especially on a VPS where your memory usage has a hard cap and raising it costs you additional money. ​Compare ​all cases by memory usage, we can see there is 30% increase ​if your mod_pagespeed than nothing enabled. \\+  * This is important to measure, especially on a VPS where your memory usage has a hard cap and raising it costs you additional money. ​Comparing ​all cases by memory usage, we can see there is 30% increase ​with mod_pagespeed ​running ​than with nothing enabled. \\
  ​{{:​litespeed_wiki:​config:​cp-3.png?​500|}}\\  ​{{:​litespeed_wiki:​config:​cp-3.png?​500|}}\\
  
Line 70: Line 73:
 //Remember, the results shown are good only for measuring relative (and not absolute) performance,​ as the tests were conducted locally on the server.// //Remember, the results shown are good only for measuring relative (and not absolute) performance,​ as the tests were conducted locally on the server.//
 ===== Conclusion ===== ===== 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.  +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.  
-  - Using lscache ​and mod_pagespeed together ​are still workable, but it will slow down your page loading time and increase CPU and Memory usage, so if your LSWS include ​LiteSpeed Cache already, then you don't need to enable ​pagespeed ​module ​for faster +  - 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. 
-  - If your LSWS not include ​Cache, then pagespeed ​does faster ​your site around 20%. It will takes part of resources and should be avoided in shared hosting environment. ​More information,​ please see [[ https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​enable_pagespeed#​using_a_control_panel_in_a_shared_hosting_environment| ​here]]  +  - 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 [[ https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​config:​enable_pagespeed#​using_a_control_panel_in_a_shared_hosting_environment| ​Using a Control Panel in a Shared Hosting Environment]]. 
-  - See this article if you want to [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​licenses:​add-lscache | Add Caching ​to an Existing License]] \\+  - Seeing these results, ​you may want to [[https://​www.litespeedtech.com/​support/​wiki/​doku.php/​litespeed_wiki:​licenses:​add-lscache | add LSCache ​to your existing LSWS license]]\\
  
 We welcome your feedback on our [[https://​www.litespeedtech.com/​support/​forum/​ | forum]]. We welcome your feedback on our [[https://​www.litespeedtech.com/​support/​forum/​ | forum]].
Line 79: Line 82:
   - [[https://​www.modpagespeed.com/​doc/​config_filters | Pagespeed doc]]   - [[https://​www.modpagespeed.com/​doc/​config_filters | Pagespeed doc]]
   - [[ https://​scotthelme.co.uk/​pagespeed-performance-optimisation-made-easy/​ | scotthelme post]]   - [[ https://​scotthelme.co.uk/​pagespeed-performance-optimisation-made-easy/​ | scotthelme post]]
- 
- 
  
  • Admin
  • Last modified: 2017/09/13 15:57
  • by Eric Leu