Skip to content

Cassandra Tuning

Priam tunes common cassandra configurations out of the box. Priam traditionally had support to tune Datastax Cassandra. With Datastax forking the Cassandra, Priam has stopped maintaining the DSE tuners since 3.11 branch of Priam. Note: DSE tuners will not be available going forward.

Apache Cassandra 3.0.x (and above) have additional files that can be configured like jvm.options.

Seed Provider

Priam provides its own Seed Provider for Cassandra: NFSeedProvider. This allows Cassandra to get list of seed nodes from Priam at every startup. Priam sends an updated list of instances which can be used as seed for Cassandra to bootstrap. Priam manages the bootstrap process of cassandra based on: * This is a new cluster * Replacement of the instance * Doubling of Cassandra cluster * Restore mode.

  1. priam.seed.provider: Seed provider to be used to determine the seed nodes for an instance to bootstrap. Default: com.netflix.priam.cassandra.extensions.NFSeedProvider.

Configurations

Ports

  1. priam.storage.port: Cassandra storage/cluster communication port. Default: 7000.
  2. priam.ssl.storage.port: Cassandra SSL enabled storage/cluster communication port. Default: 7001.
  3. priam.thrift.port: Cassandra thrift(pre-CQL) port for clients to connect to. Default: 9160.
  4. priam.nativeTransport.port: Cassandra native transport port for clients to connect to (CQL). Default: 9042.
  5. priam.jmx.port: Cassandra JMX port. Priam uses JMX to connect to local Cassandra to automate various management functions. Default: 7199

Cassandra

  1. priam.thrift.enabled: Should thrift protocol be enabled on cassandra? This is deprecated in Apache Cassandra going forward (4.x and above). Default: true in 3.x branch, else false.
  2. priam.nativeTransport.enabled: Should native protocol be enabled on cassandra. This is preferred approach. Default: true
  3. priam.endpoint_snitch: Snitch to be used by Cassandra to identify the other Cassandra instances. This depends on the environment and deployment topology of Cassandra. Example: for multi-region cluster this should be EC2MultiRegionSnitch. Default: org.apache.cassandra.locator.Ec2Snitch. This assumes an AWS hosted, single region cluster deployment.
  4. priam.compaction.throughput: Compaction throughput allowed in MB/sec for Cassandra. Default: 8
  5. priam.partitioner: Partitioner algorithm to be used by Cassandra to hash the data. Default: org.apache.cassandra.dht.RandomPartitioner for 3.x and 3.11 branch. Note: org.apache.cassandra.dht.Murmur3Partitioner has better performance and will be default going forward.
  6. priam.streaming.throughput.mb: Streaming throughput outbound in MB/sec for Cassandra. Default: 400.
  7. priam.internodeCompression: Compression to use by Cassandra while communicating? Allowed values are - all, dc, none. Default: all.
  8. priam.dsnitchEnabled: Enable dynamic snitch while serving the traffic? Default: true.
  9. priam.tombstone.warning.threshold: Cassandra will log warning messages in cassandra logs if a read encounters more than this value of tombstones. Default: 1000.
  10. priam.tombstone.failure.threshold: Cassandra should fail the read if it encounters more than this value of tombstones in a single read operation. Default: 100000.
  11. priam.streaming.socket.timeout.ms: Streaming socket timeout for Cassandra in milliseconds. Default: 86400000 (1 day).
  12. priam.compaction.large.partition.warn.threshold: Log warning message in Cassandra logs if it encounters large partitions more than this value (in MB) during compaction. Default: 100.

Cassandra Directory Configurations

  1. priam.cass.home: Directory location of the cassandra home. Default: \etc\cassandra.
  2. priam.cache.location: Directory location of the cassandra cache location. Default: \var\lib\cassandra\saved_caches.
  3. priam.commitlog.location: Directory location of the cassandra commitlog. Ensure Priam has read/write permissions to this folder. Default: \var\lib\cassandra\commitlog.
  4. priam.data.location: Directory location of the cassandra data folder. Ensure Priam has read/write permissions to this folder. Default: \var\lib\cassandra\data.
  5. priam.logs.location: Directory location of the cassandra logs. Default: \var\lib\cassandra\logs.
  6. priam.cass.startscript: Location (with parameters) of the cassandra start script. Default: \etc\init.d\cassandra start
  7. priam.cass.stopscript: Location (with parameters) of the cassandra stop script. Default: \etc\init.d\cassandra stop

Cassandra JVM Configurations

  1. priam..heap.size.$INSTANCETYPE
  2. priam.heap.newgen.size.$INSTANCETYPE
  3. priam.direct.memory.size.$INSTANCETYPE

JVM Options Tuning

Cassandra 3.0.x added a new way to configure heap sizes and pass other JVM parameters (via jvm.options). Priam now supports configuring common options like heap setting and choosing Garbage Collection type (G1GC/CMS) natively. Default being CMS. It logs jvm.options after tuning them.

Configuration

  1. priam.jvm.options.location: The file mentioned by this is used as a template and the final location where jvm.options is read and written so Cassandra can pick it for its use. Default value is {$CASS_HOME}/conf/jvm.options. Note that {$CASS_HOME} can be configured by using priam.cass.home.
  2. priam.gc.type: This is used to configure the garbage collection type for Cassandra to use. The value is an enum of G1GC or CMS. The default value is CMS. NOTE: This only comments or uncomments any configuration mentioned in provided jvm.options file.
  3. priam.jvm.options.upsert: This configuration is comma separated list of JVM options to be appended or updated (change default value) mentioned in jvm.options. Note that JVM parameters are case-sensitive and thus this configuration can only exclude JVM parameters if case match. Example: -Dsample=1,-Dsample2,-Xmn20G
  4. priam.jvm.options.exclude: This configuration is comma separated list of JVM options to be excluded which are mentioned in jvm.options. Note that JVM parameters are case-sensitive and thus this configuration can only exclude JVM parameters if case match. Exclude list is always applied after priam.jvm.options.upsert. Example: -XX:+PrintHeapAtGC,-XX:+UseParNewGC

Security Configurations

Priam allows to manage Cassandra security features like authentication, authorization, client SSL etc. Please refer to doc to see how to enable authorization and authentication in Cassandra.

Priam uses local JMX Connection to connect to local Cassandra to automate various cluster management operations. Priam allows these JMX connections to be protected via username/password for extra security.

Configurations

  1. priam.client.sslEnabled: Use SSL when clients connect to Cassandra. Default: false.
  2. priam.internodeEncryption: Use encryption when cassandra connects to other instances. Default: none
  3. priam.jmx.username: Username to use when connecting to local cassandra. Default: <empty>.
  4. priam.jmx.password: Password to use when connecting to local cassandra. Default: <empty>.
  5. priam.jmx.remote.enable: Enable the local JMX connection to be available remotely. Enabling this is not recommended as it poses security threat. Default: false.