LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > LiteSpeed Cache > Configuring and testing litespeed cache Part 1

Reply
 
Thread Tools Display Modes
  #1  
Old 01-20-2011, 06:00 AM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
Question Configuring and testing litespeed cache Part 1

As per thread at http://www.litespeedtech.com/support...ead.php?t=4198 and at http://www.litespeedtech.com/support...ead.php?t=4401, testing out litespeed cache first with simple test.php and testnocache.php files each with the following code as per NiteWave's instructions

PHP Code:
<?php
header
('CurrentTime: '.gmdate('D, d M Y H:i:s'time()).' GMT',true);

echo 
"time()=" time() . "<br>";
echo 
"date()=" date(DATE_RFC822) ."<br>";
?>
My test config has main virtual host account on 192.168.56.101 loading apache conf at /etc/httpd/conf/httpd.conf

/etc/httpd/conf/httpd.conf contains

Code:
CacheRoot /lscache/ 
CacheEnable disk /
or is it meant to be

Code:
<IfModule mod_disk_cache.c>
CacheRoot /lscache/ 
CacheEnable disk / 
</IfModule>
anyway tried both and same results

.htaccess in /var/www/html contains

Code:
RewriteRule /test.php - [E=Cache-Control:max-age=45]
with cache policy set at
Code:
Enable Cache:No
Cache Request with Query String:No
Cache Request with Cookie:No
Cache Response with Cookie:No
Ignore Request Cache-Control:No
Ignore Response Cache-Control:No
both test.php and testnocache.php don't get cached

with cache policy set to

Code:
Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:Yes
Cache Response with Cookie:Yes
Ignore Request Cache-Control:Yes
Ignore Response Cache-Control:Yes
both test.php and testnocache.php get cached even if i only specified test.php to be cached in htaccess ?

Last edited by eva2000; 01-20-2011 at 08:01 AM..
Reply With Quote
  #2  
Old 01-20-2011, 06:06 AM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
testnocache.php get's cached even with htaccess below

Code:
RewriteRule /test.php - [E=Cache-Control:max-age=45]
response header with cache policy as

Code:
Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:Yes
Cache Response with Cookie:Yes
Ignore Request Cache-Control:Yes
Ignore Response Cache-Control:Yes
Code:
Content-Encoding	gzip
Vary	Accept-Encoding
Date	Thu, 20 Jan 2011 14:05:10 GMT
Server	LiteSpeed
Connection	Keep-Alive
Keep-Alive	timeout=5, max=100
X-Powered-By	PHP/5.3.4
CurrentTime	Thu, 20 Jan 2011 14:05:10 GMT
Content-Type	text/html; charset=UTF-8
Content-Length	78
contents of cache

Code:
ls -alhR /lscache
/lscache:
total 16K
drwxrwxrwx  3 nobody nobody 4.0K Jan 21 00:05 .
drwxr-xr-x 25 root   root   4.0K Jan 20 23:06 ..
drwx------  3 nobody nobody 4.0K Jan 21 00:05 e

/lscache/e:
total 12K
drwx------ 3 nobody nobody 4.0K Jan 21 00:05 .
drwxrwxrwx 3 nobody nobody 4.0K Jan 21 00:05 ..
drwx------ 3 nobody nobody 4.0K Jan 21 00:05 9

/lscache/e/9:
total 12K
drwx------ 3 nobody nobody 4.0K Jan 21 00:05 .
drwx------ 3 nobody nobody 4.0K Jan 21 00:05 ..
drwx------ 2 nobody nobody 4.0K Jan 21 00:05 d

/lscache/e/9/d:
total 12K
drwx------ 2 nobody nobody 4.0K Jan 21 00:05 .
drwx------ 3 nobody nobody 4.0K Jan 21 00:05 ..
-rw------- 1 nobody nobody  237 Jan 21 00:05 e9d22bcd

Last edited by eva2000; 01-20-2011 at 06:08 AM..
Reply With Quote
  #3  
Old 01-20-2011, 06:11 AM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
edit: seems I have apache keepalives off and apachebench was run without keepalives, so will have to redo some tests

test.php get's cached as per htaccess

Code:
RewriteRule /test.php - [E=Cache-Control:max-age=45]
response header with cache policy as

Code:
Enable Cache:No
Cache Request with Query String:Yes
Cache Request with Cookie:Yes
Cache Response with Cookie:Yes
Ignore Request Cache-Control:Yes
Ignore Response Cache-Control:Yes
response header

Code:
Content-Encoding	gzip
Vary	Accept-Encoding
Date	Thu, 20 Jan 2011 14:09:18 GMT
Server	LiteSpeed
Connection	Keep-Alive
Keep-Alive	timeout=5, max=100
X-Powered-By	PHP/5.3.4
CurrentTime	Thu, 20 Jan 2011 14:09:18 GMT
Content-Type	text/html; charset=UTF-8
Content-Length	79
Request Headers
cleared and emptied /lscache before loading test.php and this is the contents

Code:
ls -alhR /lscache
/lscache:
total 16K
drwxrwxrwx  3 nobody nobody 4.0K Jan 21 00:09 .
drwxr-xr-x 25 root   root   4.0K Jan 20 23:06 ..
drwx------  3 nobody nobody 4.0K Jan 21 00:09 9

/lscache/9:
total 12K
drwx------ 3 nobody nobody 4.0K Jan 21 00:09 .
drwxrwxrwx 3 nobody nobody 4.0K Jan 21 00:09 ..
drwx------ 3 nobody nobody 4.0K Jan 21 00:09 f

/lscache/9/f:
total 12K
drwx------ 3 nobody nobody 4.0K Jan 21 00:09 .
drwx------ 3 nobody nobody 4.0K Jan 21 00:09 ..
drwx------ 2 nobody nobody 4.0K Jan 21 00:09 2

/lscache/9/f/2:
total 12K
drwx------ 2 nobody nobody 4.0K Jan 21 00:09 .
drwx------ 3 nobody nobody 4.0K Jan 21 00:09 ..
-rw------- 1 nobody nobody  231 Jan 21 00:09 9f283728
Both test.php and testnocache.php get cached according to apachebench

for test.php

Code:
ab -n 1000 -c 200 192.168.56.101/test.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        LiteSpeed
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /test.php
Document Length:        63 bytes

Concurrency Level:      200
Time taken for tests:   0.62169 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      288288 bytes
HTML transferred:       63504 bytes
Requests per second:    16085.19 [#/sec] (mean)
Time per request:       12.434 [ms] (mean)
Time per request:       0.062 [ms] (mean, across all concurrent requests)
Transfer rate:          4519.94 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    2   1.6      2       7
Processing:     2    8   3.4      9      54
Waiting:        0    3   2.6      4      49
Total:          3   10   3.7     11      54

Percentage of the requests served within a certain time (ms)
  50&#37;     11
  66&#37;     12
  75%     13
  80%     13
  90%     14
  95%     15
  98%     16
  99%     17
 100%     54 (longest request)
for testnocache.php

Code:
ab -n 1000 -c 200 192.168.56.101/testnocache.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        LiteSpeed
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /testnocache.php
Document Length:        63 bytes

Concurrency Level:      200
Time taken for tests:   0.73192 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      273182 bytes
HTML transferred:       64701 bytes
Requests per second:    13662.70 [#/sec] (mean)
Time per request:       14.638 [ms] (mean)
Time per request:       0.073 [ms] (mean, across all concurrent requests)
Transfer rate:          3634.28 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    3   5.4      1      22
Processing:     2    9   3.9      8      19
Waiting:        0    4   3.7      4      18
Total:          2   13   7.6     10      34

Percentage of the requests served within a certain time (ms)
  50%     10
  66%     12
  75%     18
  80%     20
  90%     26
  95%     30
  98%     32
  99%     33
 100%     34 (longest request)
Without caching requests per second was around 3980 - 4100 per second. So litespeed cache nearly 4x times boost, but it's ignoring my htaccess to cache only test.php ?

without cache

Code:
ab -n 1000 -c 200 192.168.56.101/test.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        LiteSpeed
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /test.php
Document Length:        63 bytes

Concurrency Level:      200
Time taken for tests:   0.239160 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      342056 bytes
HTML transferred:       75348 bytes
Requests per second:    4181.30 [#/sec] (mean)
Time per request:       47.832 [ms] (mean)
Time per request:       0.239 [ms] (mean, across all concurrent requests)
Transfer rate:          1396.55 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   17  11.1     18      39
Processing:    11   21   6.2     21      92
Waiting:        0   14   8.8     15      52
Total:         27   39   6.4     39     114

Percentage of the requests served within a certain time (ms)
  50%     39
  66%     42
  75%     44
  80%     45
  90%     47
  95%     48
  98%     50
  99%     50
 100%    114 (longest request)

Code:
ab -n 1000 -c 200 192.168.56.101/testnocache.php
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.56.101 (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests


Server Software:        LiteSpeed
Server Hostname:        192.168.56.101
Server Port:            80

Document Path:          /testnocache.php
Document Length:        63 bytes

Concurrency Level:      200
Time taken for tests:   0.254171 seconds
Complete requests:      1000
Failed requests:        0
Write errors:           0
Total transferred:      341198 bytes
HTML transferred:       75159 bytes
Requests per second:    3934.36 [#/sec] (mean)
Time per request:       50.834 [ms] (mean)
Time per request:       0.254 [ms] (mean, across all concurrent requests)
Transfer rate:          1310.14 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0   18  11.9     18      47
Processing:    11   23   7.6     23     106
Waiting:        0   16  10.0     16     103
Total:         28   41   8.0     41     118

Percentage of the requests served within a certain time (ms)
  50%     41
  66%     44
  75%     47
  80%     48
  90%     51
  95%     55
  98%     58
  99%     60
 100%    118 (longest request)
edit: seems I have apache keepalives off and apachebench was run without keepalives, so will have to redo some tests

Last edited by eva2000; 01-21-2011 at 03:05 AM..
Reply With Quote
  #4  
Old 01-20-2011, 07:04 AM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
And here's the server general config for loading apache conf

Reply With Quote
  #5  
Old 01-20-2011, 07:48 AM
NiteWave NiteWave is online now
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Thanks for the testing.

glad to hear this test result:
Quote:
Without caching requests per second was around 3980 - 4100 per second. So litespeed cache nearly 4x times boost
We just updated 4.0.19, when a page is from cache, the response header will have "X-LiteSpeed-Cache: hit". so it's easier for us to test cache function.

I'll try to reproduce your testing on our cPanel server.
Reply With Quote
  #6  
Old 01-20-2011, 08:00 AM
eva2000 eva2000 is offline
Senior Member
 
Join Date: Dec 2004
Location: Brisbane, Australia
Posts: 142
Sweet new response header will make things much easier. Is there a cache debug log feature ? Enable cache debug log and it will log and track the creation time/filename/path to the cached file in cache directory ?

So litespeed cache is more of a disk cache right ? Possible to have a memory cache version too ?

Last edited by eva2000; 01-20-2011 at 08:23 AM..
Reply With Quote
Reply

Tags
boost, cache, mod_cache, mod_disk_cache, varnish

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:07 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.