Modified: jakarta/jcs/trunk/xdocs/JCSShortDescription.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/JCSShortDescription.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/JCSShortDescription.xml (original)
+++ jakarta/jcs/trunk/xdocs/JCSShortDescription.xml Thu May 10 09:03:42 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
<properties>
@@ -8,8 +26,8 @@
</properties>
<body>
- <section name="Java Caching System">
- <p>
+ <section name="Java Caching System">
+ <p>
JCS is a distributed caching system written in java. It is intended to speed up
applications by providing a means to manage cached
data of various dynamic natures. Like any caching system, the
@@ -37,7 +55,7 @@
<li>Extensible framework</li>
<li>Fully configurable runtime parameters</li>
<li>Region data separation and configuration</li>
- <li>Fine grained element configuration options</li>
+ <li>Fine grained element configuration options</li>
<li>Remote synchronization</li>
<li>Remote store recovery</li>
<li>Non-blocking "zombie" (balking facade) pattern</li>
Modified: jakarta/jcs/trunk/xdocs/JCSandJCACHE.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/JCSandJCACHE.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/JCSandJCACHE.xml (original)
+++ jakarta/jcs/trunk/xdocs/JCSandJCACHE.xml Thu May 10 09:03:42 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
<properties>
@@ -9,7 +27,7 @@
<body>
<section name="JCS and JCACHE (JSR-107)">
- <p>
+ <p>
The JCS is an attempt to build a system close to JCACHE , <a
href="http://jcp.org/jsr/detail/107.jsp">JSR-107</a>, a
description of the caching system used in Oracle9i. JCS grew
Modified: jakarta/jcs/trunk/xdocs/JCSvsEHCache.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/JCSvsEHCache.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/JCSvsEHCache.xml (original)
+++ jakarta/jcs/trunk/xdocs/JCSvsEHCache.xml Thu May 10 09:03:42 2007
@@ -1,489 +1,507 @@
-<?xml version="1.0"?>
-
-<document>
- <properties>
- <title>JCS vs EHCache Performance</title>
- <author email="[email protected]">Aaron Smuts</author>
- </properties>
-
- <body>
- <section name="JCS vs EHCache Memory Performance">
- <subsection name="Initial Test Results">
- <p>
- I just built both EHCache (1.2-beta4) and JCS
- (1.2.7.0) from head, configured both similarly and
- ran 20 rounds of 50,000 puts and gets, that is
- 1,000,000 puts and gets in total. Using the default
- LRU Memory Cache, the same algorithm that EHCache
- uses by default,
- <b>
- JCS proved to be nearly twice as fast as EHCache
- </b>
- in multiple trials for both puts and gets. I have
- the log levels for both set at info. I would like to
- further verify my results, since they completely
- contradict the information on the EHCache site.
- </p>
- <p>
- From what I can tell so far, JCS is significantly
- faster than EHCache when you are retrieving items
- that exist in the cache and when you are putting
- items into a cache that has not reached its size
- limit.
- </p>
- <p>
- Additional testing shows that when the size limit it
- reached, JCS and EHCache perform similarly for puts
- and gets. Although JCS gets are significantly faster
- when the items are present, they are almost exactly
- the same when the items are not in the cache. My
- initial tests revealed a less than 1% difference,
- but subsequent runs showed JCS as 20% faster. More
- tests are needed before the results are conclusive.
- </p>
- <p>
- Since, neither cache will be a relevant bottleneck
- in any application where a cache would be useful,
- the differences in performance may be beside the
- point. Nevertheless, it is important to note that
- the EHCache web site provides, what appears to be,
- false test data.
- </p>
- <p>
- The peculiar result is that a few years back EHCache
- took the JCS source code, removed most of its
- features, and ended up with something that performs
- worse.
- </p>
- </subsection>
-
-
- <subsection name="Test Data">
- <p>Here is the data from the first test:</p>
- <p>
- JCS put time for 50000 = 651; millis per = 0.01302
- JCS get time for 50000 = 160; millis per = 0.0032
- EHCache put time for 50000 = 481; millis per =
- 0.00962 EHCache get time for 50000 = 110; millis per
- = 0.0022
- </p>
- <p>
- JCS put time for 50000 = 240; millis per = 0.0048
- JCS get time for 50000 = 90; millis per = 0.0018
- EHCache put time for 50000 = 491; millis per =
- 0.00982 EHCache get time for 50000 = 120; millis per
- = 0.0024
- </p>
- <p>
- JCS put time for 50000 = 241; millis per = 0.00482
- JCS get time for 50000 = 80; millis per = 0.0016
- EHCache put time for 50000 = 551; millis per =
- 0.01102 EHCache get time for 50000 = 110; millis per
- = 0.0022
- </p>
- <p>
- JCS put time for 50000 = 240; millis per = 0.0048
- JCS get time for 50000 = 90; millis per = 0.0018
- EHCache put time for 50000 = 481; millis per =
- 0.00962 EHCache get time for 50000 = 130; millis per
- = 0.0026
- </p>
- <p>
- JCS put time for 50000 = 230; millis per = 0.0046
- JCS get time for 50000 = 181; millis per = 0.00362
- EHCache put time for 50000 = 520; millis per =
- 0.0104 EHCache get time for 50000 = 101; millis per
- = 0.00202
- </p>
- <p>
- JCS put time for 50000 = 220; millis per = 0.0044
- JCS get time for 50000 = 90; millis per = 0.0018
- EHCache put time for 50000 = 641; millis per =
- 0.01282 EHCache get time for 50000 = 110; millis per
- = 0.0022
- </p>
- <p>
- JCS put time for 50000 = 250; millis per = 0.0050
- JCS get time for 50000 = 121; millis per = 0.00242
- EHCache put time for 50000 = 590; millis per =
- 0.0118 EHCache get time for 50000 = 101; millis per
- = 0.00202
- </p>
- <p>
- JCS put time for 50000 = 260; millis per = 0.0052
- JCS get time for 50000 = 100; millis per = 0.0020
- EHCache put time for 50000 = 581; millis per =
- 0.01162 EHCache get time for 50000 = 100; millis per
- = 0.0020
- </p>
- <p>
- JCS put time for 50000 = 290; millis per = 0.0058
- JCS get time for 50000 = 121; millis per = 0.00242
- EHCache put time for 50000 = 570; millis per =
- 0.0114 EHCache get time for 50000 = 121; millis per
- = 0.00242
- </p>
- <p>
- JCS put time for 50000 = 210; millis per = 0.0042
- JCS get time for 50000 = 120; millis per = 0.0024
- EHCache put time for 50000 = 561; millis per =
- 0.01122 EHCache get time for 50000 = 130; millis per
- = 0.0026
- </p>
- <p>
- JCS put time for 50000 = 250; millis per = 0.0050
- JCS get time for 50000 = 151; millis per = 0.00302
- EHCache put time for 50000 = 560; millis per =
- 0.0112 EHCache get time for 50000 = 111; millis per
- = 0.00222
- </p>
- <p>
- JCS put time for 50000 = 250; millis per = 0.0050
- JCS get time for 50000 = 100; millis per = 0.0020
- EHCache put time for 50000 = 711; millis per =
- 0.01422 EHCache get time for 50000 = 100; millis per
- = 0.0020
- </p>
- <p>
- JCS put time for 50000 = 251; millis per = 0.00502
- JCS get time for 50000 = 90; millis per = 0.0018
- EHCache put time for 50000 = 511; millis per =
- 0.01022 EHCache get time for 50000 = 90; millis per
- = 0.0018
- </p>
- <p>
- JCS put time for 50000 = 220; millis per = 0.0044
- JCS get time for 50000 = 100; millis per = 0.0020
- EHCache put time for 50000 = 491; millis per =
- 0.00982 EHCache get time for 50000 = 90; millis per
- = 0.0018
- </p>
- <p>
- JCS put time for 50000 = 230; millis per = 0.0046
- JCS get time for 50000 = 80; millis per = 0.0016
- EHCache put time for 50000 = 201; millis per =
- 0.00402 EHCache get time for 50000 = 390; millis per
- = 0.0078
- </p>
- <p>
- JCS put time for 50000 = 201; millis per = 0.00402
- JCS get time for 50000 = 120; millis per = 0.0024
- EHCache put time for 50000 = 180; millis per =
- 0.0036 EHCache get time for 50000 = 411; millis per
- = 0.00822
- </p>
- <p>
- JCS put time for 50000 = 210; millis per = 0.0042
- JCS get time for 50000 = 100; millis per = 0.0020
- EHCache put time for 50000 = 210; millis per =
- 0.0042 EHCache get time for 50000 = 381; millis per
- = 0.00762
- </p>
- <p>
- JCS put time for 50000 = 240; millis per = 0.0048
- JCS get time for 50000 = 90; millis per = 0.0018
- EHCache put time for 50000 = 211; millis per =
- 0.00422 EHCache get time for 50000 = 410; millis per
- = 0.0082
- </p>
- <p>
- JCS put time for 50000 = 221; millis per = 0.00442
- JCS get time for 50000 = 80; millis per = 0.0016
- EHCache put time for 50000 = 210; millis per =
- 0.0042 EHCache get time for 50000 = 411; millis per
- = 0.00822
- </p>
- <p>
- JCS put time for 50000 = 220; millis per = 0.0044
- JCS get time for 50000 = 80; millis per = 0.0016
- EHCache put time for 50000 = 190; millis per =
- 0.0038 EHCache get time for 50000 = 411; millis per
- = 0.00822
- </p>
- <p>Finished 20 loops of 50000 gets and puts</p>
- <p>
- Put average for JCS = 256 Put average for EHCache =
- 447 JCS puts took 0.57270694 times the EHCache , the
- goal is less than 1.0x
- </p>
- <p>
- Get average for JCS = 107 Get average for EHCache =
- 196 JCS gets took 0.54591835 times the EHCache , the
- goal is less than 1.0x
- </p>
- </subsection>
-
- <subsection name="A Test Class">
- <p>Here is the test class:</p>
-
- <source>
- <![CDATA[
-package org.apache.jcs;
-
-import junit.framework.TestCase;
-import net.sf.ehcache.Cache;
-import net.sf.ehcache.CacheManager;
-import net.sf.ehcache.Element;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jcs.engine.CompositeCacheAttributes;
-import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
-import org.apache.jcs.utils.struct.LRUMap;
-
-/**
- * Compare JCS vs ehcache performance.
- *
- * @author Aaron Smuts
- *
- */
-public class JCSvsEHCachePerformanceTest
- extends TestCase
-{
-
- float ratioPut = 0;
-
- float ratioGet = 0;
-
- // the jcs to competitor
- float target = 1.0f;
-
- int loops = 20;
-
- int tries = 50000;
-
- /**
- * Compare performance between JCS and EHCache. Fail if JCS is not as fast.
- * Print the ratio.
- *
- * @throws Exception
- *
- */
- public void testJCSvsEHCache()
- throws Exception
- {
-
- Log log = LogFactory.getLog( LRUMap.class );
- if ( log.isDebugEnabled() )
- {
- System.out.println( "The log level must be at info or above for the a performance test." );
- return;
- }
-
- doWork();
-
- assertTrue( this.ratioPut < target );
- assertTrue( this.ratioGet < target );
-
- }
-
- /**
- * This runs a series of gets and puts for both JCS and EHCache. The test
- * will fail if JCS is not faster.
- *
- * @throws Exception
- *
- */
- public void doWork()
- throws Exception
- {
-
- int maxSize = 1000000;
-
- // create the two caches.
- CacheManager ehMgr = CacheManager.getInstance();
- // Create an ehcache with a max size of maxSize, no swap, with items
- // that can expire, with maximum idle time to live of 500 seconds, and
- // maximum idel time of 500 seconds.
- Cache eh = new Cache( "testJCSvsEHCache", maxSize, false, false, 500, 500 );
- ehMgr.addCache( eh );
-
- // Create a similarly configured JCS that uses the LRU memory cache.
- // maxSize elements that are not eternal. No disk cache is configured.
- ICompositeCacheAttributes cattr = new CompositeCacheAttributes();
- cattr.setMaxObjects( maxSize );
- JCS jcs = JCS.getInstance( "testJCSvsEHCache", cattr );
-
- // run settings
- long start = 0;
- long end = 0;
- long time = 0;
- float tPer = 0;
-
- long putTotalJCS = 0;
- long getTotalJCS = 0;
- long putTotalEHCache = 0;
- long getTotalEHCache = 0;
-
- String jcsDisplayName = "JCS";
- String ehCacheDisplayName = "";
-
- try
- {
- for ( int j = 0; j < loops; j++ )
- {
-
- jcsDisplayName = "JCS ";
- start = System.currentTimeMillis();
- for ( int i = 0; i < tries; i++ )
- {
- jcs.put( "key:" + i, "data" + i );
- }
- end = System.currentTimeMillis();
- time = end - start;
- putTotalJCS += time;
- tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
- System.out
- .println( jcsDisplayName + " put time for " + tries + " = " + time + "; millis per = " + tPer );
-
- start = System.currentTimeMillis();
- for ( int i = 0; i < tries; i++ )
- {
- jcs.get( "key:" + i );
- }
- end = System.currentTimeMillis();
- time = end - start;
- getTotalJCS += time;
- tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
- System.out
- .println( jcsDisplayName + " get time for " + tries + " = " + time + "; millis per = " + tPer );
-
- // /////////////////////////////////////////////////////////////
- ehCacheDisplayName = "EHCache ";
-
- start = System.currentTimeMillis();
- for ( int i = 0; i < tries; i++ )
- {
- Element ehElm = new Element( "key:" + i, "data" + i );
-
- eh.put( ehElm );
- }
- end = System.currentTimeMillis();
- time = end - start;
- putTotalEHCache += time;
- tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
- System.out.println( ehCacheDisplayName + " put time for " + tries + " = " + time + "; millis per = "
- + tPer );
-
- start = System.currentTimeMillis();
- for ( int i = 0; i < tries; i++ )
- {
- eh.get( "key:" + i );
- }
- end = System.currentTimeMillis();
- time = end - start;
- getTotalEHCache += time;
- tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
- System.out.println( ehCacheDisplayName + " get time for " + tries + " = " + time + "; millis per = "
- + tPer );
-
- System.out.println( "\n" );
- }
-
- }
- catch ( Exception e )
- {
- e.printStackTrace( System.out );
- System.out.println( e );
- }
-
- long putAvJCS = putTotalJCS / loops;
- long getAvJCS = getTotalJCS / loops;
- long putAvHashtable = putTotalEHCache / loops;
- long getAvHashtable = getTotalEHCache / loops;
-
- System.out.println( "Finished " + loops + " loops of " + tries + " gets and puts" );
-
- System.out.println( "\n" );
- System.out.println( "Put average for " + jcsDisplayName + " = " + putAvJCS );
- System.out.println( "Put average for " + ehCacheDisplayName + " = " + putAvHashtable );
- ratioPut = Float.intBitsToFloat( (int) putAvJCS ) / Float.intBitsToFloat( (int) putAvHashtable );
- System.out.println( jcsDisplayName + " puts took " + ratioPut + " times the " + ehCacheDisplayName
- + ", the goal is <" + target + "x" );
-
- System.out.println( "\n" );
- System.out.println( "Get average for " + jcsDisplayName + " = " + getAvJCS );
- System.out.println( "Get average for " + ehCacheDisplayName + " = " + getAvHashtable );
- ratioGet = Float.intBitsToFloat( (int) getAvJCS ) / Float.intBitsToFloat( (int) getAvHashtable );
- System.out.println( jcsDisplayName + " gets took " + ratioGet + " times the " + ehCacheDisplayName
- + ", the goal is <" + target + "x" );
-
- }
-
-}
-
- ]]>
- </source>
- </subsection>
- </section>
-
-
- <section name="JCS vs EHCache Disk Cache">
- <p>
- It is very difficult to compare the ehcache disk store
- and the JCS Indexed Disk Cache.
- </p>
- <p>The JCS version is much more sophisticated.</p>
- <p>
- JCS puts items into a queue called purgatory. While they
- are in this queue, they are still accessible. This queue
- gets worked when items are in it. The number of threads
- used in the system as a whole for disk caches is
- configurable using the thread pool configuration options
- in JCS. I could have 1000 regions and only use 3 threads
- to work the disk queues. From what I can tell EH will
- use 1 thread per region. This is worse than the JCS
- default, which uses a queue that kills its threads when
- they are not used. . . . and much worse than using JCS
- with a thread pool.
- </p>
- <p>
- The size of JCS purgatory is configurable, so you can
- avoid catastrophe if something goes wrong with the queue
- worker. EH doesn't have any such safety.
- </p>
- <p>
- JCS limits the number of keys that can be kept for the
- disk cache. EH cannot do this.
- </p>
- <p>
- The ehcache disk version is very simple. It puts an
- unlimited number of items in a temporary store. You can
- easily fill this up and run out of memory. You can put
- items into JCS purgatory faster than they can be gc'd
- but it is much more difficult. The EH store is then
- flushed to disk every 200ms. While EH is flushing the
- entire disk cache blocks!
- </p>
- <p>
- JCS disk cache is based on a continuous spooling model,
- not a stop the world model like EH. In most cases the EH
- model will work out, but not if you put a lot of big
- items on disk at once. If you want an even distribution
- of disk cache response times, then you should use JCS.
- </p>
- <p>
- The EH disk store also seems to just keep growing. After
- several tests, the size of the data file was 10 times
- that of JCS and EH was taking 10 times as long.
- </p>
- <p>
- You can saturate the EH version much more quickly, since
- it will hold as many items as you can put in in 200 ms.
- </p>
- <p>
- I tried with 100k and JCS could handle it, but EH died
- with an out of memory exception.
- </p>
- <p>
- EH cache developed its disk store in response to a bug
- in the JCS version. This bug was fixed a few years ago .
- . . The nice thing about JCS is that it is completely
- pluggable. It would take about 30 minutes to plug a
- different disk cache implementation into JCS if you so
- pleased . . . .
- </p>
- </section>
-
- </body>
-</document>
\ No newline at end of file
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<document>
+ <properties>
+ <title>JCS vs EHCache Performance</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="JCS vs EHCache Memory Performance">
+ <subsection name="Initial Test Results">
+ <p>
+ I just built both EHCache (1.2-beta4) and JCS
+ (1.2.7.0) from head, configured both similarly and
+ ran 20 rounds of 50,000 puts and gets, that is
+ 1,000,000 puts and gets in total. Using the default
+ LRU Memory Cache, the same algorithm that EHCache
+ uses by default,
+ <b>
+ JCS proved to be nearly twice as fast as EHCache
+ </b>
+ in multiple trials for both puts and gets. I have
+ the log levels for both set at info. I would like to
+ further verify my results, since they completely
+ contradict the information on the EHCache site.
+ </p>
+ <p>
+ From what I can tell so far, JCS is significantly
+ faster than EHCache when you are retrieving items
+ that exist in the cache and when you are putting
+ items into a cache that has not reached its size
+ limit.
+ </p>
+ <p>
+ Additional testing shows that when the size limit it
+ reached, JCS and EHCache perform similarly for puts
+ and gets. Although JCS gets are significantly faster
+ when the items are present, they are almost exactly
+ the same when the items are not in the cache. My
+ initial tests revealed a less than 1% difference,
+ but subsequent runs showed JCS as 20% faster. More
+ tests are needed before the results are conclusive.
+ </p>
+ <p>
+ Since, neither cache will be a relevant bottleneck
+ in any application where a cache would be useful,
+ the differences in performance may be beside the
+ point. Nevertheless, it is important to note that
+ the EHCache web site provides, what appears to be,
+ false test data.
+ </p>
+ <p>
+ The peculiar result is that a few years back EHCache
+ took the JCS source code, removed most of its
+ features, and ended up with something that performs
+ worse.
+ </p>
+ </subsection>
+
+
+ <subsection name="Test Data">
+ <p>Here is the data from the first test:</p>
+ <p>
+ JCS put time for 50000 = 651; millis per = 0.01302
+ JCS get time for 50000 = 160; millis per = 0.0032
+ EHCache put time for 50000 = 481; millis per =
+ 0.00962 EHCache get time for 50000 = 110; millis per
+ = 0.0022
+ </p>
+ <p>
+ JCS put time for 50000 = 240; millis per = 0.0048
+ JCS get time for 50000 = 90; millis per = 0.0018
+ EHCache put time for 50000 = 491; millis per =
+ 0.00982 EHCache get time for 50000 = 120; millis per
+ = 0.0024
+ </p>
+ <p>
+ JCS put time for 50000 = 241; millis per = 0.00482
+ JCS get time for 50000 = 80; millis per = 0.0016
+ EHCache put time for 50000 = 551; millis per =
+ 0.01102 EHCache get time for 50000 = 110; millis per
+ = 0.0022
+ </p>
+ <p>
+ JCS put time for 50000 = 240; millis per = 0.0048
+ JCS get time for 50000 = 90; millis per = 0.0018
+ EHCache put time for 50000 = 481; millis per =
+ 0.00962 EHCache get time for 50000 = 130; millis per
+ = 0.0026
+ </p>
+ <p>
+ JCS put time for 50000 = 230; millis per = 0.0046
+ JCS get time for 50000 = 181; millis per = 0.00362
+ EHCache put time for 50000 = 520; millis per =
+ 0.0104 EHCache get time for 50000 = 101; millis per
+ = 0.00202
+ </p>
+ <p>
+ JCS put time for 50000 = 220; millis per = 0.0044
+ JCS get time for 50000 = 90; millis per = 0.0018
+ EHCache put time for 50000 = 641; millis per =
+ 0.01282 EHCache get time for 50000 = 110; millis per
+ = 0.0022
+ </p>
+ <p>
+ JCS put time for 50000 = 250; millis per = 0.0050
+ JCS get time for 50000 = 121; millis per = 0.00242
+ EHCache put time for 50000 = 590; millis per =
+ 0.0118 EHCache get time for 50000 = 101; millis per
+ = 0.00202
+ </p>
+ <p>
+ JCS put time for 50000 = 260; millis per = 0.0052
+ JCS get time for 50000 = 100; millis per = 0.0020
+ EHCache put time for 50000 = 581; millis per =
+ 0.01162 EHCache get time for 50000 = 100; millis per
+ = 0.0020
+ </p>
+ <p>
+ JCS put time for 50000 = 290; millis per = 0.0058
+ JCS get time for 50000 = 121; millis per = 0.00242
+ EHCache put time for 50000 = 570; millis per =
+ 0.0114 EHCache get time for 50000 = 121; millis per
+ = 0.00242
+ </p>
+ <p>
+ JCS put time for 50000 = 210; millis per = 0.0042
+ JCS get time for 50000 = 120; millis per = 0.0024
+ EHCache put time for 50000 = 561; millis per =
+ 0.01122 EHCache get time for 50000 = 130; millis per
+ = 0.0026
+ </p>
+ <p>
+ JCS put time for 50000 = 250; millis per = 0.0050
+ JCS get time for 50000 = 151; millis per = 0.00302
+ EHCache put time for 50000 = 560; millis per =
+ 0.0112 EHCache get time for 50000 = 111; millis per
+ = 0.00222
+ </p>
+ <p>
+ JCS put time for 50000 = 250; millis per = 0.0050
+ JCS get time for 50000 = 100; millis per = 0.0020
+ EHCache put time for 50000 = 711; millis per =
+ 0.01422 EHCache get time for 50000 = 100; millis per
+ = 0.0020
+ </p>
+ <p>
+ JCS put time for 50000 = 251; millis per = 0.00502
+ JCS get time for 50000 = 90; millis per = 0.0018
+ EHCache put time for 50000 = 511; millis per =
+ 0.01022 EHCache get time for 50000 = 90; millis per
+ = 0.0018
+ </p>
+ <p>
+ JCS put time for 50000 = 220; millis per = 0.0044
+ JCS get time for 50000 = 100; millis per = 0.0020
+ EHCache put time for 50000 = 491; millis per =
+ 0.00982 EHCache get time for 50000 = 90; millis per
+ = 0.0018
+ </p>
+ <p>
+ JCS put time for 50000 = 230; millis per = 0.0046
+ JCS get time for 50000 = 80; millis per = 0.0016
+ EHCache put time for 50000 = 201; millis per =
+ 0.00402 EHCache get time for 50000 = 390; millis per
+ = 0.0078
+ </p>
+ <p>
+ JCS put time for 50000 = 201; millis per = 0.00402
+ JCS get time for 50000 = 120; millis per = 0.0024
+ EHCache put time for 50000 = 180; millis per =
+ 0.0036 EHCache get time for 50000 = 411; millis per
+ = 0.00822
+ </p>
+ <p>
+ JCS put time for 50000 = 210; millis per = 0.0042
+ JCS get time for 50000 = 100; millis per = 0.0020
+ EHCache put time for 50000 = 210; millis per =
+ 0.0042 EHCache get time for 50000 = 381; millis per
+ = 0.00762
+ </p>
+ <p>
+ JCS put time for 50000 = 240; millis per = 0.0048
+ JCS get time for 50000 = 90; millis per = 0.0018
+ EHCache put time for 50000 = 211; millis per =
+ 0.00422 EHCache get time for 50000 = 410; millis per
+ = 0.0082
+ </p>
+ <p>
+ JCS put time for 50000 = 221; millis per = 0.00442
+ JCS get time for 50000 = 80; millis per = 0.0016
+ EHCache put time for 50000 = 210; millis per =
+ 0.0042 EHCache get time for 50000 = 411; millis per
+ = 0.00822
+ </p>
+ <p>
+ JCS put time for 50000 = 220; millis per = 0.0044
+ JCS get time for 50000 = 80; millis per = 0.0016
+ EHCache put time for 50000 = 190; millis per =
+ 0.0038 EHCache get time for 50000 = 411; millis per
+ = 0.00822
+ </p>
+ <p>Finished 20 loops of 50000 gets and puts</p>
+ <p>
+ Put average for JCS = 256 Put average for EHCache =
+ 447 JCS puts took 0.57270694 times the EHCache , the
+ goal is less than 1.0x
+ </p>
+ <p>
+ Get average for JCS = 107 Get average for EHCache =
+ 196 JCS gets took 0.54591835 times the EHCache , the
+ goal is less than 1.0x
+ </p>
+ </subsection>
+
+ <subsection name="A Test Class">
+ <p>Here is the test class:</p>
+
+ <source>
+ <![CDATA[
+package org.apache.jcs;
+
+import junit.framework.TestCase;
+import net.sf.ehcache.Cache;
+import net.sf.ehcache.CacheManager;
+import net.sf.ehcache.Element;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.jcs.engine.CompositeCacheAttributes;
+import org.apache.jcs.engine.behavior.ICompositeCacheAttributes;
+import org.apache.jcs.utils.struct.LRUMap;
+
+/**
+ * Compare JCS vs ehcache performance.
+ *
+ * @author Aaron Smuts
+ *
+ */
+public class JCSvsEHCachePerformanceTest
+ extends TestCase
+{
+
+ float ratioPut = 0;
+
+ float ratioGet = 0;
+
+ // the jcs to competitor
+ float target = 1.0f;
+
+ int loops = 20;
+
+ int tries = 50000;
+
+ /**
+ * Compare performance between JCS and EHCache. Fail if JCS is not as fast.
+ * Print the ratio.
+ *
+ * @throws Exception
+ *
+ */
+ public void testJCSvsEHCache()
+ throws Exception
+ {
+
+ Log log = LogFactory.getLog( LRUMap.class );
+ if ( log.isDebugEnabled() )
+ {
+ System.out.println( "The log level must be at info or above for the a performance test." );
+ return;
+ }
+
+ doWork();
+
+ assertTrue( this.ratioPut < target );
+ assertTrue( this.ratioGet < target );
+
+ }
+
+ /**
+ * This runs a series of gets and puts for both JCS and EHCache. The test
+ * will fail if JCS is not faster.
+ *
+ * @throws Exception
+ *
+ */
+ public void doWork()
+ throws Exception
+ {
+
+ int maxSize = 1000000;
+
+ // create the two caches.
+ CacheManager ehMgr = CacheManager.getInstance();
+ // Create an ehcache with a max size of maxSize, no swap, with items
+ // that can expire, with maximum idle time to live of 500 seconds, and
+ // maximum idel time of 500 seconds.
+ Cache eh = new Cache( "testJCSvsEHCache", maxSize, false, false, 500, 500 );
+ ehMgr.addCache( eh );
+
+ // Create a similarly configured JCS that uses the LRU memory cache.
+ // maxSize elements that are not eternal. No disk cache is configured.
+ ICompositeCacheAttributes cattr = new CompositeCacheAttributes();
+ cattr.setMaxObjects( maxSize );
+ JCS jcs = JCS.getInstance( "testJCSvsEHCache", cattr );
+
+ // run settings
+ long start = 0;
+ long end = 0;
+ long time = 0;
+ float tPer = 0;
+
+ long putTotalJCS = 0;
+ long getTotalJCS = 0;
+ long putTotalEHCache = 0;
+ long getTotalEHCache = 0;
+
+ String jcsDisplayName = "JCS";
+ String ehCacheDisplayName = "";
+
+ try
+ {
+ for ( int j = 0; j < loops; j++ )
+ {
+
+ jcsDisplayName = "JCS ";
+ start = System.currentTimeMillis();
+ for ( int i = 0; i < tries; i++ )
+ {
+ jcs.put( "key:" + i, "data" + i );
+ }
+ end = System.currentTimeMillis();
+ time = end - start;
+ putTotalJCS += time;
+ tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
+ System.out
+ .println( jcsDisplayName + " put time for " + tries + " = " + time + "; millis per = " + tPer );
+
+ start = System.currentTimeMillis();
+ for ( int i = 0; i < tries; i++ )
+ {
+ jcs.get( "key:" + i );
+ }
+ end = System.currentTimeMillis();
+ time = end - start;
+ getTotalJCS += time;
+ tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
+ System.out
+ .println( jcsDisplayName + " get time for " + tries + " = " + time + "; millis per = " + tPer );
+
+ // /////////////////////////////////////////////////////////////
+ ehCacheDisplayName = "EHCache ";
+
+ start = System.currentTimeMillis();
+ for ( int i = 0; i < tries; i++ )
+ {
+ Element ehElm = new Element( "key:" + i, "data" + i );
+
+ eh.put( ehElm );
+ }
+ end = System.currentTimeMillis();
+ time = end - start;
+ putTotalEHCache += time;
+ tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
+ System.out.println( ehCacheDisplayName + " put time for " + tries + " = " + time + "; millis per = "
+ + tPer );
+
+ start = System.currentTimeMillis();
+ for ( int i = 0; i < tries; i++ )
+ {
+ eh.get( "key:" + i );
+ }
+ end = System.currentTimeMillis();
+ time = end - start;
+ getTotalEHCache += time;
+ tPer = Float.intBitsToFloat( (int) time ) / Float.intBitsToFloat( tries );
+ System.out.println( ehCacheDisplayName + " get time for " + tries + " = " + time + "; millis per = "
+ + tPer );
+
+ System.out.println( "\n" );
+ }
+
+ }
+ catch ( Exception e )
+ {
+ e.printStackTrace( System.out );
+ System.out.println( e );
+ }
+
+ long putAvJCS = putTotalJCS / loops;
+ long getAvJCS = getTotalJCS / loops;
+ long putAvHashtable = putTotalEHCache / loops;
+ long getAvHashtable = getTotalEHCache / loops;
+
+ System.out.println( "Finished " + loops + " loops of " + tries + " gets and puts" );
+
+ System.out.println( "\n" );
+ System.out.println( "Put average for " + jcsDisplayName + " = " + putAvJCS );
+ System.out.println( "Put average for " + ehCacheDisplayName + " = " + putAvHashtable );
+ ratioPut = Float.intBitsToFloat( (int) putAvJCS ) / Float.intBitsToFloat( (int) putAvHashtable );
+ System.out.println( jcsDisplayName + " puts took " + ratioPut + " times the " + ehCacheDisplayName
+ + ", the goal is <" + target + "x" );
+
+ System.out.println( "\n" );
+ System.out.println( "Get average for " + jcsDisplayName + " = " + getAvJCS );
+ System.out.println( "Get average for " + ehCacheDisplayName + " = " + getAvHashtable );
+ ratioGet = Float.intBitsToFloat( (int) getAvJCS ) / Float.intBitsToFloat( (int) getAvHashtable );
+ System.out.println( jcsDisplayName + " gets took " + ratioGet + " times the " + ehCacheDisplayName
+ + ", the goal is <" + target + "x" );
+
+ }
+
+}
+
+ ]]>
+ </source>
+ </subsection>
+ </section>
+
+
+ <section name="JCS vs EHCache Disk Cache">
+ <p>
+ It is very difficult to compare the ehcache disk store
+ and the JCS Indexed Disk Cache.
+ </p>
+ <p>The JCS version is much more sophisticated.</p>
+ <p>
+ JCS puts items into a queue called purgatory. While they
+ are in this queue, they are still accessible. This queue
+ gets worked when items are in it. The number of threads
+ used in the system as a whole for disk caches is
+ configurable using the thread pool configuration options
+ in JCS. I could have 1000 regions and only use 3 threads
+ to work the disk queues. From what I can tell EH will
+ use 1 thread per region. This is worse than the JCS
+ default, which uses a queue that kills its threads when
+ they are not used. . . . and much worse than using JCS
+ with a thread pool.
+ </p>
+ <p>
+ The size of JCS purgatory is configurable, so you can
+ avoid catastrophe if something goes wrong with the queue
+ worker. EH doesn't have any such safety.
+ </p>
+ <p>
+ JCS limits the number of keys that can be kept for the
+ disk cache. EH cannot do this.
+ </p>
+ <p>
+ The ehcache disk version is very simple. It puts an
+ unlimited number of items in a temporary store. You can
+ easily fill this up and run out of memory. You can put
+ items into JCS purgatory faster than they can be gc'd
+ but it is much more difficult. The EH store is then
+ flushed to disk every 200ms. While EH is flushing the
+ entire disk cache blocks!
+ </p>
+ <p>
+ JCS disk cache is based on a continuous spooling model,
+ not a stop the world model like EH. In most cases the EH
+ model will work out, but not if you put a lot of big
+ items on disk at once. If you want an even distribution
+ of disk cache response times, then you should use JCS.
+ </p>
+ <p>
+ The EH disk store also seems to just keep growing. After
+ several tests, the size of the data file was 10 times
+ that of JCS and EH was taking 10 times as long.
+ </p>
+ <p>
+ You can saturate the EH version much more quickly, since
+ it will hold as many items as you can put in in 200 ms.
+ </p>
+ <p>
+ I tried with 100k and JCS could handle it, but EH died
+ with an out of memory exception.
+ </p>
+ <p>
+ EH cache developed its disk store in response to a bug
+ in the JCS version. This bug was fixed a few years ago .
+ . . The nice thing about JCS is that it is completely
+ pluggable. It would take about 30 minutes to plug a
+ different disk cache implementation into JCS if you so
+ pleased . . . .
+ </p>
+ </section>
+
+ </body>
+</document>
Modified: jakarta/jcs/trunk/xdocs/JDBCDiskCache.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/JDBCDiskCache.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/JDBCDiskCache.xml (original)
+++ jakarta/jcs/trunk/xdocs/JDBCDiskCache.xml Thu May 10 09:03:42 2007
@@ -1,107 +1,125 @@
-<?xml version="1.0"?>
-
-<document>
- <properties>
- <title>JDBC Disk Cache</title>
- <author email="[email protected]">Aaron Smuts</author>
- </properties>
-
- <body>
- <section name="JDBC Disk Auxiliary Cache">
- <p>
- The JDBC disk cache uses a relational database such as
- MySQL as a persistent store. It works with Oracle, MySQL
- and HSQL. The cache elements are serialized and written
- into a BLOB. Multiple regions can share a single table.
- You can define multiple, differently configured JDBC
- disk caches in one JCS instance. This allows you to use
- different tables for different cache regions.
- </p>
-
- <subsection name="Example cache.ccf (MySQL)">
- <source>
- <![CDATA[
-##############################################################
-################## DEFAULT CACHE REGION #####################
-# sets the default aux value for any non configured caches
-jcs.default=MYSQL,RCluster
-jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
-jcs.default.cacheattributes.MaxObjects=5000
-jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
-jcs.default.cacheattributes.UseMemoryShrinker=true
-jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=7200
-jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
-jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
-jcs.default.elementattributes.IsEternal=false
-jcs.default.elementattributes.MaxLifeSeconds=14400
-jcs.default.elementattributes.IdleTime=14400
-jcs.default.elementattributes.IsSpool=true
-jcs.default.elementattributes.IsRemote=true
-jcs.default.elementattributes.IsLateral=true
-
-##############################################################
-################## CACHE REGIONS AVAILABLE ###################
-
-##############################################################
-################## AUXILIARY CACHES AVAILABLE ################
-# MYSQL disk cache used for flight options
-jcs.auxiliary.MYSQL=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
-jcs.auxiliary.MYSQL.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
-jcs.auxiliary.MYSQL.attributes.userName=myUsername
-jcs.auxiliary.MYSQL.attributes.password=myPassword
-jcs.auxiliary.MYSQL.attributes.url=${MYSQL}
-jcs.auxiliary.MYSQL.attributes.driverClassName=org.gjt.mm.mysql.Driver
-jcs.auxiliary.MYSQL.attributes.tableName=JCS_STORE
-jcs.auxiliary.MYSQL.attributes.testBeforeInsert=false
-jcs.auxiliary.MYSQL.attributes.maxActive=100
-jcs.auxiliary.MYSQL.attributes.MaxPurgatorySize=10000000
-jcs.auxiliary.MYSQL.attributes.UseDiskShrinker=true
-jcs.auxiliary.MYSQL.attributes.ShrinkerIntervalSeconds=1800
-jcs.auxiliary.MYSQL.attributes.allowRemoveAll=false
-jcs.auxiliary.MYSQL.attributes.EventQueueType=POOLED
-jcs.auxiliary.MYSQL.attributes.EventQueuePoolName=disk_cache_event_queue
-
-##############################################################
-################## OPTIONAL THREAD POOL CONFIGURATION #########
-# Disk Cache pool
-thread_pool.disk_cache_event_queue.useBoundary=true
-thread_pool.disk_cache_event_queue.boundarySize=1000
-thread_pool.disk_cache_event_queue.maximumPoolSize=50
-thread_pool.disk_cache_event_queue.minimumPoolSize=10
-thread_pool.disk_cache_event_queue.keepAliveTime=3500
-thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN
-thread_pool.disk_cache_event_queue.startUpSize=10
- ]]>
- </source>
- </subsection>
-
-
- <subsection name="Table Creation Script (MySQL)">
- <source>
- <![CDATA[
-drop TABLE JCS_STORE;
-
-CREATE TABLE JCS_STORE
-(
- CACHE_KEY VARCHAR(250) NOT NULL,
- REGION VARCHAR(250) NOT NULL,
- ELEMENT BLOB,
- CREATE_TIME DATETIME,
- CREATE_TIME_SECONDS BIGINT,
- MAX_LIFE_SECONDS BIGINT,
- SYSTEM_EXPIRE_TIME_SECONDS BIGINT,
- IS_ETERNAL CHAR(1),
- PRIMARY KEY (CACHE_KEY, REGION)
-);
-
-alter table JCS_STORE MAX_ROWS = 10000000;
-
-alter table JCS_STORE AVG_ROW_LENGTH = 2100;
-
-create index JCS_STORE_DELETE_IDX on JCS_STORE (SYSTEM_EXPIRE_TIME_SECONDS,IS_ETERNAL,REGION);
- ]]>
- </source>
- </subsection>
- </section>
- </body>
-</document>
\ No newline at end of file
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<document>
+ <properties>
+ <title>JDBC Disk Cache</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="JDBC Disk Auxiliary Cache">
+ <p>
+ The JDBC disk cache uses a relational database such as
+ MySQL as a persistent store. It works with Oracle, MySQL
+ and HSQL. The cache elements are serialized and written
+ into a BLOB. Multiple regions can share a single table.
+ You can define multiple, differently configured JDBC
+ disk caches in one JCS instance. This allows you to use
+ different tables for different cache regions.
+ </p>
+
+ <subsection name="Example cache.ccf (MySQL)">
+ <source>
+ <![CDATA[
+##############################################################
+################## DEFAULT CACHE REGION #####################
+# sets the default aux value for any non configured caches
+jcs.default=MYSQL,RCluster
+jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
+jcs.default.cacheattributes.MaxObjects=5000
+jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
+jcs.default.cacheattributes.UseMemoryShrinker=true
+jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=7200
+jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
+jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
+jcs.default.elementattributes.IsEternal=false
+jcs.default.elementattributes.MaxLifeSeconds=14400
+jcs.default.elementattributes.IdleTime=14400
+jcs.default.elementattributes.IsSpool=true
+jcs.default.elementattributes.IsRemote=true
+jcs.default.elementattributes.IsLateral=true
+
+##############################################################
+################## CACHE REGIONS AVAILABLE ###################
+
+##############################################################
+################## AUXILIARY CACHES AVAILABLE ################
+# MYSQL disk cache used for flight options
+jcs.auxiliary.MYSQL=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
+jcs.auxiliary.MYSQL.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
+jcs.auxiliary.MYSQL.attributes.userName=myUsername
+jcs.auxiliary.MYSQL.attributes.password=myPassword
+jcs.auxiliary.MYSQL.attributes.url=${MYSQL}
+jcs.auxiliary.MYSQL.attributes.driverClassName=org.gjt.mm.mysql.Driver
+jcs.auxiliary.MYSQL.attributes.tableName=JCS_STORE
+jcs.auxiliary.MYSQL.attributes.testBeforeInsert=false
+jcs.auxiliary.MYSQL.attributes.maxActive=100
+jcs.auxiliary.MYSQL.attributes.MaxPurgatorySize=10000000
+jcs.auxiliary.MYSQL.attributes.UseDiskShrinker=true
+jcs.auxiliary.MYSQL.attributes.ShrinkerIntervalSeconds=1800
+jcs.auxiliary.MYSQL.attributes.allowRemoveAll=false
+jcs.auxiliary.MYSQL.attributes.EventQueueType=POOLED
+jcs.auxiliary.MYSQL.attributes.EventQueuePoolName=disk_cache_event_queue
+
+##############################################################
+################## OPTIONAL THREAD POOL CONFIGURATION #########
+# Disk Cache pool
+thread_pool.disk_cache_event_queue.useBoundary=true
+thread_pool.disk_cache_event_queue.boundarySize=1000
+thread_pool.disk_cache_event_queue.maximumPoolSize=50
+thread_pool.disk_cache_event_queue.minimumPoolSize=10
+thread_pool.disk_cache_event_queue.keepAliveTime=3500
+thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.disk_cache_event_queue.startUpSize=10
+ ]]>
+ </source>
+ </subsection>
+
+
+ <subsection name="Table Creation Script (MySQL)">
+ <source>
+ <![CDATA[
+drop TABLE JCS_STORE;
+
+CREATE TABLE JCS_STORE
+(
+ CACHE_KEY VARCHAR(250) NOT NULL,
+ REGION VARCHAR(250) NOT NULL,
+ ELEMENT BLOB,
+ CREATE_TIME DATETIME,
+ CREATE_TIME_SECONDS BIGINT,
+ MAX_LIFE_SECONDS BIGINT,
+ SYSTEM_EXPIRE_TIME_SECONDS BIGINT,
+ IS_ETERNAL CHAR(1),
+ PRIMARY KEY (CACHE_KEY, REGION)
+);
+
+alter table JCS_STORE MAX_ROWS = 10000000;
+
+alter table JCS_STORE AVG_ROW_LENGTH = 2100;
+
+create index JCS_STORE_DELETE_IDX on JCS_STORE (SYSTEM_EXPIRE_TIME_SECONDS,IS_ETERNAL,REGION);
+ ]]>
+ </source>
+ </subsection>
+ </section>
+ </body>
+</document>
Modified: jakarta/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml (original)
+++ jakarta/jcs/trunk/xdocs/JDBCDiskCacheProperties.xml Thu May 10 09:03:42 2007
@@ -1,232 +1,250 @@
-<?xml version="1.0"?>
-
-<document>
- <properties>
- <title>JDBC Disk Cache Configuration</title>
- <author email="[email protected]">Aaron Smuts</author>
- </properties>
-
- <body>
- <section name="JDBC Disk Auxiliary Cache Configuration">
-
- <p>
- The following properties apply to the JDBC Disk Cache
- plugin.
- </p>
-
- <subsection name="JDBC Disk Configuration Properties">
- <table>
- <tr>
- <th>Property</th>
- <th>Description</th>
- <th>Required</th>
- <th>Default Value</th>
- </tr>
- <tr>
- <td>MaxPurgatorySize</td>
- <td>
- The maximum number of items allowed in the
- queue of items to be written to disk.
- </td>
- <td>N</td>
- <td>5000</td>
- </tr>
-
- <tr>
- <td>url</td>
- <td>
- The database url. The database name will be
- added to this value to create the full
- database url.
- </td>
- <td>Y</td>
- <td></td>
- </tr>
-
- <tr>
- <td>database</td>
- <td>This is appended to the url.</td>
- <td>Y</td>
- <td></td>
- </tr>
-
- <tr>
- <td>driverClassName</td>
- <td>
- The class name of the driver to talk to your
- database.
- </td>
- <td>Y</td>
- <td></td>
- </tr>
-
- <tr>
- <td>tableName</td>
- <td>The name of the table.</td>
- <td>N</td>
- <td>JCS_STORE</td>
- </tr>
-
- <tr>
- <td>testBeforeInsert</td>
- <td>
- Should the disk cache do a select before
- trying to insert new element on update, or
- should it try to insert and handle the
- error.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
-
- <tr>
- <td>maxActive</td>
- <td>
- This sets the maximum number of connections
- allowed.
- </td>
- <td>Y</td>
- <td></td>
- </tr>
-
- <tr>
- <td>allowRemoveAll</td>
- <td>
- Should the disk cache honor remove all (i.e.
- clear) requests. You might set this to false
- to prevent someone from accidentally
- clearing out an entire database.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
-
- <tr>
- <td>UseDiskShrinker</td>
- <td>
- Should the disk cache try to delete expired
- items from the database.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
-
- <tr>
- <td>ShrinkerIntervalSeconds</td>
- <td>How often should the disk shrinker run.</td>
- <td>N</td>
- <td>300</td>
- </tr>
-
- </table>
- </subsection>
-
- <subsection name="Example Configuration">
- <source>
- <![CDATA[
-##############################################################
-################## AUXILIARY CACHES AVAILABLE ################
-# JDBC disk cache
-jcs.auxiliary.JDBC=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
-jcs.auxiliary.JDBC.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
-jcs.auxiliary.JDBC.attributes.userName=sa
-jcs.auxiliary.JDBC.attributes.password=
-jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
-jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
-jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
-jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
-jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
-jcs.auxiliary.JDBC.attributes.maxActive=15
-jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
-jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
-jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
-jcs.auxiliary.JDBC.attributes.ShrinkerIntervalSeconds=300
- ]]>
- </source>
- </subsection>
-
- <subsection name="JDBC Disk Event Queue Configuration">
-
- <table>
- <tr>
- <th>Property</th>
- <th>Description</th>
- <th>Required</th>
- <th>Default Value</th>
- </tr>
- <tr>
- <td>EventQueueType</td>
- <td>
- This should be either SINGLE or POOLED. By
- default the single style pool is used. The
- single style pool uses a single thread per
- event queue. That thread is killed whenever
- the queue is inactive for 30 seconds. Since
- the disk cache uses an event queue for every
- region, if you have many regions and they
- are all active, you will be using many
- threads. To limit the number of threads, you
- can configure the disk cache to use the
- pooled event queue. Using more threads than
- regions will not add any benefit for the
- indexed disk cache, since only one thread
- can read or write at a time for a single
- region.
- </td>
- <td>N</td>
- <td>SINGLE</td>
- </tr>
- <tr>
- <td>EventQueuePoolName</td>
- <td>
- This is the name of the pool to use. It is
- required if you choose the POOLED event
- queue type, otherwise it is ignored.
- </td>
- <td>Y</td>
- <td>n/a</td>
- </tr>
- </table>
- </subsection>
-
- <subsection
- name="Example Configuration Using Thread Pool">
- <source>
- <![CDATA[
-##############################################################
-################## AUXILIARY CACHES AVAILABLE ################
-# JDBC disk cache
-jcs.auxiliary.JDBC=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
-jcs.auxiliary.JDBC.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
-jcs.auxiliary.JDBC.attributes.userName=sa
-jcs.auxiliary.JDBC.attributes.password=
-jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
-jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
-jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
-jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
-jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
-jcs.auxiliary.JDBC.attributes.maxActive=15
-jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
-jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
-jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
-jcs.auxiliary.JDBC.attributes.ShrinkerIntervalSeconds=300
-jcs.auxiliary.JDBC.attributes.EventQueueType=POOLED
-jcs.auxiliary.JDBC.attributes.EventQueuePoolName=disk_cache_event_queueue
-
-##############################################################
-################## OPTIONAL THREAD POOL CONFIGURATION #########
-# Disk Cache pool
-thread_pool.disk_cache_event_queue.useBoundary=false
-thread_pool.disk_cache_event_queue.boundarySize=500
-thread_pool.disk_cache_event_queue.maximumPoolSize=15
-thread_pool.disk_cache_event_queue.minimumPoolSize=10
-thread_pool.disk_cache_event_queue.keepAliveTime=3500
-thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN
-thread_pool.disk_cache_event_queue.startUpSize=10
- ]]>
- </source>
- </subsection>
-
- </section>
- </body>
-</document>
\ No newline at end of file
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<document>
+ <properties>
+ <title>JDBC Disk Cache Configuration</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="JDBC Disk Auxiliary Cache Configuration">
+
+ <p>
+ The following properties apply to the JDBC Disk Cache
+ plugin.
+ </p>
+
+ <subsection name="JDBC Disk Configuration Properties">
+ <table>
+ <tr>
+ <th>Property</th>
+ <th>Description</th>
+ <th>Required</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>MaxPurgatorySize</td>
+ <td>
+ The maximum number of items allowed in the
+ queue of items to be written to disk.
+ </td>
+ <td>N</td>
+ <td>5000</td>
+ </tr>
+
+ <tr>
+ <td>url</td>
+ <td>
+ The database url. The database name will be
+ added to this value to create the full
+ database url.
+ </td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>database</td>
+ <td>This is appended to the url.</td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>driverClassName</td>
+ <td>
+ The class name of the driver to talk to your
+ database.
+ </td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>tableName</td>
+ <td>The name of the table.</td>
+ <td>N</td>
+ <td>JCS_STORE</td>
+ </tr>
+
+ <tr>
+ <td>testBeforeInsert</td>
+ <td>
+ Should the disk cache do a select before
+ trying to insert new element on update, or
+ should it try to insert and handle the
+ error.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+
+ <tr>
+ <td>maxActive</td>
+ <td>
+ This sets the maximum number of connections
+ allowed.
+ </td>
+ <td>Y</td>
+ <td></td>
+ </tr>
+
+ <tr>
+ <td>allowRemoveAll</td>
+ <td>
+ Should the disk cache honor remove all (i.e.
+ clear) requests. You might set this to false
+ to prevent someone from accidentally
+ clearing out an entire database.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+
+ <tr>
+ <td>UseDiskShrinker</td>
+ <td>
+ Should the disk cache try to delete expired
+ items from the database.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+
+ <tr>
+ <td>ShrinkerIntervalSeconds</td>
+ <td>How often should the disk shrinker run.</td>
+ <td>N</td>
+ <td>300</td>
+ </tr>
+
+ </table>
+ </subsection>
+
+ <subsection name="Example Configuration">
+ <source>
+ <![CDATA[
+##############################################################
+################## AUXILIARY CACHES AVAILABLE ################
+# JDBC disk cache
+jcs.auxiliary.JDBC=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
+jcs.auxiliary.JDBC.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
+jcs.auxiliary.JDBC.attributes.userName=sa
+jcs.auxiliary.JDBC.attributes.password=
+jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
+jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
+jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
+jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
+jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
+jcs.auxiliary.JDBC.attributes.maxActive=15
+jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
+jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
+jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
+jcs.auxiliary.JDBC.attributes.ShrinkerIntervalSeconds=300
+ ]]>
+ </source>
+ </subsection>
+
+ <subsection name="JDBC Disk Event Queue Configuration">
+
+ <table>
+ <tr>
+ <th>Property</th>
+ <th>Description</th>
+ <th>Required</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>EventQueueType</td>
+ <td>
+ This should be either SINGLE or POOLED. By
+ default the single style pool is used. The
+ single style pool uses a single thread per
+ event queue. That thread is killed whenever
+ the queue is inactive for 30 seconds. Since
+ the disk cache uses an event queue for every
+ region, if you have many regions and they
+ are all active, you will be using many
+ threads. To limit the number of threads, you
+ can configure the disk cache to use the
+ pooled event queue. Using more threads than
+ regions will not add any benefit for the
+ indexed disk cache, since only one thread
+ can read or write at a time for a single
+ region.
+ </td>
+ <td>N</td>
+ <td>SINGLE</td>
+ </tr>
+ <tr>
+ <td>EventQueuePoolName</td>
+ <td>
+ This is the name of the pool to use. It is
+ required if you choose the POOLED event
+ queue type, otherwise it is ignored.
+ </td>
+ <td>Y</td>
+ <td>n/a</td>
+ </tr>
+ </table>
+ </subsection>
+
+ <subsection
+ name="Example Configuration Using Thread Pool">
+ <source>
+ <![CDATA[
+##############################################################
+################## AUXILIARY CACHES AVAILABLE ################
+# JDBC disk cache
+jcs.auxiliary.JDBC=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheFactory
+jcs.auxiliary.JDBC.attributes=org.apache.jcs.auxiliary.disk.jdbc.JDBCDiskCacheAttributes
+jcs.auxiliary.JDBC.attributes.userName=sa
+jcs.auxiliary.JDBC.attributes.password=
+jcs.auxiliary.JDBC.attributes.url=jdbc:hsqldb:
+jcs.auxiliary.JDBC.attributes.database=target/cache_hsql_db
+jcs.auxiliary.JDBC.attributes.driverClassName=org.hsqldb.jdbcDriver
+jcs.auxiliary.JDBC.attributes.tableName=JCS_STORE2
+jcs.auxiliary.JDBC.attributes.testBeforeInsert=false
+jcs.auxiliary.JDBC.attributes.maxActive=15
+jcs.auxiliary.JDBC.attributes.allowRemoveAll=true
+jcs.auxiliary.JDBC.attributes.MaxPurgatorySize=10000000
+jcs.auxiliary.JDBC.attributes.UseDiskShrinker=true
+jcs.auxiliary.JDBC.attributes.ShrinkerIntervalSeconds=300
+jcs.auxiliary.JDBC.attributes.EventQueueType=POOLED
+jcs.auxiliary.JDBC.attributes.EventQueuePoolName=disk_cache_event_queueue
+
+##############################################################
+################## OPTIONAL THREAD POOL CONFIGURATION #########
+# Disk Cache pool
+thread_pool.disk_cache_event_queue.useBoundary=false
+thread_pool.disk_cache_event_queue.boundarySize=500
+thread_pool.disk_cache_event_queue.maximumPoolSize=15
+thread_pool.disk_cache_event_queue.minimumPoolSize=10
+thread_pool.disk_cache_event_queue.keepAliveTime=3500
+thread_pool.disk_cache_event_queue.whenBlockedPolicy=RUN
+thread_pool.disk_cache_event_queue.startUpSize=10
+ ]]>
+ </source>
+ </subsection>
+
+ </section>
+ </body>
+</document>
Modified: jakarta/jcs/trunk/xdocs/LateralJavaGroupsAuxCache.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/LateralJavaGroupsAuxCache.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/LateralJavaGroupsAuxCache.xml (original)
+++ jakarta/jcs/trunk/xdocs/LateralJavaGroupsAuxCache.xml Thu May 10 09:03:42 2007
@@ -1,40 +1,58 @@
-<?xml version="1.0"?>
-
-<document>
- <properties>
- <title>Lateral JGroups Auxiliary Cache</title>
- <author email="[email protected]">Aaron Smuts</author>
- </properties>
-
- <body>
- <section name="Lateral JGroups Auxiliary Cache">
- <p>
- The Lateral JGroups Auxiliary Cache is an optional plug in for
- JCS. It is primarily intended to broadcast puts and removals to
- other local caches, though it can also get cached objects. It uses JGroups
- for distribution.
- </p>
- <p>
- The Lateral Lateral JGroups Auxiliary Cache is far slower than
- that Lateral TCP Auxiliary Cache. Since the Lateral TCP Auxiliary
- is faster and has UDP discovery built in, the TCP auxiliary is the recommended form of lateral
- distribution. However, the JGroups Auxiliary requires fewer socket connections than
- the TCP lateral.
- </p>
- <p>
- A functional configuration example is below:
- </p>
-
- <source><![CDATA[
-# Lateral JavaGroups Distribution
-jcs.auxiliary.LJG=org.apache.jcs.auxiliary.lateral.LateralCacheFactory
-jcs.auxiliary.LJG.attributes=org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
-jcs.auxiliary.LJG.attributes.TransmissionTypeName=JAVAGROUPS
-jcs.auxiliary.LJG.attributes.PutOnlyMode=true
-jcs.auxiliary.LJG.attributes.JGChannelProperties=UDP(mcast_addr=224.0.0.100;mcast_port=7501):PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:QUEUE
- ]]></source>
-
-
- </section>
- </body>
-</document>
\ No newline at end of file
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<document>
+ <properties>
+ <title>Lateral JGroups Auxiliary Cache</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="Lateral JGroups Auxiliary Cache">
+ <p>
+ The Lateral JGroups Auxiliary Cache is an optional plug in for
+ JCS. It is primarily intended to broadcast puts and removals to
+ other local caches, though it can also get cached objects. It uses JGroups
+ for distribution.
+ </p>
+ <p>
+ The Lateral Lateral JGroups Auxiliary Cache is far slower than
+ that Lateral TCP Auxiliary Cache. Since the Lateral TCP Auxiliary
+ is faster and has UDP discovery built in, the TCP auxiliary is the recommended form of lateral
+ distribution. However, the JGroups Auxiliary requires fewer socket connections than
+ the TCP lateral.
+ </p>
+ <p>
+ A functional configuration example is below:
+ </p>
+
+ <source><![CDATA[
+# Lateral JavaGroups Distribution
+jcs.auxiliary.LJG=org.apache.jcs.auxiliary.lateral.LateralCacheFactory
+jcs.auxiliary.LJG.attributes=org.apache.jcs.auxiliary.lateral.LateralCacheAttributes
+jcs.auxiliary.LJG.attributes.TransmissionTypeName=JAVAGROUPS
+jcs.auxiliary.LJG.attributes.PutOnlyMode=true
+jcs.auxiliary.LJG.attributes.JGChannelProperties=UDP(mcast_addr=224.0.0.100;mcast_port=7501):PING:FD:STABLE:NAKACK:UNICAST:FRAG:FLUSH:GMS:QUEUE
+ ]]></source>
+
+
+ </section>
+ </body>
+</document>
Modified: jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml (original)
+++ jakarta/jcs/trunk/xdocs/LateralTCPAuxCache.xml Thu May 10 09:03:42 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
<properties>
@@ -9,7 +27,7 @@
<body>
<section name="Lateral TCP Auxiliary Cache">
- <p>
+ <p>
The TCP Lateral Auxiliary Cache is an optional plug in for the
JCS. It is primarily intended to broadcast puts and removals to
other local caches, though it can also get cached objects. It
@@ -41,7 +59,7 @@
Lateral Auxiliary Cache referenced by <code>LTCP</code>. It
connects to two servers defined in a comma separated list in
the <code>TcpServers</code> attribute. It listens to port
- <code>1110</code> and does <code>AllowGet</code>.
+ <code>1110</code> and does <code>AllowGet</code>.
Setting <code>AllowGet</code>
equal to <code>false</code> would cause the auxiliary cache to
return <code>null</code> from any get request. In most cases this
@@ -68,17 +86,17 @@
in send only mode by setting the <code>Receive</code> attribute
to false. By default the receive attribute is true.
When it is set to false, the lateral cache will not
- establish a socket server.
+ establish a socket server.
</p>
<p>
- Setting receive to false allows you to broadcast puts
+ Setting receive to false allows you to broadcast puts
and removes, but not receive any. This is useful for
nodes of an application that produce data, but are not
involved in data retrieval.
</p>
<p>
The configuration below is the same as above, except the
- <code>Receive</code> attribute is set to false. It also uses UDP
+ <code>Receive</code> attribute is set to false. It also uses UDP
discovery to find the servers, rather than listing them in the
servers attribute.
</p>
@@ -96,7 +114,7 @@
jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false
]]></source>
</subsection>
-
+
<subsection name="Potential Issues">
<p>
The TCP Lateral Auxiliary Cache can provide a high level of
@@ -130,7 +148,7 @@
I added a <code>IssueRemoveOnPut</code> attribute that
causes the lateral cache to remove an element from the
cache rather than inserting it when a put. This allows the local caches to
- dictate their own memory usage pattern.
+ dictate their own memory usage pattern.
</p>
</subsection>
</section>
Modified: jakarta/jcs/trunk/xdocs/LateralTCPProperties.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/LateralTCPProperties.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/LateralTCPProperties.xml (original)
+++ jakarta/jcs/trunk/xdocs/LateralTCPProperties.xml Thu May 10 09:03:42 2007
@@ -1,131 +1,149 @@
-<?xml version="1.0"?>
-
-<document>
- <properties>
- <title>Lateral TCP Auxiliary Cache Configuration</title>
- <author email="[email protected]">Aaron Smuts</author>
- </properties>
-
- <body>
- <section name="Lateral TCP Auxiliary Cache Configuration">
-
- <p>
- The following properties apply to the TCP Lateral Cache plugin.
- </p>
-
- <subsection name="TCP Configuration Properties">
- <table>
- <tr>
- <th>Property</th>
- <th>Description</th>
- <th>Required</th>
- <th>Default Value</th>
- </tr>
- <tr>
- <td>TcpServers</td>
- <td>
- This is the list of servers this cache should try to connect to.
- With UDP discovery this is not necessary.
- </td>
- <td>N</td>
- <td>none</td>
- </tr>
- <tr>
- <td>TcpListenerPort</td>
- <td>
- This is the port this cache should listen on.
- </td>
- <td>Y</td>
- <td>n/a</td>
- </tr>
- <tr>
- <td>AllowGet</td>
- <td>
- Should this cache be allowed to get from other laterals. False means
- that it can only put, i.e. send updates and remove requests to other laterals.
- Lateral gets are not recommended for performance reasons. This used to be
- controlled by the attribute PutOnlyMode.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
- <tr>
- <td>Receive</td>
- <td>
- Should this cache receive or only send to other laterals. You may want to
- set receive to false if you just need to broadcast to other caches. If you
- have a feed data parser, that doesn't need to receive updates, but you
- do want it to send invalidation messages, then you would set receive to false.
- If receive is false, the discovery service, if enabled, will only listen.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
- <tr>
- <td>IssueRemoveOnPut</td>
- <td>
- If this is set to true, then the lateral client will send a remove command
- rather than a put command to any registered listeners.
- </td>
- <td>N</td>
- <td>false</td>
- </tr>
- <tr>
- <td>FilterRemoveByHashCode</td>
- <td>
- If this is true, and IssueRemoveOnPut is true, the client
- will include the hashCode of the element to remove. If it is also true
- on the receiving end, the receiver will check to see if the element exists.
- If the element exists, and the hashCodes are the same, the item will not be
- removed.
- </td>
- <td>N</td>
- <td>false</td>
- </tr>
- <tr>
- <td>UdpDiscoveryAddr</td>
- <td>
- The address the UDP discovery process should broadcast messages to.
- </td>
- <td>N</td>
- <td>228.5.6.7</td>
- </tr>
- <tr>
- <td>UdpDiscoveryPort</td>
- <td>
- The port the UDP discovery process should send messages to.
- </td>
- <td>N</td>
- <td>6789</td>
- </tr>
- <tr>
- <td>UdpDiscoveryEnabled</td>
- <td>
- Whether or not the UDP discovery service should be used to
- locate other lateral caches.
- </td>
- <td>N</td>
- <td>true</td>
- </tr>
- </table>
- </subsection>
-
- <subsection name="Example Configuration">
- <source><![CDATA[
-jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
-jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
-#jcs.auxiliary.LTCP.attributes.TcpServers=
-jcs.auxiliary.LTCP.attributes.TcpListenerPort=1118
-jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8
-jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
-jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
-jcs.auxiliary.LTCP.attributes.Receive=true
-jcs.auxiliary.LTCP.attributes.AllowGet=false
-jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=false
-jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false
- ]]></source>
- </subsection>
-
- </section>
- </body>
-</document>
\ No newline at end of file
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<document>
+ <properties>
+ <title>Lateral TCP Auxiliary Cache Configuration</title>
+ <author email="[email protected]">Aaron Smuts</author>
+ </properties>
+
+ <body>
+ <section name="Lateral TCP Auxiliary Cache Configuration">
+
+ <p>
+ The following properties apply to the TCP Lateral Cache plugin.
+ </p>
+
+ <subsection name="TCP Configuration Properties">
+ <table>
+ <tr>
+ <th>Property</th>
+ <th>Description</th>
+ <th>Required</th>
+ <th>Default Value</th>
+ </tr>
+ <tr>
+ <td>TcpServers</td>
+ <td>
+ This is the list of servers this cache should try to connect to.
+ With UDP discovery this is not necessary.
+ </td>
+ <td>N</td>
+ <td>none</td>
+ </tr>
+ <tr>
+ <td>TcpListenerPort</td>
+ <td>
+ This is the port this cache should listen on.
+ </td>
+ <td>Y</td>
+ <td>n/a</td>
+ </tr>
+ <tr>
+ <td>AllowGet</td>
+ <td>
+ Should this cache be allowed to get from other laterals. False means
+ that it can only put, i.e. send updates and remove requests to other laterals.
+ Lateral gets are not recommended for performance reasons. This used to be
+ controlled by the attribute PutOnlyMode.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>Receive</td>
+ <td>
+ Should this cache receive or only send to other laterals. You may want to
+ set receive to false if you just need to broadcast to other caches. If you
+ have a feed data parser, that doesn't need to receive updates, but you
+ do want it to send invalidation messages, then you would set receive to false.
+ If receive is false, the discovery service, if enabled, will only listen.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ <tr>
+ <td>IssueRemoveOnPut</td>
+ <td>
+ If this is set to true, then the lateral client will send a remove command
+ rather than a put command to any registered listeners.
+ </td>
+ <td>N</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>FilterRemoveByHashCode</td>
+ <td>
+ If this is true, and IssueRemoveOnPut is true, the client
+ will include the hashCode of the element to remove. If it is also true
+ on the receiving end, the receiver will check to see if the element exists.
+ If the element exists, and the hashCodes are the same, the item will not be
+ removed.
+ </td>
+ <td>N</td>
+ <td>false</td>
+ </tr>
+ <tr>
+ <td>UdpDiscoveryAddr</td>
+ <td>
+ The address the UDP discovery process should broadcast messages to.
+ </td>
+ <td>N</td>
+ <td>228.5.6.7</td>
+ </tr>
+ <tr>
+ <td>UdpDiscoveryPort</td>
+ <td>
+ The port the UDP discovery process should send messages to.
+ </td>
+ <td>N</td>
+ <td>6789</td>
+ </tr>
+ <tr>
+ <td>UdpDiscoveryEnabled</td>
+ <td>
+ Whether or not the UDP discovery service should be used to
+ locate other lateral caches.
+ </td>
+ <td>N</td>
+ <td>true</td>
+ </tr>
+ </table>
+ </subsection>
+
+ <subsection name="Example Configuration">
+ <source><![CDATA[
+jcs.auxiliary.LTCP=org.apache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory
+jcs.auxiliary.LTCP.attributes=org.apache.jcs.auxiliary.lateral.socket.tcp.TCPLateralCacheAttributes
+#jcs.auxiliary.LTCP.attributes.TcpServers=
+jcs.auxiliary.LTCP.attributes.TcpListenerPort=1118
+jcs.auxiliary.LTCP.attributes.UdpDiscoveryAddr=228.5.6.8
+jcs.auxiliary.LTCP.attributes.UdpDiscoveryPort=6780
+jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=true
+jcs.auxiliary.LTCP.attributes.Receive=true
+jcs.auxiliary.LTCP.attributes.AllowGet=false
+jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=false
+jcs.auxiliary.LTCP.attributes.FilterRemoveByHashCode=false
+ ]]></source>
+ </subsection>
+
+ </section>
+ </body>
+</document>
Modified: jakarta/jcs/trunk/xdocs/LateralUDPDiscovery.xml
URL: http://svn.apache.org/viewvc/jakarta/jcs/trunk/xdocs/LateralUDPDiscovery.xml?view=diff&rev=536904&r1=536903&r2=536904
==============================================================================
--- jakarta/jcs/trunk/xdocs/LateralUDPDiscovery.xml (original)
+++ jakarta/jcs/trunk/xdocs/LateralUDPDiscovery.xml Thu May 10 09:03:42 2007
@@ -1,4 +1,22 @@
<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
<document>
<properties>
@@ -8,33 +26,33 @@
<body>
<section name="Lateral UDP Discovery">
- <p>
+ <p>
Rather than list all the other lateral servers in the configuration
- file, you can configure the TCP lateral to use UDP
- discovery. In discovery mode, lateral TCP caches will broadcast
- to a multicast address and port, letting all listeners know where they are.
+ file, you can configure the TCP lateral to use UDP
+ discovery. In discovery mode, lateral TCP caches will broadcast
+ to a multicast address and port, letting all listeners know where they are.
</p>
- <p>
- On startup each lateral will issue a special message requesting a
- broadcast from the other caches. Normal broadcasts occur every
- 30 seconds. (This is to be made configurable.) Regions that don't
+ <p>
+ On startup each lateral will issue a special message requesting a
+ broadcast from the other caches. Normal broadcasts occur every
+ 30 seconds. (This is to be made configurable.) Regions that don't
receive, are running in send only mode, don't broadcast anything but requests.
</p>
<p>
When a lateral receives a discovery message it will try to add
- the lateral to the nowait facade for the region. If it already exists
- nothing happens. If a region is not configured to send laterally, nothing
+ the lateral to the nowait facade for the region. If it already exists
+ nothing happens. If a region is not configured to send laterally, nothing
happens, since it doesn't have a no wait.
</p>
- <p>
- This allows you to have the same configuration on every machine.
+ <p>
+ This allows you to have the same configuration on every machine.
</p>
<subsection name="Configuration">
<p>
The configuration is fairly straightforward and is done in the
auxiliary cache section of the <code>cache.ccf</code>
configuration file. In the example below, I created a TCP
- Lateral Auxiliary Cache referenced by <code>LTCP</code>. It uses
+ Lateral Auxiliary Cache referenced by <code>LTCP</code>. It uses
UDP Discovery to locate other servers. It broadcasts to
multicast address <code>228.5.6.8</code> and port <code>6780</code>.
It listens to port <code>1110</code>.
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.