reduce buffer sizes for test suite since it forces lots of small flushes. reduces NameSortTest from ~30s back to < 10s.

patch by jbellis for CASSANDRA-339

git-svn-id: https://svn.apache.org/repos/asf/incubator/cassandra/trunk@802276 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jonathan Ellis 2009-08-08 00:59:14 +00:00
parent a7f0fb64ae
commit 9d6f4752b6
4 changed files with 14 additions and 9 deletions

View File

@ -196,7 +196,10 @@
<!-- Buffer size to use when flushing memtables to disk.
(Only one memtable is ever flushed at a time.)
Increase (decrease) the index buffer size relative to the data buffer
if you have few (many) columns per key. -->
if you have few (many) columns per key.
Bigger is only better _if_ your memtables get large enough to use the space.
(Check in your data directory after your app has been running long enough.)
-->
<FlushDataBufferSizeInMB>32</FlushDataBufferSizeInMB>
<FlushIndexBufferSizeInMB>8</FlushIndexBufferSizeInMB>

View File

@ -68,8 +68,8 @@ public class DatabaseDescriptor
private static int concurrentReaders_ = 8;
private static int concurrentWriters_ = 32;
private static int flushDataBufferSizeInMB_ = 32;
private static int flushIndexBufferSizeInMB_ = 32;
private static double flushDataBufferSizeInMB_ = 32;
private static double flushIndexBufferSizeInMB_ = 8;
private static List<String> tables_ = new ArrayList<String>();
private static Set<String> applicationColumnFamilies_ = new HashSet<String>();
@ -230,12 +230,12 @@ public class DatabaseDescriptor
String rawFlushData = xmlUtils.getNodeValue("/Storage/FlushDataBufferSizeInMB");
if (rawFlushData != null)
{
flushDataBufferSizeInMB_ = Integer.parseInt(rawFlushData);
flushDataBufferSizeInMB_ = Double.parseDouble(rawFlushData);
}
String rawFlushIndex = xmlUtils.getNodeValue("/Storage/FlushIndexBufferSizeInMB");
if (rawFlushIndex != null)
{
flushIndexBufferSizeInMB_ = Integer.parseInt(rawFlushIndex);
flushIndexBufferSizeInMB_ = Double.parseDouble(rawFlushIndex);
}
/* TCP port on which the storage system listens */
@ -924,12 +924,12 @@ public class DatabaseDescriptor
return commitLogSync_;
}
public static int getFlushDataBufferSizeInMB()
public static double getFlushDataBufferSizeInMB()
{
return flushDataBufferSizeInMB_;
}
public static int getFlushIndexBufferSizeInMB()
public static double getFlushIndexBufferSizeInMB()
{
return flushIndexBufferSizeInMB_;
}

View File

@ -27,8 +27,8 @@ public class SSTableWriter extends SSTable
public SSTableWriter(String filename, int keyCount, IPartitioner partitioner) throws IOException
{
super(filename, partitioner);
dataFile = new BufferedRandomAccessFile(path, "rw", DatabaseDescriptor.getFlushDataBufferSizeInMB() * 1024 * 1024);
indexFile = new BufferedRandomAccessFile(indexFilename(), "rw", DatabaseDescriptor.getFlushIndexBufferSizeInMB() * 1024 * 1024);
dataFile = new BufferedRandomAccessFile(path, "rw", (int)(DatabaseDescriptor.getFlushDataBufferSizeInMB() * 1024 * 1024));
indexFile = new BufferedRandomAccessFile(indexFilename(), "rw", (int)(DatabaseDescriptor.getFlushIndexBufferSizeInMB() * 1024 * 1024));
bf = new BloomFilter(keyCount, 15);
}

View File

@ -18,6 +18,8 @@
-->
<Storage>
<ClusterName>Test Cluster</ClusterName>
<FlushDataBufferSizeInMB>1</FlushDataBufferSizeInMB>
<FlushIndexBufferSizeInMB>0.1</FlushIndexBufferSizeInMB>
<CommitLogSync>true</CommitLogSync>
<CommitLogSyncDelay>1000</CommitLogSyncDelay>
<Partitioner>org.apache.cassandra.dht.CollatingOrderPreservingPartitioner</Partitioner>