Correctly selecting the right parameters for tuning JVM performance is difficult for any modern Java-based application. Cassandra is certainly no exception. The default list of arguments defined in bin/cassandra.in.sh contains 12 different options passed to the JVM, eight of which focus on tuning the garbage collector. The full list of options with a brief description is listed below.
The default options were selected with the goals of quickly collecting large numbers of short-lived objects on multi-processor machines with large amounts of available RAM. It is important to note that, as previously mentioned, workload and environment-specific modifications of these settings will almost certainly be needed. See the section on Heap Sizing for more information.
| Option | Description |
|---|---|
| -ea | Enables assertions in the JVM |
| -Xms | Minimum heap for the JVM to use (1G) |
| -Xmx | Maximum heap for the JVM to use. By setting this equal Xms, the JVM will claim the entire heap on process start, and thus avoid fairly expensive heap resizing operations. (1G) |
| -XX:+UseParNewGC | Use the parallel (ie. multi-threaded) garbage collector on the new generation |
| -XX:+UseConcMarkSweepGC | Use the “Concurrent Mark Sweep” garbage collector which parallelizes collections in the old generation |
| -XX:+CMSParallelRemarkEnabled | Reduces remark pause times during minor collections |
| -XX:SurvivorRatio | Sets the ratio of the two survivor spaces to the young generation (8) |
| -XX:MaxTenuringThreshold | Determines how many times an object may be copied between survivor spaces before promotion to the old generation (1) |
| -XX:+HeapDumpOnOutOfMemoryError | If there was an OutOfMemoryError, create a core dump file |
See the JVM options list for more information on these and other JVM tuning parameters.
Additionally, system properties can be passed to the JVM to control some options. By default, the three system properties in cassandra.in.sh configure JMX to listen on port 8080 with no authentication. See the table below for more information on system properties used by Cassandra.
| Property | Description |
|---|---|
| storage-config | Specify an alternate location for the configuration file |
| cassandra-pidfile | The location of the pid file |
| cassandra-foreground | Run in the foreground instead of as a daemon |
| passwd.mode | If the value is MD5 and the SimpleAuthenticator has been configured, passwords in the passwd.properties file should be MD5 hashed (see the section on Authentication for more detail) |
| com.sun.management.jmxremote.port | The port on which we will listen from JMX |
| com.sun.management.jmxremote.ssl | Disable SSL for JMX |
| com.sun.management.jmxremote.authenticate | Disable remote authentication for JMX |