You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2007/05/25 12:15:17 UTC

svn commit: r541610 - /lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml

Author: andreas
Date: Fri May 25 03:15:16 2007
New Revision: 541610

URL: http://svn.apache.org/viewvc?view=rev&rev=541610
Log:
Added production hints from Wiki

Modified:
    lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml

Modified: lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml
URL: http://svn.apache.org/viewvc/lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml?view=diff&rev=541610&r1=541609&r2=541610
==============================================================================
--- lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml (original)
+++ lenya/docu/src/documentation/content/xdocs/docs/1_4/tutorials/production.xml Fri May 25 03:15:16 2007
@@ -97,13 +97,93 @@
     </section>
     
     <section>
-      <title>Production</title>
+      <title>Caching</title>
+      <p>
+        There's a <a href="http://wiki.apache.org/cocoon-data/attachments/GT2006Notes/attachments/10-caching.pdf">great
+        presentation</a> (PDF) about caching in cocoon, held at the Cocoon Get-Together 2006.
+      </p>
+      <p>
+        Cocoon's default store implementation is an in-memory store backed by a disk
+        store (based on EHCache). You can configure this store using a file called
+        <code>ehcache.xml</code> which is located in <code>org/apache/cocoon/components/store/impl/ehcache.xml</code>.
+        The default entries of the <code>defaultCache</code> are as follows:
+      </p>
+      <source xml:space="preserve"><![CDATA[<defaultCache
+    maxElementsInMemory="10000"
+    eternal="true"
+    timeToIdleSeconds="0"
+    timeToLiveSeconds="0"
+    overflowToDisk="true"
+    diskPersistent="true"
+    diskExpiryThreadIntervalSeconds="120"
+    />]]></source>
+      <p>
+        So, when <code>overflow-to-disk</code> is set to true, <code>eternal</code> to true and
+        <code>timeToIdleSeconds=0</code>, then once a cachekey is in memory/disk, it will never
+        be removed which might lead to a cache file becoming very large
+        (see also thread: <a href="http://java2.5341.com/msg/170235.html">http://java2.5341.com/msg/170235.html</a>).
+      </p>
+      <p>
+        For production use these setting should be changed. A possible configuration might look like:
+      </p>
+      <source xml:space="preserve"><![CDATA[<defaultCache
+    maxElementsInMemory="10000"
+    eternal="false"
+    timeToIdleSeconds="1800"
+    timeToLiveSeconds="3600"
+    overflowToDisk="true"
+    diskPersistent="true"
+    diskExpiryThreadIntervalSeconds="120"
+    />]]></source>
+      <p>
+        This cache contains a maximum in memory of 10000 elements, and will expire an element
+        if it is idle for more than 30 minutes and lives for more than 60 minutes. If there are
+        more than 10000 elements it will overflow to the disk cache.
+      </p>
+    </section>
+    
+    <section>
+      <title>Performance Tuning</title>
+      <p>
+        The following hints can be considered to improve the performance of your application:
+      </p>
+      <ul>
+        <li>Set XSLT caching (use-store) to true in <code>cocoon.xconf</code>.</li>
+        <li>Turn off reloading of sub-sitemaps.</li>
+        <li>Tips about Cocoon performance tuning: <a href="http://wiki.apache.org/cocoon/CocoonPerformance">http://wiki.apache.org/cocoon/CocoonPerformance</a></li>
+        <li>Tips about Tomcat performance tuning: <a href="http://marc.theaimsgroup.com/?t=103598885300001&amp;r=1&amp;w=2">http://marc.theaimsgroup.com/?t=103598885300001&amp;r=1&amp;w=2</a></li>
+      </ul>
+      <p>
+        Doug Chestnut recommends to adapt the garbage collector to make use of all available CPU cores.
+        This can be done by adding the following to your JAVA options (for a machine with 4 cores):
+      </p>
+      <source xml:space="preserve">-XX:+UseParallelGC -XX:ParallelGCThreads=4</source>
+      <p>   
+        You can also increase stack and heap size to make better use of available memory
+        (be careful not to starve other processes on the same machine, though):
+      </p>
+      <source xml:space="preserve">-Xms512m -Xmx1024m</source>
+    </section>
+    
+    <section>
+      <title>General Measures for Production</title>
       <ul>
         <li>
           Double-check your access control settings.
         </li>
         <li>
-          Set the log level to <em>FATAL</em> or at least <em>ERROR</em>.
+          Remove the example publications (default and blog). If you use them as templates,
+          don't forget to remove the example users or change their passwords.
+        </li>
+        <li>
+          Set the log level to <em>FATAL</em> or at least <em>ERROR</em>. This makes the code
+          faster and prevents the log files from growing very large while keeping them comprehensible.
+          The log level can be configured in <code>$COCOON_HOME/src/webapp/WEB-INF/log4j.xconf</code> or ultimately
+          in <code>$LENYA_HOME/build/lenya/webapp/WEB-INF/log4j.xconf</code>.
+        </li>
+        <li>
+          Set the <em>debug</em> property in <code>src/targets/properties-build.xml</code> to <em>off</em>.
+          This way, the generated byte code will run faster.
         </li>
         <li>
           Disable all modules which accept request to dynamically generate images
@@ -124,6 +204,24 @@
           exported version of the site ready.
         </li>
       </ul>
+    </section>
+    
+    <section>
+      <title>Cosmetics</title>
+      <p>
+        In order to hide the default and blog publicatons from the root index page
+        (if you're not going to rewrite it anyway), you can set
+      </p>
+      <source xml:space="preserve"><![CDATA[--- lenya/src/pubs/blog/publication.xml (revision 452350)
++++ lenya/src/pubs/blog/publication.xml (working copy)
+@@ -17,11 +17,12 @@
+-<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0" lenya:show="true">
++<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0" lenya:show="false">]]></source>
+      <source xml:space="preserve"><![CDATA[--- lenya/src/pubs/default/publication.xml      (revision 452350)
++++ lenya/src/pubs/default/publication.xml      (working copy)
+@@ -17,12 +17,13 @@
+-<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0" lenya:show="true">
++<lenya:publication xmlns:lenya="http://apache.org/cocoon/lenya/publication/1.0" lenya:show="false">]]></source>
     </section>
 
     



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org