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 39C879952 for ; Tue, 10 Apr 2012 16:15:12 +0000 (UTC) Received: (qmail 46489 invoked by uid 500); 10 Apr 2012 16:15:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 46461 invoked by uid 500); 10 Apr 2012 16:15:09 -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 46452 invoked by uid 99); 10 Apr 2012 16:15:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Apr 2012 16:15:09 +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 (nike.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, 10 Apr 2012 16:15:03 +0000 Received: by bkuw5 with SMTP id w5so4802837bku.31 for ; Tue, 10 Apr 2012 09:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=J7qqib2s4rBLQpr7ckwkYdZb4Ve4Gayb0Vp9DBOc4Cc=; b=U0+V1Y65PuarZDL957TfZpkGXDy7bvr1tkObVBw3Ik8wv4YTEVFo4/4s0iVwOV8uA9 QJ7119fXpIVnx7RMagmMZtXzmpU52+PmSm8RmbXat6lhiVu2LS2IZvc+UE3uAyzTGj7z yHDu+bxxQy2hUKjezvC3IhQkdyRtO20FuDHBGanpt9gRc0an7KMJuJO+Ma295hNhoZr9 OWEA/1gbKfHrJLwxc0J7MUXGWj+3e7nYaS/KTLaI4DHqh+yQ5rNV/HrKlMzDJtJZ+48I bJlqUxPnyDNt8E01wOKj9LUj+UCI9fgfNMA4MOJ4vcpDa9bOakpEEsifcmJJ/7eFp4uM lOKw== Received: by 10.204.155.69 with SMTP id r5mr4855690bkw.67.1334074483331; Tue, 10 Apr 2012 09:14:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.57.210 with HTTP; Tue, 10 Apr 2012 09:14:23 -0700 (PDT) In-Reply-To: References: From: Jonathan Ellis Date: Tue, 10 Apr 2012 11:14:23 -0500 Message-ID: Subject: Re: Why so many SSTables? To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable LCS explicitly tries to keep sstables under 5MB to minimize extra work done by compacting data that didn't really overlap across different levels. On Tue, Apr 10, 2012 at 9:24 AM, Romain HARDOUIN wrote: > > Hi, > > We are surprised by the number of files generated by Cassandra. > Our cluster consists of 9 nodes and each node handles about 35 GB. > We're using Cassandra 1.0.6 with LeveledCompactionStrategy. > We have 30 CF. > > We've got roughly 45,000 files under the keyspace directory on each node: > ls -l /var/lib/cassandra/data/OurKeyspace/ | wc -l > 44372 > > The biggest CF is spread over 38,000 files: > ls -l Documents* | wc -l > 37870 > > ls -l Documents*-Data.db | wc -l > 7586 > > Many SSTable are about 4 MB: > > 19 MB -> 1 SSTable > 12 MB -> 2 SSTables > 11 MB -> 2 SSTables > 9.2 MB -> 1 SSTable > 7.0 MB to 7.9 MB -> 6 SSTables > 6.0 MB to 6.4 MB -> 6 SSTables > 5.0 MB to 5.4 MB -> 4 SSTables > 4.0 MB to 4.7 MB -> 7139 SSTables > 3.0 MB to 3.9 MB -> 258 SSTables > 2.0 MB to 2.9 MB -> 35 SSTables > 1.0 MB to 1.9 MB -> 13 SSTables > 87 KB to =A0994 KB -> 87 SSTables > 0 KB -> 32 SSTables > > FYI here is CF information: > > ColumnFamily: Documents > =A0 Key Validation Class: org.apache.cassandra.db.marshal.BytesType > =A0 Default column value validator: org.apache.cassandra.db.marshal.Bytes= Type > =A0 Columns sorted by: org.apache.cassandra.db.marshal.BytesType > =A0 Row cache size / save period in seconds / keys to save : 0.0/0/all > =A0 Row Cache Provider: org.apache.cassandra.cache.SerializingCacheProvid= er > =A0 Key cache size / save period in seconds: 200000.0/14400 > =A0 GC grace seconds: 1728000 > =A0 Compaction min/max thresholds: 4/32 > =A0 Read repair chance: 1.0 > =A0 Replicate on write: true > =A0 Column Metadata: > =A0 =A0 Column Name: refUUID (72656655554944) > =A0 =A0 =A0 Validation Class: org.apache.cassandra.db.marshal.BytesType > =A0 =A0 =A0 Index Name: refUUID_idx > =A0 =A0 =A0 Index Type: KEYS > =A0 Compaction Strategy: > org.apache.cassandra.db.compaction.LeveledCompactionStrategy > =A0 Compression Options: > =A0 =A0 sstable_compression: org.apache.cassandra.io.compress.SnappyCompr= essor > > Is it a bug? If not, how can we tune Cassandra to avoid this? > > Regards, > > Romain --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of DataStax, the source for professional Cassandra support http://www.datastax.com