Performance tuning
Do not allow very large assets
The max_allowed_packet variable of your database server may be set to a larger value, to allow for larger assets, see increase packet size. However, this will reduce performance.
Configure the BundleCache
The repository fetches the content from the database in Bundles. Each bundle consists of the node itself and all it's properties. The repository can cache these Bundles which prevents making round trips to the database which greatly improves the read performance. There are two BundleCaches: a version BundleCache and a workspace BundleCache. The default size of the BundleCaches is 8 MB which usually is too low for real production systems.
Configure the BundleCaches
The BundleCaches are configured in the repository.xml. Note that if you want to change an already running setup, theworkspace.xml has to be changed. After changing the settings the repository has to be restarted.
Sizes
There is no "correct" size of the BundleCache. Usually the bigger is the better. It has no use to make the BundleCache bigger than your data size. The BundleCache caches the bundles in the java heap space. When increasing the BundleCache the max heap space of the jvm should also be increased. The workspace bundle cache is usually 2 to 4 times larger than the verioning bundle cache
Workspace
The BundleCache size is specified in megabytes.
repository.xml:
<Versioning ...>
<PersistenceManager class="org.hippoecm.repository.jackrabbit.persistence.ForkedMySqlPersistenceManager">
<param name="driver" value="javax.naming.InitialContext"/>
<param name="url" value="java:comp/env/jdbc/repositoryDS"/>
<param name="schemaObjectPrefix" value="version_"/>
<param name="externalBLOBs" value="true"/>
<param name="consistencyCheck" value="false"/>
<param name="consistencyFix" value="false"/>
<param name="bundleCacheSize" value="16"/>
</PersistenceManager>
<.../>
</Versioning>
Versioning
The BundleCache size is specified in megabytes.
repository.xml:
<Workspace ...>
<PersistenceManager class="org.hippoecm.repository.jackrabbit.persistence.ForkedMySqlPersistenceManager">
<param name="driver" value="javax.naming.InitialContext"/>
<param name="url" value="java:comp/env/jdbc/repositoryDS"/>
<param name="schemaObjectPrefix" value="${wsp.name}_"/>
<param name="externalBLOBs" value="true"/>
<param name="consistencyCheck" value="false"/>
<param name="consistencyFix" value="false"/>
<param name="bundleCacheSize" value="64"/>
</PersistenceManager>
<.../>
</Workspace>
Statistics
The bundle cache can log some statistics by adding the following appender section to the log4j.xml
log4j.xml:
<category additivity="false" name="org.apache.jackrabbit.core.persistence.bundle">
<level value="info"/>
<appender-ref ref="root"/>
</category>
<category additivity="false" name="org.apache.jackrabbit.core.persistence.bundle.util.LRUNodeIdCache">
<level value="error"/>
<appender-ref ref="root"/>
</category>
