avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: avalon-excalibur/store/src/xdocs mrustore.xml storejanitor.xml index.xml book.xml
Date Fri, 16 May 2003 13:14:46 GMT
cziegeler    2003/05/16 06:14:45

  Modified:    store/src/xdocs index.xml book.xml
  Added:       store/src/xdocs mrustore.xml storejanitor.xml
  Log:
  First docs from cocoon
  
  Revision  Changes    Path
  1.3       +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.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- index.xml	20 Feb 2003 15:41:25 -0000	1.2
  +++ index.xml	16 May 2003 13:14:45 -0000	1.3
  @@ -1,4 +1,5 @@
   <?xml version="1.0"?>
  +<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
   
   <document>
     <header>
  @@ -10,7 +11,12 @@
     <body>
       <section><title>Introduction</title>
         <p>
  -        This is the store component donated by the Apache Cocoon project.
  +        This project provides some general components for dealing with stores.
  +        It contains different store implementations and a montoring component,
  +        the Store Janitor.
  +      </p>
  +      <p>
  +        These components have been donated by the Apache Cocoon project.
         </p>
       </section>
     </body>
  
  
  
  1.6       +2 -0      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- book.xml	22 Apr 2003 16:52:23 -0000	1.5
  +++ book.xml	16 May 2003 13:14:45 -0000	1.6
  @@ -4,6 +4,8 @@
   
     <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/"/>
  
  
  
  1.1                  avalon-excalibur/store/src/xdocs/mrustore.xml
  
  Index: mrustore.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
  
  <document>
    <header>
      <title>MRUMemoryStore and Swapping</title>
      <version></version>
      <type>Technical document</type>
      <authors>
        <person name="Gerhard Froehlich" email="g-froehlich@gmx.de"/>
        <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
      </authors>
      <abstract>This document explains how the MRUMemoryStore executes.</abstract>
    </header>
    <body>
    <s1 title="Goal">
      <p>This document explains how the MRUMemoryStore and Swapping executes.</p>
    </s1>
    <s1 title="Overview">
      <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".
      </p>
      <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">
      <p> 
      The heart of the MRUMemoryStore ist combination of a LinkedList and a HashMap:
      </p>
      <p>
      The LinkedList provides the queue mechanism, and the entries in the LinkedList 
      contain the key to the data in the HashMap. When caching a new entry in to the list,
      the entry is inserted to the front of the list.
      If the list is already full, the oldest data entry is removed from the Cache.
      When requesting a entry, the store returns the object by key and inserts the requested
key 
      on the top of the Cache.
         
      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">
      <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 
      directory is "cache-dir" in the work-directory.
      </p>
      <p>
      NOTE: The keys are Strings at the moment. Therefor the
      filenames of the swapped objects can be very long. Especially Windows OS
      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">
    <source><![CDATA[
  <store class="org.apache.cocoon.components.store.MRUMemoryStore"
         logger="core.store">
    <parameter name="maxobjects" value="100"/>
    <parameter name="use-persistent-cache" value="true"/>
  </store>]]>
    </source> 
    <p>Explanation of the paramters:</p>
      <ol> 
        <li><code>&lt;parameter name="maxobjects" value="100"/&gt;</code>:
        Indicates how many objects will be hold in MRUMemoryStore. When the number 
        of maxobjects has been reached, the last object in the MRUMemoryStore will be 
        thrown out.</li>
        <li><code>&lt;parameter name="use-persistent-cache" value="true"/&gt;</code>:
        If this switch is set on true, objects are swapped out to the filesystem,
        if the MRUMemoryStore has reached his maximum object limit, or the JVM 
        memory consumption is over the heap size limit. See StoreJanitor user 
        docs for more information.</li>
  	</ol>
    </s1>
    </body>
  </document>
  
  
  
  1.1                  avalon-excalibur/store/src/xdocs/storejanitor.xml
  
  Index: storejanitor.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V1.1//EN" "document-v11.dtd">
  
  <document>
    <header>
      <title>The Store Janitor</title>
      <version>0.1</version>
      <type>Technical document</type>
      <authors>
        <person name="Gerhard Froehlich" email="g-froehlich@gmx.de"/>
        <person name="Carsten Ziegeler" email="cziegeler@apache.org"/>
      </authors>
      <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">
    <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.

    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">
      <ul><li>Tomcat settings in tomcat.sh or tomcat.bat:</li></ul>
      <source><![CDATA[
  %_RUNJAVA% %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" \
    -Xmx200000000 org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9
      ]]></source> 
      <ul><li>StoreJanitor settings:</li></ul>
      <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>
      ]]></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.
      </p>
      <p> The <code>cleanupthreadinterval</code> defines the interval of
the background 
      thread which checks memory in seconds. Also this paramter should configured wisely.

      A to short interval can cause also a high system load. The 
      <code>threadpriority</code> defines the priority of the background thread.

      1 is lowest level and 10 the highest.</p>
      <p>
      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>
    </body>
  </document>
  
  
  

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


Mime
View raw message