Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 50108 invoked from network); 4 Apr 2011 16:50:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Apr 2011 16:50:55 -0000 Received: (qmail 87989 invoked by uid 500); 4 Apr 2011 16:50:52 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 87968 invoked by uid 500); 4 Apr 2011 16:50:52 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 87960 invoked by uid 99); 4 Apr 2011 16:50:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2011 16:50:52 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.210.172] (HELO mail-iy0-f172.google.com) (209.85.210.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Apr 2011 16:50:43 +0000 Received: by iye19 with SMTP id 19so7190988iye.31 for ; Mon, 04 Apr 2011 09:50:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.43.59.132 with SMTP id wo4mr1175748icb.406.1301935822044; Mon, 04 Apr 2011 09:50:22 -0700 (PDT) Sender: scode@scode.org Received: by 10.231.208.65 with HTTP; Mon, 4 Apr 2011 09:50:22 -0700 (PDT) X-Originating-IP: [213.114.156.79] In-Reply-To: References: <34142DA8-23A8-435D-BF0B-1BFFDB6261CB@thelastpickle.com> Date: Mon, 4 Apr 2011 18:50:22 +0200 X-Google-Sender-Auth: oMLdlKv3l5ikwPMppUletzIQ3Yo Message-ID: Subject: Re: Abnormal memory consumption From: Peter Schuller To: user@cassandra.apache.org Cc: openvictor Open Content-Type: text/plain; charset=UTF-8 X-Virus-Checked: Checked by ClamAV on apache.org > My last concern and for me it is a flaw for Cassandra and I am sad to admit > it because I love cassandra : how come that for 6Mb of data, Cassandra feels > the need to fill 500 Mb of RAM ? I can understand the need for, let's say, > 100 Mo because of cache and several Memtable being alive at the same time. > But 500 Mb of ram is 80 time the total amount of data I have. redis that you > mentionned uses 50 Mb. It's just the way the JVM works, particularly when using the CMS gc. For efficiency reasons it'll tend to use up to your maximum heap size. In the case of default cassandra options, it's even specified that the initial heap size is equal to the maxium. It's not that it needs that much memory for 60 mb of data; it's that the way Cassandra is configured and run by default, in combination with JVM behavior, means that you'll end up eating a significant amount of data for a node. Increasing your 60 mb to 120 mb doesn't double the amount of memory you need for your node. You can change VM settings and tweak things like memtable thresholds and in-memory compaction limits to get it down and get away with a smaller heap size, but honestly I don't recommend doing so unless you're willing to spend some time getting that right and probably repeating some of the work in the future with future versions of Cassandra. I think the bottom line is that Cassandra isn't really primarily intended, out-of-the-box to run as one out of N database servers on a single machine. and no effort is put into trying to make Cassandra very useful for very very small heap sizes. -- / Peter Schuller