Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 20886 invoked from network); 18 Oct 2010 21:14:14 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Oct 2010 21:14:14 -0000 Received: (qmail 11255 invoked by uid 500); 18 Oct 2010 21:14:12 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 11234 invoked by uid 500); 18 Oct 2010 21:14:12 -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 11226 invoked by uid 99); 18 Oct 2010 21:14:12 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Oct 2010 21:14:12 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.160.172] (HELO mail-gy0-f172.google.com) (209.85.160.172) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Oct 2010 21:14:03 +0000 Received: by gyc15 with SMTP id 15so871232gyc.31 for ; Mon, 18 Oct 2010 14:13:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.151.10.11 with SMTP id n11mr7484306ybi.248.1287436420734; Mon, 18 Oct 2010 14:13:40 -0700 (PDT) Sender: scode@scode.org Received: by 10.150.158.20 with HTTP; Mon, 18 Oct 2010 14:13:40 -0700 (PDT) X-Originating-IP: [213.114.156.79] In-Reply-To: <316547ca-adea-e7ff-94cf-c6cd0d8c398e@me.com> References: <316547ca-adea-e7ff-94cf-c6cd0d8c398e@me.com> Date: Mon, 18 Oct 2010 23:13:40 +0200 X-Google-Sender-Auth: PV1ejDaVki9Kbd43fixEsn1u2hY Message-ID: Subject: Re: KeysCached - clarification and recommendations on settings From: Peter Schuller To: user@cassandra.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org > Is your entire keyset active? If not set a sane starting point (default f= or > key cache is 200,000=C2=A0http://wiki.apache.org/cassandra/StorageConfigu= ration=C2=A0) > =C2=A0and see what the cache hit's are like. How many keys do you have? W= hat > was=C2=A0your=C2=A0hit rate with 100% key cache? Also, keep in mind that the key cache will only eliminate one seek (finding row position in the index is exactly one seek, unless cached by the OS). Even if you dedicate your entire memory to JVM heap and fill it with key cache, you will never do better than avoiding the *one* seek per read. If your entire memory is wasted on key cache, you'll take the row seek anyway so you only eliminated at most half the overhead. In the best case, the row is cached and the key saved you from going to disk. In such a case, the key cache gave you quite a lot. But keep in mind that if your data size is such that most row reads are cached by the OS, then probably most index accesses would be too assuming the rows are significantly bigger than the index (which is normal). I'd say the key cache is most effective when your active set is small enough that a reasonably sized key cache will eliminate the majority of seeks on reads without blowing away significant amounts of memory. Especially now in 0.7 (is it backported to 0.6.x?) where the key cache is efficiently saved and re-loaded on start, giving you guaranteed hotness of the key cache. Also the bigger discrepancy between row size and key size, the more useful I would expect the key cache to be (i.e., the fatter the rows, the more useful the key cache). Ok, that was a bit unclearly stated... I'm not sure how to phrase it sensibly. I guess the bottom line is that unless you specifically know you need to and there are special circumstances, the key cache should likely not be huge in comparison to available memory. --=20 / Peter Schuller