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.
- 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
- priam.storage.port: Cassandra storage/cluster communication port. Default:
7000
. - priam.ssl.storage.port: Cassandra SSL enabled storage/cluster communication port. Default:
7001
. - priam.thrift.port: Cassandra thrift(pre-CQL) port for clients to connect to. Default:
9160
. - priam.nativeTransport.port: Cassandra native transport port for clients to connect to (CQL). Default:
9042
. - priam.jmx.port: Cassandra JMX port. Priam uses JMX to connect to local Cassandra to automate various management functions. Default:
7199
Cassandra
- priam.thrift.enabled: Should thrift protocol be enabled on cassandra? This is deprecated in Apache Cassandra going forward (4.x and above). Default:
true
in3.x
branch, elsefalse
. - priam.nativeTransport.enabled: Should native protocol be enabled on cassandra. This is preferred approach. Default:
true
- 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. - priam.compaction.throughput: Compaction throughput allowed in MB/sec for Cassandra. Default:
8
- priam.partitioner: Partitioner algorithm to be used by Cassandra to hash the data. Default:
org.apache.cassandra.dht.RandomPartitioner
for3.x
and3.11
branch. Note:org.apache.cassandra.dht.Murmur3Partitioner
has better performance and will be default going forward. - priam.streaming.throughput.mb: Streaming throughput outbound in MB/sec for Cassandra. Default:
400
. - priam.internodeCompression: Compression to use by Cassandra while communicating? Allowed values are - all, dc, none. Default:
all
. - priam.dsnitchEnabled: Enable dynamic snitch while serving the traffic? Default:
true
. - priam.tombstone.warning.threshold: Cassandra will log warning messages in cassandra logs if a read encounters more than this value of tombstones. Default:
1000
. - 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
. - priam.streaming.socket.timeout.ms: Streaming socket timeout for Cassandra in milliseconds. Default:
86400000
(1 day). - 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
- priam.cass.home: Directory location of the cassandra home. Default:
\etc\cassandra
. - priam.cache.location: Directory location of the cassandra cache location. Default:
\var\lib\cassandra\saved_caches
. - priam.commitlog.location: Directory location of the cassandra commitlog. Ensure Priam has read/write permissions to this folder. Default:
\var\lib\cassandra\commitlog
. - priam.data.location: Directory location of the cassandra data folder. Ensure Priam has read/write permissions to this folder. Default:
\var\lib\cassandra\data
. - priam.logs.location: Directory location of the cassandra logs. Default:
\var\lib\cassandra\logs
. - priam.cass.startscript: Location (with parameters) of the cassandra start script. Default:
\etc\init.d\cassandra start
- priam.cass.stopscript: Location (with parameters) of the cassandra stop script. Default:
\etc\init.d\cassandra stop
Cassandra JVM Configurations
- priam..heap.size.$INSTANCETYPE
- priam.heap.newgen.size.$INSTANCETYPE
- 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
- 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. - 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. - 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
- 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
- priam.client.sslEnabled: Use SSL when clients connect to Cassandra. Default:
false
. - priam.internodeEncryption: Use encryption when cassandra connects to other instances. Default:
none
- priam.jmx.username: Username to use when connecting to local cassandra. Default:
<empty>
. - priam.jmx.password: Password to use when connecting to local cassandra. Default:
<empty>
. - 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
.