mirror of https://github.com/apache/cassandra
make out-of-the-box config 1GB-friendly. patch by jbellis; reviewed by Eric Evans for CASSANDRA-118
git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@770811 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0776714f71
commit
e4e5629b13
|
|
@ -22,7 +22,7 @@ JVM_OPTS=" \
|
||||||
-Xdebug \
|
-Xdebug \
|
||||||
-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
|
-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
|
||||||
-Xms128M \
|
-Xms128M \
|
||||||
-Xmx2G \
|
-Xmx1G \
|
||||||
-XX:SurvivorRatio=8 \
|
-XX:SurvivorRatio=8 \
|
||||||
-XX:TargetSurvivorRatio=90 \
|
-XX:TargetSurvivorRatio=90 \
|
||||||
-XX:+AggressiveOpts \
|
-XX:+AggressiveOpts \
|
||||||
|
|
|
||||||
|
|
@ -79,13 +79,14 @@
|
||||||
is based solely on the amount of data stored, not actual heap memory
|
is based solely on the amount of data stored, not actual heap memory
|
||||||
usage (there is some overhead in indexing the columns).
|
usage (there is some overhead in indexing the columns).
|
||||||
-->
|
-->
|
||||||
<MemtableSizeInMB>64</MemtableSizeInMB>
|
<MemtableSizeInMB>32</MemtableSizeInMB>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The maximum number of columns in millions to store in memory
|
The maximum number of columns in millions to store in memory
|
||||||
before flushing to disk. Use with MemtableSizeInMB to tune memory usage.
|
before flushing to disk. This is also a per-memtable setting.
|
||||||
|
Use with MemtableSizeInMB to tune memory usage.
|
||||||
-->
|
-->
|
||||||
<MemtableObjectCountInMillions>1</MemtableObjectCountInMillions>
|
<MemtableObjectCountInMillions>0.1</MemtableObjectCountInMillions>
|
||||||
|
|
||||||
<!-- Time to wait before garbage-collection deletion markers.
|
<!-- Time to wait before garbage-collection deletion markers.
|
||||||
Set this to a large enough value that you are confident
|
Set this to a large enough value that you are confident
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public class DatabaseDescriptor
|
||||||
/* Size of the memtable in memory before it is dumped */
|
/* Size of the memtable in memory before it is dumped */
|
||||||
private static int memtableSize_ = 128;
|
private static int memtableSize_ = 128;
|
||||||
/* Number of objects in millions in the memtable before it is dumped */
|
/* Number of objects in millions in the memtable before it is dumped */
|
||||||
private static int memtableObjectCount_ = 1;
|
private static double memtableObjectCount_ = 1;
|
||||||
/*
|
/*
|
||||||
* This parameter enables or disables consistency checks.
|
* This parameter enables or disables consistency checks.
|
||||||
* If set to false the read repairs are disable for very
|
* If set to false the read repairs are disable for very
|
||||||
|
|
@ -214,7 +214,11 @@ public class DatabaseDescriptor
|
||||||
/* Number of objects in millions in the memtable before it is dumped */
|
/* Number of objects in millions in the memtable before it is dumped */
|
||||||
String memtableObjectCount = xmlUtils.getNodeValue("/Storage/MemtableObjectCountInMillions");
|
String memtableObjectCount = xmlUtils.getNodeValue("/Storage/MemtableObjectCountInMillions");
|
||||||
if ( memtableObjectCount != null )
|
if ( memtableObjectCount != null )
|
||||||
memtableObjectCount_ = Integer.parseInt(memtableObjectCount);
|
memtableObjectCount_ = Double.parseDouble(memtableObjectCount);
|
||||||
|
if (memtableObjectCount_ <= 0)
|
||||||
|
{
|
||||||
|
throw new ConfigurationException("Memtable object count must be a positive double");
|
||||||
|
}
|
||||||
|
|
||||||
/* This parameter enables or disables consistency checks.
|
/* This parameter enables or disables consistency checks.
|
||||||
* If set to false the read repairs are disable for very
|
* If set to false the read repairs are disable for very
|
||||||
|
|
@ -516,7 +520,7 @@ public class DatabaseDescriptor
|
||||||
return memtableSize_;
|
return memtableSize_;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static int getMemtableObjectCount()
|
public static double getMemtableObjectCount()
|
||||||
{
|
{
|
||||||
return memtableObjectCount_;
|
return memtableObjectCount_;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class Memtable implements Comparable<Memtable>
|
||||||
private MemtableThreadPoolExecutor executor_;
|
private MemtableThreadPoolExecutor executor_;
|
||||||
|
|
||||||
private int threshold_ = DatabaseDescriptor.getMemtableSize()*1024*1024;
|
private int threshold_ = DatabaseDescriptor.getMemtableSize()*1024*1024;
|
||||||
private int thresholdCount_ = DatabaseDescriptor.getMemtableObjectCount()*1024*1024;
|
private int thresholdCount_ = (int)(DatabaseDescriptor.getMemtableObjectCount()*1024*1024);
|
||||||
private AtomicInteger currentSize_ = new AtomicInteger(0);
|
private AtomicInteger currentSize_ = new AtomicInteger(0);
|
||||||
private AtomicInteger currentObjectCount_ = new AtomicInteger(0);
|
private AtomicInteger currentObjectCount_ = new AtomicInteger(0);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ JVM_OPTS=" \
|
||||||
-Xdebug \
|
-Xdebug \
|
||||||
-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
|
-Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
|
||||||
-Xms128M \
|
-Xms128M \
|
||||||
-Xmx2G \
|
-Xmx1G \
|
||||||
-XX:SurvivorRatio=8 \
|
-XX:SurvivorRatio=8 \
|
||||||
-XX:TargetSurvivorRatio=90 \
|
-XX:TargetSurvivorRatio=90 \
|
||||||
-XX:+AggressiveOpts \
|
-XX:+AggressiveOpts \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue