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 ABE13118EF for ; Sat, 9 Aug 2014 00:15:21 +0000 (UTC) Received: (qmail 69729 invoked by uid 500); 9 Aug 2014 00:15:19 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 69691 invoked by uid 500); 9 Aug 2014 00:15:19 -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 69678 invoked by uid 99); 9 Aug 2014 00:15:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Aug 2014 00:15:19 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_REMOTE_IMAGE X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of graham@vast.com designates 74.125.82.46 as permitted sender) Received: from [74.125.82.46] (HELO mail-wg0-f46.google.com) (74.125.82.46) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 Aug 2014 00:14:52 +0000 Received: by mail-wg0-f46.google.com with SMTP id m15so6302465wgh.5 for ; Fri, 08 Aug 2014 17:14:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:content-type:message-id:mime-version :subject:date:references:to:in-reply-to; bh=77SL0+KahloFI1DmwIUCUncs8RguG5UenqbEdeCNIJo=; b=Ppt15rplWErmiP5ZKlMK2pGKgwmWa7h9c02okTCe+aM/nbttXnH64rOIQ+S4zeVH5D tuDdzTo7bOu27WXtHXuiIdOY6KvvS2KsLJVEu96lEy+FxASPgj9r+TIrBtpLHhW0QaHR aWlRbcnFKOw6tVYK4u0BpJFQONpcGtvjp/SF5W7OnRN0wKejGU2mkPct9N2FvlXZipkq QvEgc9zrIZ7xQgcMCqCaRJMTM/2LrXh+T6dxnrUaGRZ50rZafA78Z4HIDyA8TTBw1shw uJAoEJlhLkvzOs+380I+11KNmvNRN8KCLit6zdBqhwsu1NDs5q8jxxGJ79/Yayrt3GM2 L7Og== X-Gm-Message-State: ALoCoQl49OFaVhoiifkZ4l3J6xfAxOjENumRfmFRdacBUVYsFPxefs1rY7KYvD/VplzcVdUb+LVr X-Received: by 10.180.20.40 with SMTP id k8mr2201361wie.38.1407543291604; Fri, 08 Aug 2014 17:14:51 -0700 (PDT) Received: from [192.168.1.112] (cpe-70-113-52-246.austin.res.rr.com. [70.113.52.246]) by mx.google.com with ESMTPSA id ez1sm12555706wib.15.2014.08.08.17.14.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 08 Aug 2014 17:14:50 -0700 (PDT) From: graham sanderson Content-Type: multipart/signed; boundary="Apple-Mail=_32275A3D-1DEE-4962-84D3-E8DE7C99CA8D"; protocol="application/pkcs7-signature"; micalg=sha1 Message-Id: Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: Is per-table memory overhead due to SSTables or tables? Date: Fri, 8 Aug 2014 19:14:42 -0500 References: To: user@cassandra.apache.org In-Reply-To: X-Mailer: Apple Mail (2.1878.6) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_32275A3D-1DEE-4962-84D3-E8DE7C99CA8D Content-Type: multipart/alternative; boundary="Apple-Mail=_C116CC2C-755C-4CA3-9FD9-54A2F197B280" --Apple-Mail=_C116CC2C-755C-4CA3-9FD9-54A2F197B280 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=windows-1252 See https://issues.apache.org/jira/browse/CASSANDRA-5935 2.1 has a radically different implementation that side steps this (with = off heap memtables), but if you really want lots of tables now you can = do so as a trade off against GC behavior. The problem is not SSTables per se, but more potentially one memtable = per CF (and with slab allocator that can/does cost 1M); I am not = familiar enough with the code to know when you would have 1 memtable vs = 0 memtable for a CF that isn=92t currently actively used. Note also https://issues.apache.org/jira/browse/CASSANDRA-6602 and = friends; there is definitely a need for efficient discarding of old data = in event streams. On Aug 8, 2014, at 2:29 PM, Kevin Burton wrote: > The "conventional wisdom" says that it's ideal to only use "in the low = hundreds" in the number of tables with cassandra as each table can use = 1MB or so of heap. So if you have 1000 tables you'd have 1GB of heap = used (which is no fun). >=20 > But is this an issue with the tables themselves or the SSTables? >=20 > I think the root of this is the SSTables as all the arena overhead = will be for the SSTables too and more SSTables means more overhead. >=20 > So by adding more tables, you end up with more SSTables which means = more heap memory. >=20 > If I'm in correct then this means that Cassandra could benefit from = table partitioning. Whereby you put all values in a specific region to = a specific set of tables. >=20 > So if you were storing log data, you could store it in hourly, or = daily partitions, but view the table as one logical unit. >=20 > the benefit here is that you could easily just drop the oldest data. = So if you need to clean up data, you wouldn't have to drop the whole = table, just a days worth of the data.=20 >=20 > And since that day is just one SSTable on disk, the drop would be = easy.. no tombstones, just delete the whole SSTable. >=20 >=20 >=20 > --=20 >=20 > Founder/CEO Spinn3r.com > Location: San Francisco, CA > blog: http://burtonator.wordpress.com > =85 or check out my Google+ profile >=20 >=20 --Apple-Mail=_C116CC2C-755C-4CA3-9FD9-54A2F197B280 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=windows-1252 See https://issu= es.apache.org/jira/browse/CASSANDRA-5935

2.1 has = a radically different implementation that side steps this (with off heap = memtables), but if you really want lots of tables now you can do so as a = trade off against GC behavior.

The problem is = not SSTables per se, but more potentially one memtable per CF (and with = slab allocator that can/does cost 1M); I am not familiar enough with the = code to know when you would have 1 memtable vs 0 memtable for a CF that = isn=92t currently actively used.

Note = also https://issu= es.apache.org/jira/browse/CASSANDRA-6602 and friends; there is = definitely a need for efficient discarding of old data in event = streams.


On Aug 8, 2014, at 2:29 = PM, Kevin Burton <burton@spinn3r.com> = wrote:

The "conventional wisdom" says that it's = ideal to only use "in the low hundreds" in the number of tables with = cassandra as each table can use 1MB or so of heap.  So if you have = 1000 tables you'd have 1GB of heap used (which is no fun).

But is this an issue with the tables themselves or the = SSTables?

I think the root of this is the = SSTables as all the arena overhead will be for the SSTables too and more = SSTables means more overhead.

So by adding more tables, you end up with more = SSTables which means more heap memory.

If I'm = in correct then this means that Cassandra could benefit from table = partitioning.  Whereby you put all values in a specific region to a = specific set of tables.

So if you were storing log data, you could store it = in hourly, or daily partitions, but view the table as one logical = unit.

the benefit here is that you could easily = just drop the oldest data.  So if you need to clean up data, you = wouldn't have to drop the whole table, just a days worth of the = data. 

And since that day is just one SSTable on disk, the = drop would be easy.. no tombstones, just delete the whole = SSTable.



-- =

Founder/CEO Spinn3r.com
Location: San = Francisco, CA
=85 or check out my Google+ profile


= --Apple-Mail=_C116CC2C-755C-4CA3-9FD9-54A2F197B280-- --Apple-Mail=_32275A3D-1DEE-4962-84D3-E8DE7C99CA8D Content-Disposition: attachment; filename=smime.p7s Content-Type: application/pkcs7-signature; name=smime.p7s Content-Transfer-Encoding: base64 MIAGCSqGSIb3DQEHAqCAMIACAQExCzAJBgUrDgMCGgUAMIAGCSqGSIb3DQEHAQAAoIICuzCCArcw ggIgAgIBTDANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk9SMREwDwYD VQQHEwhQb3J0bGFuZDEWMBQGA1UEChMNT21uaS1FeHBsb3JlcjEWMBQGA1UECxMNSVQgRGVwYXJ0 bWVudDEbMBkGA1UEAxMSd3d3LmNvcm5lcmNhc2UuY29tMSYwJAYJKoZIhvcNAQkBFhdibG9ja291 dEBjb3JuZXJjYXNlLmNvbTAeFw0xMTA0MDYxNjE0MzFaFw0yMTA0MDMxNjE0MzFaMIGjMQswCQYD VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5jaXNjbz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