update default commitlog segment and total size

patch by jbellis; reviewed by vijay for CASSANDRA-4422
This commit is contained in:
Jonathan Ellis 2012-07-06 13:36:20 -05:00
parent 9a8a8902b2
commit aa2c28eade
4 changed files with 25 additions and 10 deletions

View File

@ -1,4 +1,6 @@
1.1.3
* update default commitlog segment size to 32MB and total commitlog
size to 32/1024 MB for 32/64 bit JVMs, respectively (CASSANDRA-4422)
* avoid using global partitioner to estimate ranges in index sstables
(CASSANDRA-4403)
* restore pre-CASSANDRA-3862 approach to removing expired tombstones

View File

@ -155,13 +155,16 @@ saved_caches_directory: /var/lib/cassandra/saved_caches
commitlog_sync: periodic
commitlog_sync_period_in_ms: 10000
# Configure the Size of the individual Commitlog file. The
# default is 128 MB, which is almost always fine, but if you are
# archiving commitlog segments (see commitlog_archiving.properties),
# then you probably want a finer granularity of archiving; 16 MB
# is reasonable.
# The size of the individual commitlog file segments. A commitlog
# segment may be archived, deleted, or recycled once all the data
# in it (potentally from each columnfamily in the system) has been
# flushed to sstables.
#
# commitlog_segment_size_in_mb: 128
# The default size is 32, which is almost always fine, but if you are
# archiving commitlog segments (see commitlog_archiving.properties),
# then you probably want a finer granularity of archiving; 8 or 16 MB
# is reasonable.
commitlog_segment_size_in_mb: 32
# any class that implements the SeedProvider interface and has a
# constructor that takes a Map<String, String> of parameters will do.
@ -218,10 +221,14 @@ concurrent_writes: 32
# If omitted, Cassandra will set it to 1/3 of the heap.
# memtable_total_space_in_mb: 2048
# Total space to use for commitlogs.
# 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 1024 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.
# segment and remove it. So a small total commitlog space will tend
# to cause more flush activity on less-active columnfamilies.
# commitlog_total_space_in_mb: 4096
# This sets the amount of memtable flush writer threads. These will

View File

@ -97,11 +97,11 @@ public class Config
// Commit Log
public String commitlog_directory;
public Integer commitlog_total_space_in_mb = 4096;
public Integer commitlog_total_space_in_mb;
public CommitLogSync commitlog_sync;
public Double commitlog_sync_batch_window_in_ms;
public Integer commitlog_sync_period_in_ms;
public int commitlog_segment_size_in_mb = 128;
public int commitlog_segment_size_in_mb = 32;
public String endpoint_snitch;
public Boolean dynamic_snitch = true;

View File

@ -142,6 +142,9 @@ public class DatabaseDescriptor
Yaml yaml = new Yaml(new Loader(constructor));
conf = (Config)yaml.load(input);
if (!System.getProperty("os.arch").contains("64"))
logger.info("32bit JVM detected. It is recommended to run Cassandra on a 64bit JVM for better performance.");
if (conf.commitlog_sync == null)
{
throw new ConfigurationException("Missing required directive CommitLogSync");
@ -172,6 +175,9 @@ public class DatabaseDescriptor
logger.debug("Syncing log with a period of " + conf.commitlog_sync_period_in_ms);
}
if (conf.commitlog_total_space_in_mb == null)
conf.commitlog_total_space_in_mb = System.getProperty("os.arch").contains("64") ? 1024 : 32;
/* evaluate the DiskAccessMode Config directive, which also affects indexAccessMode selection */
if (conf.disk_access_mode == Config.DiskAccessMode.auto)
{