Skip to content

Toro Cloud Dev Center


Cassandra connection pools

Apache Cassandra is a highly scalable, high-performance, distributed, NoSQL database designed to handle large amounts of data across many commodity servers, providing high availability with no single point of failure.1

Cassandra is an extremely powerful database, used by heavy-load applications in organisations such as Facebook and Netflix. Martini allows you to create Cassandra connections and matching Gloop Cassandra services for your Cassandra-dependent applications.

Cassandra config editor

Properties

The properties below are used to configure Cassandra database connections. Martini will use these configuration values when connecting to a Cassandra database.

General configuration properties

Property Default Description
Name The name of the Cassandra connection pool.
Port 9042 The port to use when connecting to the server.
SSL No Whether or not to use SSL.
Username The username to use when authenticating to the server.
Password The password to use when authenticating to the server.
Auto Start Yes Whether or not to automatically start the database upon Martini's startup.
Contact Points Describes the contact points for Cassandra cluster.

Advanced configuration properties

Property Default Description
Max Schema Agreement Wait (seconds) 10 Sets the maximum time to wait for schema agreement before returning from a DDL query.
Compression None The compression to use.
Metrics Yes Whether or not to collect metrics.

Pooling configuration properties

Property Default Description
Core Connections Per Host Local 1 The core number of connections per host whose HostDistance is LOCAL.
Core Connections Per Host Remote 1 The core number of connections per host whose HostDistance is REMOTE.
Max Connections Per Host Local 1 The maximum number of connections per host whose HostDistance is LOCAL.
Max Connections Per Host Remote 1 The maximum number of connections per host whose HostDistance is REMOTE.
Max Connection Threshold Local 800 The threshold that triggers the creation of a new connection to a host whose HostDistance is LOCAL.
Max Connection Threshold Remote 200 The threshold that triggers the creation of a new connection to a host whose HostDistance is REMOTE.
Max Requests Per Connection Local 1024 The maximum number of requests per connection to a host whose HostDistance is LOCAL.
Max Requests Per Connection Remote 256 The maximum number of requests per connection to a host whose HostDistance is LOCAL.
Idle Timeout (seconds) 120 The timeout before an idle connection is removed in seconds.
Pool Timeout (ms) 5000 The timeout when trying to acquire a connection from a host's pool in milliseconds.
Max Queue Size 256 The maximum number of requests to enqueue if no connection is available.
Heartbeat Interval (seconds) 30 The heart beat interval in seconds, after which a message is sent on an idle connection to make sure it's still alive.

Socket configuration properties

Property Default Description
Connect Timeout (ms) 5000 The connection timeout in milliseconds.
Read Timeout (ms) 12000 The per-host read timeout in milliseconds.
Reuse Address Yes Whether or not to enable reuse-address.
TCP No Delay Yes Whether or not to disable Nagle's algorithm.
So Linger 0 The linger-on-close timeout.
Receive Buffer Size 0 A hint to the size of the underlying buffers for incoming network I/O.
Send Buffer Size 0 A hint to the size of the underlying buffers for outgoing network I/O.

Query configuration properties

Property Default Description
Consistency Level Local One The default consistency level used by queries.
Serial Consistency Level Serial The default serial consistency level used by queries.
Fetch Size 5000 The default fetch size used by queries.
Default Idempotence No The default idempotence for queries.
Prepare On All Hosts Yes Whether or not the driver should prepare statements on all hosts in the cluster.
Re-prepare On Up Yes Whether or not the driver should re-prepare all cached prepared statements on a host when it marks it back up.
Refresh Schema Interval (ms) 1000 The default window size in milliseconds used to debounce node list refresh requests.
Max Pending Refresh Schema Requests 20 The maximum number of schema refresh requests that the control connection can accumulate before executing them.
Refresh Node List Interval (ms) 1000 The default window size in milliseconds used to debounce node list refresh requests.
Max Pending Refresh Node List Requests 20 The maximum number of node list refresh requests that the control connection can accumulate before executing them.
Refresh Node Interval (ms) 1000 The default window size in milliseconds used to debounce node refresh requests.
Max Pending Refresh Node Requests 20 The maximum number of node refresh requests that the control connection can accumulate before executing them.

  1. Tutorialspoint. (n.d.). Cassandra Introduction. Retrieved June 21, 2019, from https://www.tutorialspoint.com/cassandra/cassandra_introduction.htm