Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A16246655 for ; Thu, 7 Jul 2011 01:39:39 +0000 (UTC) Received: (qmail 80032 invoked by uid 500); 7 Jul 2011 01:39:39 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 79942 invoked by uid 500); 7 Jul 2011 01:39:38 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 79933 invoked by uid 99); 7 Jul 2011 01:39:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 01:39:38 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jul 2011 01:39:37 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 8D6AC46463 for ; Thu, 7 Jul 2011 01:39:16 +0000 (UTC) Date: Thu, 7 Jul 2011 01:39:16 +0000 (UTC) From: "Jonathan Ellis (JIRA)" To: commits@cassandra.apache.org Message-ID: <1342264006.5892.1310002756575.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1145962028.4084.1309961596842.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (CASSANDRA-2864) Alternative Row Cache Implementation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-2864?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13060982#comment-13060982 ] Jonathan Ellis commented on CASSANDRA-2864: ------------------------------------------- Thanks for the patch, Daniel. If I understand correctly, this is not a full row cache per se, but a sort of merge-cache for sstable data to deal with lots of overwrites (= lots of sstable fragments to merge). So a cache hit becomes "merge memtable[s] with cached value." That's an innovative solution for a problem that is causing real pain. Nice work. However, I'm reluctant to add more special cases to the read path. It looks like the CASSANDRA-2498 + CASSANDRA-2503 approach might offer similar benefits (that is, at most one -- or a configurable number of -- non-memtable version in memory), for less complexity as well as a more graceful degradation when your hot data set doesn't quite fit in memory. Since you've clearly dug into the read code path more than most, I wonder if you'd like to take a stab at that? > Alternative Row Cache Implementation > ------------------------------------ > > Key: CASSANDRA-2864 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2864 > Project: Cassandra > Issue Type: Improvement > Components: Core > Affects Versions: 0.8.1 > Reporter: Daniel Doubleday > Priority: Minor > Attachments: rowcache.patch > > > we have been working on an alternative implementation to the existing row cache(s) > We have 2 main goals: > - Decrease memory -> get more rows in the cache without suffering a huge performance penalty > - Reduce gc pressure > This sounds a lot like we should be using the new serializing cache in 0.8. > Unfortunately our workload consists of loads of updates which would invalidate the cache all the time. > The second unfortunate thing is that the idea we came up with doesn't fit the new cache provider api... > It looks like this: > Like the serializing cache we basically only cache the serialized byte buffer. we don't serialize the bloom filter and try to do some other minor compression tricks (var ints etc not done yet). The main difference is that we don't deserialize but use the normal sstable iterators and filters as in the regular uncached case. > So the read path looks like this: > return filter.collectCollatedColumns(memtable iter, cached row iter) > The write path is not affected. It does not update the cache > During flush we merge all memtable updates with the cached rows. > The attached patch is based on 0.8 branch r1143352 > It does not replace the existing row cache but sits aside it. Theres environment switch to choose the implementation. This way it is easy to benchmark performance differences. > -DuseSSTableCache=true enables the alternative cache. It shares its configuration with the standard row cache. So the cache capacity is shared. > We have duplicated a fair amount of code. First we actually refactored the existing sstable filter / reader but than decided to minimize dependencies. Also this way it is easy to customize serialization for in memory sstable rows. > We have also experimented a little with compaction but since this task at this stage is mainly to kick off discussion we wanted to keep things simple. But there is certainly room for optimizations. -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira