Description
This is just a very rudimentary quick implementation of a blocking page caching valve. It is not yet very clean, and needed a setHttpServletResponse method on the ValveContext.
This valve caches the entire response AND also blocks concurrent requests which share the same cachekey : This is very effective in avoiding stampeding herds
However, it is good for testing and exploring purposes. There are many more fine-tuning options (like defining on a sitemapitem whether the page can be cached, for how long, etc etc). Perhaps the page cache should also be using something like memcached to share it across a cluster
Also the cachekey creation should be enhanced and pluggable. For example in behavioral targeting, the profile personas would be part of the cache key.
Either way, with this patch, we get some really nice throughput I'd say : For the archetype generated project:
ab -n10000 -c50 http://localhost:8080/site/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /site/
Document Length: 2163 bytes
Concurrency Level: 50
Time taken for tests: 0.777 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 23260000 bytes
HTML transferred: 21630000 bytes
Requests per second: 12877.70 /sec (mean)
Time per request: 3.883 [ms] (mean)
Time per request: 0.078 [ms] (mean, across all concurrent requests)
Transfer rate: 29251.50 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 0.6 1 3
Processing: 0 3 1.8 3 16
Waiting: 0 3 1.8 2 16
Total: 1 4 1.6 3 17
Percentage of the requests served within a certain time (ms)
50% 3
66% 4
75% 4
80% 4
90% 5
95% 6
98% 10
99% 12
100% 17 (longest request)
OR
ab -n10000 -c50 http://localhost:8080/site/news/2011/solar-power-the-sky-is-the-limit.html
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests
Server Software: Apache-Coyote/1.1
Server Hostname: localhost
Server Port: 8080
Document Path: /site/news/2011/solar-power-the-sky-is-the-limit.html
Document Length: 4278 bytes
Concurrency Level: 50
Time taken for tests: 0.860 seconds
Complete requests: 10000
Failed requests: 0
Write errors: 0
Total transferred: 44410000 bytes
HTML transferred: 42780000 bytes
Requests per second: 11623.14 /sec (mean)
Time per request: 4.302 [ms] (mean)
Time per request: 0.086 [ms] (mean, across all concurrent requests)
Transfer rate: 50408.54 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.4 0 3
Processing: 1 4 2.1 3 21
Waiting: 0 4 2.1 3 21
Total: 1 4 2.1 4 22
Percentage of the requests served within a certain time (ms)
50% 4
66% 4
75% 5
80% 5
90% 6
95% 8
98% 11
99% 13
100% 22 (longest request)
Attachments
Issue Links
- causes
-
HSTTWO-2360 Create unit tests for page cache
- Closed
- relates to
-
HSTTWO-2358 Support offloading to cluster wide cache of hst page caches in ehcache
- Closed
-
HSTTWO-2405 HST Page cache should not involve cookies: Cookies should never be part of a cached page.
- Closed
-
HSTTWO-2411 Create page cache valve unit tests
- Closed