Configuring the OpsCenter JVM 

Configure the JVM parameters for the OpsCenter JVM.

The OpsCenter JVM has been tuned to handle both large and small clusters with initial memory and garbage collection JVM parameters. These default values should be sufficient for most users. However, certain scenarios might arise that might require users to further tune these parameters.

There is an environmental variable OPSC_JVM_OPTS that can be set to override the default parameters. Here are some parameters you might consider tuning:
  • -Xmx: The maximum amount of heap space available for opscenterd to use. This default is 1024m (1GB), which should be enough for most installations. If you are managing multiple clusters or otherwise see OutOfMemory errors in opscenterd.log, try doubling the heap to 2048m (2GB). If memory-related issues continue, please contact DataStax Support for assistance.
  • -Xms: The initial amount of heap space that the opscenterd process uses on startup. Lower this value if opscenterd is having trouble starting.
  • Garbage Collection parameters (-XX:+UseConcMarkSweepGC, -XX:+CMSParallelRemarkEnabled, -XX:+ScavengeBeforeFullGC, -XX:+CMSScavengeBeforeRemark) are not recommended for modification. However, if there is a need to modify and tune other garbage collection parameters, follow this guide https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/.
  • -Djava.io.tmpdir=/path/to/dir: The directory that Jython uses to load and execute dynamic classes (default is the system tmp directory). Change this to another directory if you are having trouble loading OpsCenter due to permissions on the default directory.
To modify these parameters, you can simply set the environment variable OPSC_JVM_OPTS prior to starting OpsCenter.
Note: If OpsCenter is running while these parameters are set, a restart is required.
Update the maximum heap size JVM argument for a tarball installation using the environment variable:
$ export OPSC_JVM_OPTS=-Xmx2048m
$ sudo service opscenterd restart
Update the maximum heap size JVM argument for a package installation in bin/opscenter:
$ OPSC_JVM_OPTS="-server Xmx2048m -Xms1024m -Dpython.cachedir.skip=false
 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$OPSC_LOG_PATH
 -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled
 -XX:+ScavengeBeforeFullGC -XX:+CMSScavengeBeforeRemark -verbose:gc -XX:+PrintGCDateStamps
 -XX:+PrintGCDetails -XX:+PrintGCCause -XX:+PrintTenuringDistribution -XX:+PrintGCApplicationStoppedTime
 -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=1M -Xloggc:$OPSC_LOG_PATH/gc.log
 $OPSC_JVM_OPTS"
$ sudo service opscenterd restart