How do I change the amount of memory allocated for Sentinel RD processes?

  • 7005334
  • 10-Feb-2010
  • 11-Jun-2013

Environment

Novell Sentinel RD

Situation

For a given system running Sentinel RD it  may become necessary to tune the amount of memory given to the various processes within the service.

Resolution

With the shipping version of Sentinel RD most memory settings are set by a script located in (by default) /opt/novell/sentinel6_rd_x86-64/bin named setmemory.sh which sets environment variables for the memory settings based on the system's total RAM.  While the most common settings for Java are controlled here in the Max Heap settings not all settings can be manipulated in this script.  Also some other processes, such as the PostgreSQL database, are not controlled via the script.

The setmemory.sh script determines the amount of memory on the machine via the physicalmemory.sh script.  After converting the system's memory to an integer representing the number of gibibytes (GiB) the script then sets the environment variables for each process's Java Max Heap size.  For example the following section sets various max heap sizes for a system with up to four GiB RAM:

if [ "4" -gt "$MEMORY_GB"]
then
    # Under 4GB of Memory
    export JAVA_MEM_ACTIVEMQ=256
    export JAVA_MEM_TOMCAT=128
    export JAVA_MEM_DAS_CORE=256
    export JAVA_MEM_DAS_BINARY=192
    export JAVA_MEM_CORRELATION=192
    export JAVA_MEM_COLLECTOR_MANAGER=192

and the following section sets the same settings for a machine with four to eight GiB RAM:

elif [ "8" -gt "$MEMORY_GB"]
then
    # 4GB - 7.9GB of Memory
    export JAVA_MEM_ACTIVEMQ=256
    export JAVA_MEM_TOMCAT=128
    export JAVA_MEM_DAS_CORE=512
    export JAVA_MEM_DAS_BINARY=256
    export JAVA_MEM_CORRELATION=256
    export JAVA_MEM_COLLECTOR_MANAGER=192

The result is that a system with more RAM will automatically allocate additional RAM to the various Java-based Sentinel processes.

These environment variables are then placed in the configuration.xml file which defines all of the Sentinel processes.  For example:

<!-- Collector_Manager -->
<process component="COLLECTOR_MANAGER" depends="UNIX Communication Server,DAS_Core,DAS_Binary" image="&quot;$(ESEC_JAVA_HOME)/java&quot; -server -Dsrv_name=Collector_Manager -Djava.awt.headless=true  -Xms64m -Xmx$(JAVA_MEM_COLLECTOR_MANAGER)m -XX:+UseParallelGC -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=../log/Collector_Manager.hprof  -Xss136k -Xrs -Duser.language=en -Djava.net.preferIPv4Stack=true -Dfile.encoding=UTF8 -Desecurity.cache.directory=../data/collector_mgr.cache -Desecurity.dataobjects.config.file=/xml/BaseMetaData.xml,/xml/AgentManagerMetaData.xml -Djava.util.logging.config.file=../config/collector_mgr_log.prop  -Desecurity.router.config.file=../config/event-router.properties -Dcom.esecurity.configurationfile=../config/configuration.xml -XX:NewRatio=2 -jar ../lib/ccsbase.jar ..//config//collector_mgr.xml" min_instances="1" name="Collector_Manager" post_startup_delay="0" remote_control="true" type="container" working_directory="$(ESEC_HOME)/data"/>

The Collector Manager has its Java Xmx setting defined by JAVA_MEM_COLLECTOR_MANAGER which came from the setmemory.sh script.

Other Java memory settings can also be set directly in the configuration.xml file if needed, such as the initial heap size Xms, or the maximum Permanent Generation size via -XX:MaxPermSize.  While some of these are set by default within configuration.xml they are not dynamically set by the setmemory.sh script like the Xmx settings are so modification of the script directly would be required.  If this is necessary always have a valid backup and make sure changes made during a patch do not overwrite the customizations implemented in a patched environment.  Novell may modify these scripts or configuration files during patches to improve performance or as improved settings are recommended which could overwrite user customizations.

PostgreSQL, as a non-Java process
With the shipping version of Sentinel RD most memory settings are set by a script located in (by default) /opt/novell/sentinel6_rd_x86-64/bin named setmemory.sh which sets environment variables for the memory settings based on the system's total RAM.  While the most common settings for Java are controlled here in the Max Heap settings not all settings can be manipulated in this script.  Also some other processes, such as the PostgreSQL database, are not controlled via the script.

This has been resolved in Sentinel v6.1 SP2

Additional Information

In order to fine tune these settings Bug# 573181 has been submitted and will likely lead to changes in the setmemory.sh script in the future.  When changed this bug number should show up in the list of issues resolved with a patch to Sentinel.