cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbel...@apache.org
Subject svn commit: r770811 - in /incubator/cassandra/trunk: bin/cassandra.in.sh conf/storage-conf.xml src/java/org/apache/cassandra/config/DatabaseDescriptor.java src/java/org/apache/cassandra/db/Memtable.java test/cassandra.in.sh
Date Fri, 01 May 2009 20:14:36 GMT
Author: jbellis
Date: Fri May  1 20:14:35 2009
New Revision: 770811

URL: http://svn.apache.org/viewvc?rev=770811&view=rev
Log:
make out-of-the-box config 1GB-friendly.  patch by jbellis; reviewed by Eric Evans for CASSANDRA-118

Modified:
    incubator/cassandra/trunk/bin/cassandra.in.sh
    incubator/cassandra/trunk/conf/storage-conf.xml
    incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
    incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
    incubator/cassandra/trunk/test/cassandra.in.sh

Modified: incubator/cassandra/trunk/bin/cassandra.in.sh
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/bin/cassandra.in.sh?rev=770811&r1=770810&r2=770811&view=diff
==============================================================================
--- incubator/cassandra/trunk/bin/cassandra.in.sh (original)
+++ incubator/cassandra/trunk/bin/cassandra.in.sh Fri May  1 20:14:35 2009
@@ -22,7 +22,7 @@
         -Xdebug \
         -Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
         -Xms128M \
-        -Xmx2G \
+        -Xmx1G \
         -XX:SurvivorRatio=8 \
         -XX:TargetSurvivorRatio=90 \
         -XX:+AggressiveOpts \

Modified: incubator/cassandra/trunk/conf/storage-conf.xml
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/conf/storage-conf.xml?rev=770811&r1=770810&r2=770811&view=diff
==============================================================================
--- incubator/cassandra/trunk/conf/storage-conf.xml (original)
+++ incubator/cassandra/trunk/conf/storage-conf.xml Fri May  1 20:14:35 2009
@@ -79,13 +79,14 @@
       is based solely on the amount of data stored, not actual heap memory
       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
-      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.
          Set this to a large enough value that you are confident

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java?rev=770811&r1=770810&r2=770811&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
(original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
Fri May  1 20:14:35 2009
@@ -97,7 +97,7 @@
     /* Size of the memtable in memory before it is dumped */
     private static int memtableSize_ = 128;
     /* 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. 
      * If set to false the read repairs are disable for very
@@ -214,7 +214,11 @@
             /* Number of objects in millions in the memtable before it is dumped */
             String memtableObjectCount = xmlUtils.getNodeValue("/Storage/MemtableObjectCountInMillions");
             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.
              * If set to false the read repairs are disable for very
@@ -516,7 +520,7 @@
       return memtableSize_;
     }
 
-    public static int getMemtableObjectCount()
+    public static double getMemtableObjectCount()
     {
       return memtableObjectCount_;
     }

Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=770811&r1=770810&r2=770811&view=diff
==============================================================================
--- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original)
+++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Fri May  1 20:14:35
2009
@@ -73,7 +73,7 @@
     private MemtableThreadPoolExecutor executor_;
 
     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 currentObjectCount_ = new AtomicInteger(0);
 

Modified: incubator/cassandra/trunk/test/cassandra.in.sh
URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/test/cassandra.in.sh?rev=770811&r1=770810&r2=770811&view=diff
==============================================================================
--- incubator/cassandra/trunk/test/cassandra.in.sh (original)
+++ incubator/cassandra/trunk/test/cassandra.in.sh Fri May  1 20:14:35 2009
@@ -23,7 +23,7 @@
         -Xdebug \
         -Xrunjdwp:transport=dt_socket,server=y,address=8888,suspend=n \
         -Xms128M \
-        -Xmx2G \
+        -Xmx1G \
         -XX:SurvivorRatio=8 \
         -XX:TargetSurvivorRatio=90 \
         -XX:+AggressiveOpts \



Mime
View raw message