Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 19E5DE463 for ; Tue, 4 Dec 2012 17:45:53 +0000 (UTC) Received: (qmail 20852 invoked by uid 500); 4 Dec 2012 17:45:50 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 20808 invoked by uid 500); 4 Dec 2012 17:45:49 -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 20577 invoked by uid 99); 4 Dec 2012 17:45:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Dec 2012 17:45:39 +0000 X-ASF-Spam-Status: No, hits=0.2 required=5.0 tests=FREEMAIL_ENVFROM_END_DIGIT,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [72.30.239.213] (HELO nm40-vm5.bullet.mail.bf1.yahoo.com) (72.30.239.213) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Dec 2012 17:45:28 +0000 Received: from [98.139.214.32] by nm40.bullet.mail.bf1.yahoo.com with NNFMP; 04 Dec 2012 17:45:07 -0000 Received: from [98.139.213.7] by tm15.bullet.mail.bf1.yahoo.com with NNFMP; 04 Dec 2012 17:45:07 -0000 Received: from [127.0.0.1] by smtp107.mail.bf1.yahoo.com with NNFMP; 04 Dec 2012 17:45:07 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1354643107; bh=TwmbbKOiYpotoWN5yfPNt6smGbRrBd8qJh+g9EVX+bw=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=3EQMo1jx0yMAYHvkPAVsoAMfEy/E7K0+Nv9IpjurjCeX+y4RbaxOgy3hRYxtoG3a1o4zHRn3G7vcAm+H8t469aoOQdjCjOWoBz/+0OJ9u9DhJecW2VYkG++jGjgFpsuU/GMTqU8/BoSokAJmMTCGmVEV004VOPz5QTAjqIfWbVM= X-Yahoo-Newman-Id: 485099.34600.bm@smtp107.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 0_NfWyMVM1ntRah5qkOm7aTKOPftP3pIzUyaRfGVx5O98fZ sWvbJ9bjlA7gizhHaU5f2FtObxNfI4uTA_QI.x4nhSqe9UTt95UrpJPEch.O RIAgZJNAgDDwu3KvAlq.thGJyQN.wM9jVkqpbB_0zUURlyVpEPe7I6BC3uJp cOfXli6PbRoBtEcom1.fENKS1JtDCo.1BVh2DQNADRIuY2l5kKkRmooK0oOO ahzD1dapeW8T58a.JW4K6NaXI55JpHZe33vzXFeOEqs5Nwnftx7zxciFkSyQ KrCD4G9P8k1XehMpv8R5RYYDubRibKr6WaFgoIj5pa5xfsNvUT1Ah4NnqjDJ xUs552Zfi__XnClNgy4LX18sfurV7r6ePvgJt_oeKNyfB46QSqg6nOSLRKLn sy2Ww8gvcgbYAhMPltwfqwdUTL7hAaBNNax4mL7V5w83Bptq49LHEOlcnAPa JmH30i1TstfE- X-Yahoo-SMTP: t0UN_U2swBCFgwLIRu70LU92TrvpdQ-- Received: from [192.168.1.5] (mtheroux2@76.118.248.45 with plain) by smtp107.mail.bf1.yahoo.com with SMTP; 04 Dec 2012 09:45:07 -0800 PST Message-ID: <50BE36A4.7030504@yahoo.com> Date: Tue, 04 Dec 2012 12:45:08 -0500 From: Mike User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: user@cassandra.apache.org Subject: Re: Row caching + Wide row column family == almost crashed? References: <50BBC9C6.1050007@yahoo.com> <50BD3BD7.6020605@dehora.net> In-Reply-To: <50BD3BD7.6020605@dehora.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Thanks for all the responses! On 12/3/2012 6:55 PM, Bill de h�ra wrote: > A Cassandra JVM will generally not function well with with caches and > wide rows. Probably the most important thing to understand is Ed's > point, that the row cache caches the entire row, not just the slice > that was read out. What you've seen is almost exactly the observed > behaviour I'd expect with enabling either cache provider over wide rows. > > - the on-heap cache will result in evictions that crush the JVM > trying to manage garbage. This is also the case so if the rows have an > uneven size distribution (as small rows can push out a single large > row, large rows push out many small ones, etc). > > - the off heap cache will spend a lot of time serializing and > deserializing wide rows, such that it can increase latency relative to > just reading from disk and leverage the filesystem's cache directly. > > The cache resizing behaviour does exist to preserve the server's > memory, but it can also cause a death spiral in the on-heap case, > because a relatively smaller cache may result in data being evicted > more frequently. I've seen cases where sizing up the cache can > stabilise a server's memory. > > This isn't just a Cassandra thing, it simply happens to be very > evident with that system - generally to get an effective benefit from > a cache, the data should be contiguously sized and not too large to > allow effective cache 'lining'. > > Bill > > On 02/12/12 21:36, Mike wrote: >> Hello, >> >> We recently hit an issue within our Cassandra based application. We >> have a relatively new Column Family with some very wide rows (10's of >> thousands of columns, or more in some cases). During a periodic >> activity, we the range of columns to retrieve various pieces of >> information, a segment at a time. >> >> We do these same queries frequently at various stages of the process, >> and I thought the application could see a performance benefit from row >> caching. We have a small row cache (100MB per node) already enabled, >> and I enabled row caching on the new column family. >> >> The results were very negative. When performing range queries with a >> limit of 200 results, for a small minority of the rows in the new column >> family, performance plummeted. CPU utilization on the Cassandra node >> went through the roof, and it started chewing up memory. Some queries >> to this column family hung completely. >> >> According to the logs, we started getting frequent GCInspector >> messages. Cassandra started flushing the largest mem_tables due to >> hitting the "flush_largest_memtables_at" of 75%, and scaling back the >> key/row caches. However, to Cassandra's credit, it did not die with an >> OutOfMemory error. Its measures to emergency measures to conserve >> memory worked, and the cluster stayed up and running. No real errors >> showed in the logs, except for Messages getting drop, which I believe >> was caused by what was going on with CPU and memory. >> >> Disabling row caching on this new column family has resolved the issue >> for now, but, is there something fundamental about row caching that I am >> missing? >> >> We are running Cassandra 1.1.2 with a 6 node cluster, with a replication >> factor of 3. >> >> Thanks, >> -Mike >> >> >