You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@avalon.apache.org by cz...@apache.org on 2003/09/03 11:50:41 UTC

cvs commit: avalon-excalibur/store/src/xdocs mrustore.xml storejanitor.xml index.xml book.xml

cziegeler    2003/09/03 02:50:41

  Modified:    store/src/xdocs mrustore.xml storejanitor.xml index.xml
                        book.xml
  Log:
  Updating docs
  
  Revision  Changes    Path
  1.3       +13 -13    avalon-excalibur/store/src/xdocs/mrustore.xml
  
  Index: mrustore.xml
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/src/xdocs/mrustore.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- mrustore.xml	20 May 2003 21:03:40 -0000	1.2
  +++ mrustore.xml	3 Sep 2003 09:50:40 -0000	1.3
  @@ -13,10 +13,10 @@
       <abstract>This document explains how the MRUMemoryStore executes.</abstract>
     </header>
     <body>
  -  <s1 title="Goal">
  +  <section><title>Goal</title>
       <p>This document explains how the MRUMemoryStore and Swapping executes.</p>
  -  </s1>
  -  <s1 title="Overview">
  +  </section>
  +  <section><title>Overview</title>
       <p>The MRUMemoryStore was developed to provide a standard algorithm to
          store data in memory. For web-based applications the MRU (Most Recently Used) algorithm
          is very suitable, because the object most frequently accessed is always on "top".
  @@ -24,9 +24,9 @@
       <p>If configured, the objects are also swapped to the filesystem if the
       MRUMemoryStore reached his configured max. object limit.
       </p>
  -  </s1>
  -  <s1 title="Implementation">
  -    <s2 title="MRUMemoryStore">
  +  </section>
  +  <section><title>Implementation</title>
  +    <section><title>MRUMemoryStore</title>
       <p> 
       The heart of the MRUMemoryStore ist combination of a LinkedList and a HashMap:
       </p>
  @@ -41,8 +41,8 @@
       This implementation keeps the most recent used objects in the store and provides the best
       use of the machines memory.
       </p>
  -    </s2>
  -    <s2 title="Swapping">
  +    </section>
  +    <section><title>Swapping</title>
       <p>
       When the MRUMemoryStore is full or the JVM is at the heap size limit the 
       objects in the MRUMemoryStore are swapped to the Filesystem. The default 
  @@ -54,11 +54,11 @@
       flavours have problems with long filenames. Use the JispFilesystemStore to
       get rid of it.
       </p>
  -    </s2>
  -  </s1>
  -  <s1 title="Configuration of the MRUMemoryStore in the cocoon.xconf">
  +    </section>
  +  </section>
  +  <section><title>Configuration of the MRUMemoryStore in the cocoon.xconf</title>
     <source><![CDATA[
  -<store class="org.apache.cocoon.components.store.MRUMemoryStore"
  +<store class="org.apache.excalibur.store.impl.MRUMemoryStore"
          logger="core.store">
     <parameter name="maxobjects" value="100"/>
     <parameter name="use-persistent-cache" value="true"/>
  @@ -76,6 +76,6 @@
         memory consumption is over the heap size limit. See StoreJanitor user 
         docs for more information.</li>
       </ol>
  -  </s1>
  +  </section>
     </body>
   </document>
  
  
  
  1.2       +72 -31    avalon-excalibur/store/src/xdocs/storejanitor.xml
  
  Index: storejanitor.xml
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/src/xdocs/storejanitor.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- storejanitor.xml	16 May 2003 13:14:45 -0000	1.1
  +++ storejanitor.xml	3 Sep 2003 09:50:40 -0000	1.2
  @@ -13,27 +13,35 @@
       <abstract>This document describes the usage of the StoreJanitor.</abstract>
     </header>
     <body>
  -  <s1 title="Goal"><p>This document describes the usage of the StoreJanitor.</p></s1>
  -  <s1 title="Description">
  +  <section><title>Goal</title>
  +    <p>This document describes the usage of the StoreJanitor.</p>
  +  </section>
  +  <section><title>Description</title>
     <p>The implementation is quit simple! Every implementation of a Store can register in the 
  -  StoreJanitor. He checks in a configurable interval if memory is running low. If low, 
  -  he greps via Round Robin a victim (Store) and frees xx% of all emlements in this Store. 
  +  StoreJanitor. It checks in a configurable interval if memory is running low. If low, 
  +  it greps via Round Robin a victim (Store) and frees xx% of all emlements in this Store. 
     After that the StoreJanitor sleeps and waits for the next iteration.</p>
  -  </s1>
  -  <s1 title="Configuration">
  -  <source><![CDATA[
  -<store-janitor
  -    class="org.apache.cocoon.components.store.StoreJanitorImpl"
  -    logger="root.store">
  -  <parameter name="freememory" value="1000000"/>
  -  <parameter name="heapsize" value="60000000"/>
  -  <parameter name="cleanupthreadinterval" value="10"/>
  -  <parameter name="threadpriority" value="5"/>
  -  <parameter name="percent_to_free" value="10"/>
  -</store-janitor>
  -  ]]></source> 
  -  <p>The right configuration is very important, because wrong settings can cause a high system load.</p>
  -  <s2 title="Example configuration">
  +  <p>The StoreJanitor is very useful for web applications that use the store as
  +   a in-memory cache. The StoreJanitor helps in avoiding OutOfMemory exceptions.</p>
  +  </section>
  +  <section><title>Configuration</title>
  +   <p>The Store Janitor can be configured with a few options:
  +   </p>
  +     <ul>
  +       <li><em>freememory</em>: How many bytes shall be always free in the JVM (Default: 1mb)</li>
  +       <li><em>heapsize</em>: Maximum possible size of the JVM memory consumption (Default: 64mb)</li>
  +       <li><em>cleanupthreadinterval</em>: How often (sec) shall run the cleanup thread (Default: 10s)</li>
  +       <li><em>adaptivethreadinterval</em> (experimental): Enable adaptive algorithm to determine thread interval
  +           (Default: false) When true, <code>cleanupthreadinterval</code> defines the maximum cleanup interval.
  +           Cleanup interval then is determined based on the memory fill rate: the faster memory is filled in,
  +           and the less free memory is left, the shorter is the cleanup time.</li>
  +       <li><em>threadpriority</em>: priority of the thread (1-10). (Default: 10)</li>
  +       <li><em>percent_to_free</em>: What fraction of the store to free when memory is low (1-100). (Default: 10%)</li>
  +       <li><em>invokegc</em>: Invoke the gc on low memory first (true|false; default: false)</li>
  +      </ul>
  +  <p>The right configuration is very important, because wrong settings can 
  +    cause a high system load. Let's have a look at a sample configuration.</p>
  +  <section><title>Example configuration</title>
       <ul><li>Tomcat settings in tomcat.sh or tomcat.bat:</li></ul>
       <source><![CDATA[
   %_RUNJAVA% %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" \
  @@ -43,20 +51,53 @@
       <p>The freememory and heapsize paramter always depends on the Xmx 
       parameter.</p>
       <source><![CDATA[
  -<store-janitor
  -    class="org.apache.cocoon.components.store.StoreJanitorImpl"
  -    logger="root.store">
  -  <parameter name="freememory" value="50000000"/>
  -  <parameter name="heapsize" value="150000000"/>
  -  <parameter name="cleanupthreadinterval" value="10"/>
  -  <parameter name="threadpriority" value="5"/>
  -  <parameter name="percent_to_free" value="10"/>
  -</store-janitor>
  +  <!--+
  +      | Store Janitor: the store garbage collector and memory usage controller.
  +      |
  +      | Be careful with the heapsize and freememory parameters. Wrong values
  +      | can cause high cpu usage. Example configuration:
  +      | Jvm settings:
  +      |    -Xmx200000000
  +      | store-janitor settings:
  +      |    <parameter name="freememory" value="5000000"/>
  +      |    <parameter name="heapsize" value="196000000"/>
  +      |
  +      | It is recommended to have heapsize equal to -Xmx, especially on Sun's
  +      | JVM which are unable to shrink its heap once it grows above minimum.
  +      | Freememory should be greater than amount of memory necessary for normal
  +      | application operation.
  +      | BUT: The heap size of the memory of the JVM is a little bit less than
  +      |      the value you specify for -Xmx, so you have to set the heapsize
  +      |      for the store janitor to a value which is lower (2% less seems
  +      |      to be a working value).
  +      +-->
  +  <store-janitor logger="core.store.janitor">
  +     <!-- How much free memory shall be available in the jvm -->
  +     <parameter name="freememory" value="2048000"/>
  +     <!-- Indicates the limit of the jvm memory consumption. The default max
  +          heapsize for Sun's JVM is (almost) 64Mb -->
  +     <parameter name="heapsize" value="66600000"/>
  +     <!-- How often shall the cleanup thread check memory -->
  +     <parameter name="cleanupthreadinterval" value="10"/>
  +     <!-- Experimental adaptive algorithm for cleanup interval
  +     <parameter name="adaptivethreadinterval" value="true"/>
  +     -->
  +     <!-- Indicates the thread priority of the cleanup thread -->
  +     <parameter name="threadpriority" value="5"/>
  +     <!-- How much percent of the elements of each registered Store
  +          shall be removed when low on memory. Default 10% -->
  +     <parameter name="percent_to_free" value="10"/>
  +     <!-- Invoke the garbage collector when low memory is reached -->
  +     <parameter name="invokegc" value="false"/>
  +  </store-janitor>
       ]]></source>
       <p>It is recommended to have <code>heapsize</code> equal to -Xmx, especially
       on Sun's JVM which are unable to shrink its heap once it grows above minimum. 
       <code>freememory</code> should be greater than amount of memory necessary for normal 
  -    application operation.
  +    application operation. But the heap size of the memory of the JVM is a little bit less than
  +   the value you specify for -Xmx, so you have to set the heapsize
  +   for the store janitor to a value which is lower (2% less seems
  +    to be a working value)
       </p>
       <p> The <code>cleanupthreadinterval</code> defines the interval of the background 
       thread which checks memory in seconds. Also this paramter should configured wisely. 
  @@ -67,7 +108,7 @@
       The <code>percent_to_free</code> parameter describes, how much percent of the 
       elements of each registered Store shall be removed when low on memory.
       </p>
  -  </s2>
  -  </s1>
  +  </section>
  +  </section>
     </body>
   </document>
  
  
  
  1.4       +8 -2      avalon-excalibur/store/src/xdocs/index.xml
  
  Index: index.xml
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/src/xdocs/index.xml,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- index.xml	16 May 2003 13:14:45 -0000	1.3
  +++ index.xml	3 Sep 2003 09:50:40 -0000	1.4
  @@ -11,9 +11,15 @@
     <body>
       <section><title>Introduction</title>
         <p>
  +          The Store Package provides a way to store named objects without 
  +          taking care about where and how they are stored.
  +          You can choose between different implementations that store
  +          the data e.g. in memory or on the file system etc.
  +      </p>
  +      <p>  
           This project provides some general components for dealing with stores.
           It contains different store implementations and a montoring component,
  -        the Store Janitor.
  +        the <link href="storejanitor.html">Store Janitor</link>.
         </p>
         <p>
           These components have been donated by the Apache Cocoon project.
  
  
  
  1.7       +5 -1      avalon-excalibur/store/src/xdocs/book.xml
  
  Index: book.xml
  ===================================================================
  RCS file: /home/cvs/avalon-excalibur/store/src/xdocs/book.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- book.xml	16 May 2003 13:14:45 -0000	1.6
  +++ book.xml	3 Sep 2003 09:50:40 -0000	1.7
  @@ -1,11 +1,15 @@
   <?xml version="1.0" encoding="UTF-8"?>
  -<book software="Excalibur store" title="Excalibur store" copyright="@year@ The Apache Software Foundation" xmlns:xlink="http://www.w3.org/1999/xlink">
  +<book software="Excalibur store" 
  +      title="Excalibur store" 
  +      copyright="@year@ The Apache Software Foundation" 
  +      xmlns:xlink="http://www.w3.org/1999/xlink">
   
   
     <menu label="About">
       <menu-item href="index.html" label="Overview"/>
       <menu-item href="mrustore.html" label="MRU Store"/>
       <menu-item href="storejanitor.html" label="Janitor"/>
  +
       <menu-item href="http://avalon.apache.org/excalibur/index.html" label="Excalibur Home"/>
       <menu-item href="http://avalon.apache.org/bindownload.cgi" label="Download"/>
       <menu-item label="API Docs" href="http://avalon.apache.org/api/"/>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@avalon.apache.org
For additional commands, e-mail: cvs-help@avalon.apache.org