1. 程式人生 > >關於Cassandra一些調優配置

關於Cassandra一些調優配置

Cassandra.yaml

commit_failure_policy: stop_commit
policy for commit disk failures:
die: shut down gossip and Thrift and kill the JVM, so the node can be replaced.
stop: shut down gossip and Thrift, leaving the node effectively dead, but
can still be inspected via JMX.
stop_commit: shutdown the commit log, letting writes collect but
continuing to service reads, as in pre-2.0.5 Cassandra
ignore: ignore fatal errors and let the batches fail

concurrent_reads: 128 concurrent_writes: 8 * number_of_cores concurrent_counter_writes: 48

For workloads with more data than can fit in memory, Cassandra’s
bottleneck will be reads that need to fetch data from
disk. “concurrent_reads” should be set to (16 * number_of_drives) in
order to allow the operations to enqueue low enough in the stack
that the OS and drives can reorder them. Same applies to
“concurrent_counter_writes”, since counter writes read the current
values before incrementing and writing them back.

On the other hand, since writes are almost never IO bound, the ideal
number of “concurrent_writes” is dependent on the number of cores in
your system; (8 * number_of_cores) is a good rule of thumb.
引數說明: concurrent_reads調大一點可以在一定程度上避免讀超時的錯誤

commitlog_directory data_file_directories配置到不同的目錄下
commit log. when running on magnetic HDD, this should be a
separate spindle than the data directories.
If not set, the default directory is $CASSANDRA_HOME/data/commitlog.

Directories where Cassandra should store data on disk. Cassandra
will spread data evenly across them, subject to the granularity of
the configured compaction strategy.
If not set, the default directory is $CASSANDRA_HOME/data/data.

compaction_throughput_mb_per_sec: 25
Throttles compaction to the given total throughput across the entire
system. The faster you insert data, the faster you need to compact in
order to keep the sstable count down, but in general, setting this to
16 to 32 times the rate you are inserting data is more than sufficient.
Setting this to 0 disables throttling. Note that this account for all types
of compaction, including validation compaction.

commitlog_total_space_in_mb: 10240
Total space to use for commitlogs. Since commitlog segments are
mmapped, and hence use up address space, the default size is 32
on 32-bit JVMs, and 8192 on 64-bit JVMs.

If space gets above this value (it will round up to the next nearest
segment multiple), Cassandra will flush every dirty CF in the oldest
segment and remove it. So a small total commitlog space will tend
to cause more flush activity on less-active columnfamilies.

read_request_timeout_in_ms: 10000
How long the coordinator should wait for read operations to complete

range_request_timeout_in_ms: 20000
How long the coordinator should wait for seq or index scans to complete

request_timeout_in_ms: 20000
The default timeout for other, miscellaneous operations