improve memory use and timeout defaults patch by jbellis; reviewed by brandonwilliams for CASSANDRA-6059
Project: http://git-wip-us.apache.org/repos/asf/cassandra/repo Commit: http://git-wip-us.apache.org/repos/asf/cassandra/commit/72be2a43 Tree: http://git-wip-us.apache.org/repos/asf/cassandra/tree/72be2a43 Diff: http://git-wip-us.apache.org/repos/asf/cassandra/diff/72be2a43 Branch: refs/heads/trunk Commit: 72be2a4360caa0f9c315097bbd5d9199a032821c Parents: 2336d94 Author: Jonathan Ellis <jbel...@apache.org> Authored: Thu Sep 19 14:37:33 2013 -0500 Committer: Jonathan Ellis <jbel...@apache.org> Committed: Thu Sep 19 14:37:33 2013 -0500 ---------------------------------------------------------------------- CHANGES.txt | 1 + NEWS.txt | 10 ++++++++++ conf/cassandra.yaml | 4 ++-- src/java/org/apache/cassandra/config/Config.java | 2 +- .../org/apache/cassandra/config/DatabaseDescriptor.java | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cassandra/blob/72be2a43/CHANGES.txt ---------------------------------------------------------------------- diff --git a/CHANGES.txt b/CHANGES.txt index a25d03e..979d6b0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,5 @@ 2.0.2 + * Improve memory use defaults (CASSANDRA-5069) * Make ThriftServer more easlly extensible (CASSANDRA-6058) * Remove Hadoop dependency from ITransportFactory (CASSANDRA-6062) Merged from 1.2: http://git-wip-us.apache.org/repos/asf/cassandra/blob/72be2a43/NEWS.txt ---------------------------------------------------------------------- diff --git a/NEWS.txt b/NEWS.txt index 68da597..3712073 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -13,6 +13,16 @@ restore snapshots created with the previous major version using the 'sstableloader' tool. You can upgrade the file format of your snapshots using the provided 'sstableupgrade' tool. +2.0.2 +===== + +Upgrading +--------- + - The default memtable allocation has changed from 1/3 of heap to 1/4 + of heap. Also, default (single-partition) read and write timeouts + have been reduced from 10s to 5s and 2s, respectively. + + 2.0.0 ===== http://git-wip-us.apache.org/repos/asf/cassandra/blob/72be2a43/conf/cassandra.yaml ---------------------------------------------------------------------- diff --git a/conf/cassandra.yaml b/conf/cassandra.yaml index df4501e..4af7275 100644 --- a/conf/cassandra.yaml +++ b/conf/cassandra.yaml @@ -460,11 +460,11 @@ compaction_preheat_key_cache: true # stream_throughput_outbound_megabits_per_sec: 200 # How long the coordinator should wait for read operations to complete -read_request_timeout_in_ms: 10000 +read_request_timeout_in_ms: 5000 # How long the coordinator should wait for seq or index scans to complete range_request_timeout_in_ms: 10000 # How long the coordinator should wait for writes to complete -write_request_timeout_in_ms: 10000 +write_request_timeout_in_ms: 2000 # How long a coordinator should continue to retry a CAS operation # that contends with other proposals for the same row cas_contention_timeout_in_ms: 1000 http://git-wip-us.apache.org/repos/asf/cassandra/blob/72be2a43/src/java/org/apache/cassandra/config/Config.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/config/Config.java b/src/java/org/apache/cassandra/config/Config.java index 0414269..c6fd020 100644 --- a/src/java/org/apache/cassandra/config/Config.java +++ b/src/java/org/apache/cassandra/config/Config.java @@ -56,7 +56,7 @@ public class Config public Long range_request_timeout_in_ms = new Long(10000); - public Long write_request_timeout_in_ms = new Long(10000); + public Long write_request_timeout_in_ms = new Long(2000); public Long cas_contention_timeout_in_ms = new Long(1000); http://git-wip-us.apache.org/repos/asf/cassandra/blob/72be2a43/src/java/org/apache/cassandra/config/DatabaseDescriptor.java ---------------------------------------------------------------------- diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java index 42459e4..572a06f 100644 --- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java +++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java @@ -249,7 +249,7 @@ public class DatabaseDescriptor conf.file_cache_size_in_mb = Math.min(512, (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576))); if (conf.memtable_total_space_in_mb == null) - conf.memtable_total_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (3 * 1048576)); + conf.memtable_total_space_in_mb = (int) (Runtime.getRuntime().maxMemory() / (4 * 1048576)); if (conf.memtable_total_space_in_mb <= 0) throw new ConfigurationException("memtable_total_space_in_mb must be positive"); logger.info("Global memtable threshold is enabled at {}MB", conf.memtable_total_space_in_mb);