The configuration parameters given here must be seen as a guideline. This list is not necessarily complete and should be revised for every installation.
The best configuration for your environment may differ from those depicted here.
In case of doubts about certain configuration parameters, please contact subshell.
Java Version
The Sophora Server in version 3.x requires either Open JDK 8 or Open JDK 11.
As the Sophora Server from version 4.x and ongoing requires at least an Open JDK in version 11, it is recommended to update to Open JDK 11 while using Sophora in 3.x.
Java Garbage Collection
The exact parameters for the Java Garbage Collection highly depend on the environment (CPU, memory), Java version (main java version and whether you choose an OracleJDK or an OpenJDK) and the use case (how many concurrent user, how many imports).
- On Java 8 we recommend using the
ConcMarkSweepGC
. - With Java 11 we recommend using G1GC.
Sophora Server
An overview of all configuration parameters is provided here.
The Java VM arguments should be maintained in the sophora.properties
file under the configuration key vmargs=...
Maximum number of open files
The maximum number of open files must be increased on unix system. Add the following lines to the file /etc/security/limits.conf
.
* soft nofile 4096
* hard nofile 4096
Check the result with the command ulimit -a
.
Recommended Java VM Arguments for Java 8
-server
-XX:+UseConcMarkSweepGC
-XX:MaxMetaspaceSize=512M
-XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses
-XX:+CMSParallelRemarkEnabled
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=70
-XX:+ScavengeBeforeFullGC
-XX:+CMSScavengeBeforeRemark
-Xss640K
-Xmn3G
-Xms12G
-Xmx12G
-XX:-OmitStackTraceInFastThrow
-XX:+PrintTenuringDistribution
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:-UseGCOverheadLimit
-XX:+PrintGCApplicationStoppedTime
-XX:+HeapDumpOnOutOfMemoryError
-Djava.rmi.server.hostname=<external hostname>
Recommended Java VM Arguments for Java 11
-Xmn
with G1!-server
-XX:+UseG1GC
-XX:+ParallelRefProcEnabled
-XX:G1HeapRegionSize=8m
-XX:MaxGCPauseMillis=250
-XX:InitiatingHeapOccupancyPercent=75
-XX:+UseLargePages
-Xss640K
-Xms12G
-Xmx12G
-XX:-OmitStackTraceInFastThrow
-XX:+PerfDisableSharedMem
-XX:+HeapDumpOnOutOfMemoryError
-Xlog:gc*::time,level,tags
-Djava.rmi.server.hostname=<external hostname>
Jackrabbit Configuration
The following JackRabbit related configuration should be adopted in the following files:
- ./repository/repository.xml
- ./repository/workspaces/default/workspace.xml
- ./repository/workspaces/live/workspace.xml
- ./repository_archive/repository.xml
- ./repository_archive/workspaces/default/workspace.xml
BundleCacheSize
<PersistenceManager>
....
<param name="bundleCacheSize" value="1024" />
....
<PersistenceManager>
ResultFetchSize and MaxMergeDocs
The parameters resultFetchSize
and maxMergeDocs
should be removed. Please note, that the first start of the Sophora server after removing the parameter maxMergeDocs
will take very long. The Lucene indexes are grouped into larger segments. This may take 60 minutes or longer depending on the size of the indexes.
initializeHierarchyCache
<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
<param name="initializeHierarchyCache" value="false" />
...
</SearchIndex>
Important Security Parameters to set
- sophora.solr.username
- sophora.solr.password
- sophora.replication.userName
- sophora.replication.password
- sophora.jmx.username
- sophora.jmx.password
Recommended Java VM Arguments for Java 8
-server
-XX:NewRatio=3
-XX:SurvivorRatio=4
-XX:TargetSurvivorRatio=90
-XX:MaxTenuringThreshold=8
-XX:+UseConcMarkSweepGC
-XX:+CMSScavengeBeforeRemark
-XX:PretenureSizeThreshold=64m
-XX:CMSFullGCsBeforeCompaction=1
-XX:+UseCMSInitiatingOccupancyOnly
-XX:CMSInitiatingOccupancyFraction=70
-XX:CMSTriggerPermRatio=80
-XX:CMSMaxAbortablePrecleanTime=6000
-XX:+CMSParallelRemarkEnabled
-XX:+ParallelRefProcEnabled
-XX:+UseLargePages
-XX:+AggressiveOpts
-Xss640K
-Xms6G
-Xmx6G
-XX:+PrintGCDetails
-XX:+PrintGCDateStamps
-XX:-UseGCOverheadLimit
-Dderby.storage.pageCacheSize=10000
-Djava.rmi.server.hostname=<external hostname>
Recommended Java VM Arguments for Java 11
-server
-XX:+UseG1GC
-XX:+PerfDisableSharedMem
-XX:+ParallelRefProcEnabled
-XX:G1HeapRegionSize=8m
-XX:MaxGCPauseMillis=250
-XX:InitiatingHeapOccupancyPercent=75
-XX:+UseLargePages
-Xss640K
-Xms6G
-Xmx6G
-XX:+PerfDisableSharedMem
-Xlog:gc*::time,level,tags
-Dderby.storage.pageCacheSize=10000
-Djava.rmi.server.hostname=<external hostname>
The best GC-Settings however might depend on your very installation, the Java version (especially on whether you choose an Oracle JDK or an OpenJDK) and the amount of incoming requests. We propose to try different GC-settings for fine-tuning.
Document Cache
The delivery holds a cache for document requests to its Sophora Staging Server.
This cache is crucial for the performance of the delivery. Its size must be adjusted considering the available heap space for the java process.
Take the following configuration as guidance:
sophora.delivery.client.documentCacheElementsInMemory=40000
Configuration of the Delivery Cache
sophora.delivery.cache.enabled=true
sophora.delivery.cache.db=derbyng
sophora.delivery.cache.db.async=true
sophora.delivery.cache.derby.optimizing.enabled=true
sophora.delivery.cache.cleanup.enabled=true
sophora.delivery.cache.removeFromCacheRegistry=false
sophora.delivery.cache.removalQueue=memoryRemovalQueue
sophora.delivery.cache.threshold=30
Java VM Arguments
-server
-Dderby.storage.pageCacheSize=10000
-Dderby.system.durability=test
-Dnet.sf.ehcache.use.classic.lru=true
-Djava.rmi.server.hostname=<external hostname>
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.ssl=false
-Xmx8G
-Xms8G
-XX:ReservedCodeCacheSize=512M
-XX:+UseG1GC
-XX:+UseStringDeduplication