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 C04C3902B for ; Tue, 7 Feb 2012 18:40:58 +0000 (UTC) Received: (qmail 37304 invoked by uid 500); 7 Feb 2012 18:40:56 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 37158 invoked by uid 500); 7 Feb 2012 18:40:55 -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 37150 invoked by uid 99); 7 Feb 2012 18:40:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 18:40:55 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jbellis@gmail.com designates 209.85.214.44 as permitted sender) Received: from [209.85.214.44] (HELO mail-bk0-f44.google.com) (209.85.214.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2012 18:40:50 +0000 Received: by bkuw12 with SMTP id w12so236659bku.31 for ; Tue, 07 Feb 2012 10:40:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=8/roJA1iy4Fxth6qvAsWxWktoM47mpEdaiEgnSPovS0=; b=tEgrdBiHslf3q25Ftd7N0rEJgwpQBZkSM37b7pFRQbgrS/FveIhEMy/W1SdWLuJ0kN JO8awHa0RwLAqWpA2DHKCgylubObe4+Ofk0pV9P9wJP4+rmMvwsH9TvtBHbOmOiXZCPV ormlj3uuNFGA4M4ZkFVp4upWmhiPKNbGG0k/I= Received: by 10.204.153.27 with SMTP id i27mr11167352bkw.81.1328640029481; Tue, 07 Feb 2012 10:40:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.204.174.78 with HTTP; Tue, 7 Feb 2012 10:40:08 -0800 (PST) In-Reply-To: <4F1CE170.9080101@gmail.com> References: <4F1CE170.9080101@gmail.com> From: Jonathan Ellis Date: Tue, 7 Feb 2012 12:40:08 -0600 Message-ID: Subject: Re: Leveled Compaction Strategy; Expected number of files over time? To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable It looks like what you're seeing is, stress far outpaced the ability of compaction to keep up (which is normal for our default settings, which prioritize maintaining request throughput over compaction), so LCS will grab a bunch of L0 sstables, compact them together with L1 resulting in a spike of L1 sstables, then compact those upwards into higher levels, gradually lowering the sstable count. It's unclear how to improve the "LCS can't keep up" case [1]. But it's worth noting that a single large stress insert run, consisting as it does of a large volume of unique rows, is the worst case for LCS. This is the primary reason LCS is not the default: if you have an append-mostly write load with few overwrites or deletes, LCS will do a lot of extra i/o for no real benefit. [1] https://issues.apache.org/jira/browse/CASSANDRA-3854 On Sun, Jan 22, 2012 at 10:26 PM, Chris Burroughs wrote: > I inserted a large number of keys to a single node using stress.java [1] > and let things sit for a while (several hours with no more inserts). > After a bit I decided something might be up and started sampling the > number of files in the data directory for 250 minutes while I played The > Legend of Zelda. =A0At the start there were 78291 files, and the end > 78599. =A0All I see in the log is a lot of "Compacting to" and "Compacted= " > messages. =A0The output of compactionstatus also seemed odd: > > $ ./bin/nodetool -h localhost -p 10101 compactionstats > pending tasks: 3177 > =A0 =A0 =A0 =A0 =A0compaction type =A0 =A0 =A0 =A0keyspace =A0 column fam= ily bytes > compacted =A0 =A0 bytes total =A0progress > =A0 =A0 =A0 =A0 =A0 =A0 =A0 Compaction =A0 =A0 =A0 Keyspace1 =A0 =A0 =A0 = Standard1 > 250298718 =A0 =A0 =A0 =A0 =A0 =A0 =A0 0 =A0 =A0 =A0 n/a > > > Below is a graph showing an oscillation in the number of files. > > Is this how leveled compaction strategy is expected to behave? =A0If so, > is it ever 'done'? > > http://img836.imageshack.us/img836/7294/levelcompactionfiles.png > > [1] (ran three times) ./bin/stress -d HOST --random -l 1 -o insert -c 25 > -e ONE --average-size-values -C 100 -t 75 -n 75000000 > > with this config (dupliate options in original, but I don't think that > should matter) > > update column family Standard1 with rows_cached=3D1000000 and > keys_cached=3D0 and compaction_strategy =3D 'LeveledCompactionStrategy' a= nd > compaction_strategy_options =3D {sstable_size_in_mb:10} and > compaction_strategy_options =3D {sstable_size_in_mb:10} and > compression_options=3D{sstable_compression:SnappyCompressor, > chunk_length_kb:64} and row_cache_provider =3D > 'ConcurrentLinkedHashCacheProvider' and row_cache_keys_to_save =3D 20000 > and row_cache_save_period =3D 120; --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com