Differences

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

Link to this comparison view

litespeed_wiki:cache:avoid-network-bottleneck-even-cache-enabled [2018/12/18 19:49]
Jackson Zhang created
litespeed_wiki:cache:avoid-network-bottleneck-even-cache-enabled [2018/12/18 20:30] (current)
Lisa Clarke Proofreading
Line 1: Line 1:
-====== ​Try to avoid network bottleneck even LSCache enabled ​======+====== ​Network Bottleneck on Cached Sites ======
  
-You may already know you should [[litespeed_wiki:​cache:​check-pageloadspeed-chrome-firefox|check ''​X-LiteSpeed-Cache:​ hit''​ header]] before doing any page load test or benchmark test. Sometimes, you can see ''​X-LiteSpeed-Cache:​ hit''​ header for the page but seems the server has not reached the max capacity as it should. ​Network ​bottleneck might be the likely reason for most of the cases.+You may already know you should [[litespeed_wiki:​cache:​check-pageloadspeed-chrome-firefox|look for the ''​X-LiteSpeed-Cache:​ hit''​ header]] before doing any page load test or benchmark test. Sometimes, you can see ''​X-LiteSpeed-Cache:​ hit''​ header for the pagebut it still seems the server has not reached the maximum ​capacity as it should. ​A network ​bottleneck might be to blame.
  
-To understand how network bottleneck may cause a slow performance ​issue, you can run ''​ab''​ benchmark test inside of your server and outside your server to compare the difference. When CDN server used, such as ClareFlare, you may also disable ​it for a test to see how LiteSpeed cache can maximize your site performance.+To understand how network bottleneck may cause inferior ​performance,​ you can run an ''​ab''​ benchmark test inside of your serverand again outside ​of your server to compare the difference. When CDN server ​is used, such as CloudFlare, you may also disable ​that for a test to see how LiteSpeed cache can maximize your site'​s ​performance.
  
-The following ​showcase ​comes from a real customer who running a high traffic ​media WordPress website. LiteSpeed ​cache has been enabled properly and verified through ''​X-LiteSpeed-Cache:​ hit''​ header. The server load is very low but the page load speed/response time is faster than without cache but still relatively slow and not as fast as expected.  Why+The following ​example ​comes from a real customer who is running a high traffic WordPress ​media website. LiteSpeed ​Cache has been enabled properly and verified through ​the ''​X-LiteSpeed-Cache:​ hit''​ header. The server load is very low, and the response time is faster than it would be without cachebut it'​s ​still relatively slow.  Why is the server ​not as fast as expected? ​
  
-The website is running through CloudFlare. The following tests can be run to identify the page load problem.+The website is running through CloudFlare, so we will run three separate AB tests to identify the page load problem.
  
-===== 1. Disable CloudFlare and run AB inside server ​=====+===== 1. Disable CloudFlare and Run AB Inside Server ​=====
  
-First, ​disabling ​CloufFlare by overriding /​etc/​hosts ​with+First, ​disable ​CloufFlare by overriding ​it in ''​/etc/hosts''​.
    
   <Server IP> testdomain.com   <Server IP> testdomain.com
 +
 +(Replace ''<​Server IP>''​ with the actual IP address of your server.)
  
 Use Curl to verify the header before testing. You can see ''​Server:​ LiteSpeed''​ and ''​X-LiteSpeed-Cache:​ hit''​ Use Curl to verify the header before testing. You can see ''​Server:​ LiteSpeed''​ and ''​X-LiteSpeed-Cache:​ hit''​
  
   [root@server home]$ curl -I https://​testdomain.com/​   [root@server home]$ curl -I https://​testdomain.com/​
 +
   HTTP/1.1 200 OK   HTTP/1.1 200 OK
   Content-Type:​ text/html; charset=UTF-8   Content-Type:​ text/html; charset=UTF-8
Line 32: Line 35:
   Connection: Keep-Alive   Connection: Keep-Alive
   ​   ​
-then run ''​ab''​ test with the following command inside the server:+Run an ''​ab''​ test with the following command inside the server:
   [root@server home]$ ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​   [root@server home]$ ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​
   ​   ​
Line 38: Line 41:
   Requests per second: ​   2883.60 [#/sec] (mean)   Requests per second: ​   2883.60 [#/sec] (mean)
   ​   ​
-which is the performance LiteSpeed Cache can accelerate ​to your website.+This number reflects ​the performance LiteSpeed Cache can give to your website.
  
-=====  2. Enable CloudFlare and run AB inside server ​===== +=====  2. Enable CloudFlare and Run AB Inside Server ​===== 
-Second, removing ​/​etc/​hosts ​overriding, which will enable CloudFlare backYou will need to comment out the override:+Removing the ''​/etc/hosts''​ override by commenting it outThis will allow CloudFlare ​to be used once again.
    
   #<Server IP> testdomain.com   #<Server IP> testdomain.com
  
-Use Curl to verify the header before testing. You can see ''​X-LiteSpeed-Cache:​ hit''​ and ''​Server:​ cloudflare''​+Use Curl to verify the header before testing. You can see ''​X-LiteSpeed-Cache:​ hit''​ and ''​Server:​ cloudflare''​.
  
   [root@server home]$ curl -I https://​testdomain.com/​   [root@server home]$ curl -I https://​testdomain.com/​
 +
   HTTP/1.1 200 OK   HTTP/1.1 200 OK
   Date: Mon, 17 Dec 2018 22:24:06 GMT   Date: Mon, 17 Dec 2018 22:24:06 GMT
Line 65: Line 69:
   CF-RAY: 48accc48e8d0a8a5-CDG   CF-RAY: 48accc48e8d0a8a5-CDG
   ​   ​
-then run ''​ab''​ test with the following command inside the server:+Run an ''​ab''​ test with the following command inside the server:
   [root@server home]$ ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​   [root@server home]$ ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​
   ​   ​
Line 71: Line 75:
   Requests per second: ​   756.89 [#/sec] (mean)   Requests per second: ​   756.89 [#/sec] (mean)
  
-which means the network between CloudFare and you bankend ​server ​slow down the page load speed already.+This means the network between CloudFare and your backend ​server ​has slowed ​down the page load speed already.
  
-=====  3. Enable CloudFlare and run AB outside server ​=====+=====  3. Enable CloudFlare and Run AB Outside Server ​=====
  
-Keep CloudFlare enabled and run ''​ab''​ test outside of your remote ​server, such as your local machine.+Keep CloudFlare enabled and run an ''​ab''​ test from a box outside of your server.
  
 Use Curl to verify the header before testing. You can see ''​X-LiteSpeed-Cache:​ hit''​ and ''​Server:​ cloudflare''​ Use Curl to verify the header before testing. You can see ''​X-LiteSpeed-Cache:​ hit''​ and ''​Server:​ cloudflare''​
  
   [root@test10g ~]# curl -I https://​testdomain.com/​   [root@test10g ~]# curl -I https://​testdomain.com/​
 +
   HTTP/1.1 200 OK   HTTP/1.1 200 OK
   Date: Mon, 17 Dec 2018 22:26:50 GMT   Date: Mon, 17 Dec 2018 22:26:50 GMT
Line 97: Line 102:
   CF-RAY: 48acd048aa8bc5de-EWR   CF-RAY: 48acd048aa8bc5de-EWR
   ​   ​
-then run ''​ab''​ test with the following command outside the remote server, such as your local box: +Run an ''​ab''​ test with the following command outside the remote server, such as your local box:
   [root@localtest ~]# ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​   [root@localtest ~]# ab -n 10000 -k -H "​Accept-Encoding:​ gzip,​deflate"​ -c 100 https://​testdomain.com/​
  
Line 106: Line 110:
 ===== Conclusion ===== ===== Conclusion =====
  
-By comparing the above tests, you can see how fast (2883.60 [#/sec]) LiteSpeed ​cache can bring to your server but how slow you get in the end (265.26 [#/​sec]). ​Looks like there are some significant delays over your network where your server located. Troubleshooting network ​issue is out of LiteSpeed support scope but you will ultimately need to address/fix it to be able to utilize the max performance LiteSpeed and LiteSpeed ​cache can bring to you. +By comparing the above tests, you can see the speed (2883.60 [#/sec]) LiteSpeed ​Cache can bring to your serverbut in the end the site is slow (265.26 [#/​sec]). ​It looks like there are some significant delays over the network where your server ​is located. Troubleshooting network ​issues ​is out of LiteSpeed'​s ​support scopebut you will ultimately need to address it before you can utilize the max performance LiteSpeed and LiteSpeed ​Cache can bring to you. 
  • Admin
  • Last modified: 2018/12/18 20:30
  • by Lisa Clarke