You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by E S <tr...@yahoo.com> on 2011/02/13 08:17:00 UTC

Extra Large Memtables

I am trying to minimize my SSTable count to help cut down my read latency.  I 
have some very beefy boxes for my cassandra nodes (96 gigs of memory each).  I 
think this gives me a lot of flexibility to cut down SSTable count by having a 
very large memtable throughput setting.

While experimenting with this, I found a bug where you can't have memtable 
throughput configured past 2 gigs without an integer overflow screwing up the 
flushes.  That makes me feel like I'm in uncharted territory :).  I'm guessing 
the standard answer to too many SSTables, is get more boxes, but I'm hoping I 
can squeeze a lot more juice out of the ones I have given the specs.

I had wanted to set the throughput to 8 gigs for my column family (I only have 
one) and set my heap to 30 gigs (still leaving 66 gigs for file cache).  When 
this failed due to the int overflow, I partitioned the column family into 4 
column families (simple mod operation on the row key when I save and retrieve) 
and set them each to 2 gigs throughput to replicate the same behavior.

I did some quick write stress tests and every things to perform well and 
stable.  Memory usage also seemed stable.  However, I am nervous since the 
defect makes me think most people are using much smaller memory loads.  Has 
anyone had any experience with having cassandra use this much memory?  Does 
anyone see any pitfalls that I'm missing?  If not, I'll let you guys know if I 
learn anything interesting!



      

Re: Extra Large Memtables

Posted by Matthew Dennis <md...@datastax.com>.
On Mon, Feb 14, 2011 at 2:54 PM, Robert Coli <rc...@digg.com> wrote:

> Regarding very large memtables, it is important to recognize that
> throughput refers only to the size of the COLUMN VALUES, and not, for
> example, their names.
>

That would be a bug in it's own right.  There are lots of use cases that
only use column names and never use the values.

line 113 @
http://svn.apache.org/viewvc/cassandra/trunk/src/java/org/apache/cassandra/db/Column.java?revision=1063928&view=markup

Re: Extra Large Memtables

Posted by Robert Coli <rc...@digg.com>.
On Sat, Feb 12, 2011 at 11:17 PM, E S <tr...@yahoo.com> wrote:
> While experimenting with this, I found a bug where you can't have memtable
> throughput configured past 2 gigs without an integer overflow screwing up the
> flushes.  That makes me feel like I'm in uncharted territory :).

I am sure the project would appreciate a JIRA ticket detailing how to
reproduce this behavior, which sounds like a bug.

https://issues.apache.org/jira/browse/CASSANDRA

Regarding very large memtables, it is important to recognize that
throughput refers only to the size of the COLUMN VALUES, and not, for
example, their names. In cases where, for example, an empty column
value is being stored with a UUID column name, your memtable can be
much larger than the value in the cf definition. I have seen 1GB-sized
memtables flush to disk as 1.7GB, and they are likely significantly
larger in memory due to Java object overhead.

=Rob

Re: Extra Large Memtables

Posted by Tyler Hobbs <ty...@datastax.com>.
I should note up front that the JVM simply does not handle heap sizes above
20G very well because the GC starts to become problematic.

Do you read rows in a uniformly random way?  If not, caching is your best
bet for reducing read latencies.  You should have enough space to cache all
of your keys, and you may be able to have an effective row cache, depending
on your row sizes and access patterns.  Obviously the OS buffer cache will
help out tremendously once warm.

Some people do run Cassandra with really high memory boxes like yours, but
it's not optimal for Cassandra.  More nodes with less hardware have many
advantages.  I suppose splitting your CF is an attempt to do something
similar.

-- 
Tyler Hobbs
Software Engineer, DataStax <http://datastax.com/>
Maintainer of the pycassa <http://github.com/pycassa/pycassa> Cassandra
Python client library