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 50BC99820 for ; Wed, 5 Oct 2011 08:37:18 +0000 (UTC) Received: (qmail 77012 invoked by uid 500); 5 Oct 2011 08:37:16 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 76974 invoked by uid 500); 5 Oct 2011 08:37:16 -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 76966 invoked by uid 99); 5 Oct 2011 08:37:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 08:37:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a79.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2011 08:37:06 +0000 Received: from homiemail-a79.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTP id D12B47D4059 for ; Wed, 5 Oct 2011 01:36:44 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; q=dns; s=thelastpickle.com; b=y3Ncd69CD5 5dlP6hl61avGt8a5LxjSwfQVfZ781xyzTz+hAMW90JwjOrr0eplvsGaonR+xlhYI u4wT/aqHzLObXrodBAC3q92bKD1uPEZAlDrR/ffHeO74ClO8mRCKLcc7634VbP+X cJRIUwPmVeCTCQnNCmLo+nckYr9VtRZvE= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h=from :mime-version:content-type:subject:date:in-reply-to:to :references:message-id; s=thelastpickle.com; bh=VdgvZ5EoINCFPmbM +vajPYPW2ww=; b=16b/T5TY+kZ6nRmUskFV+ERm1owhGq4aG40IcEmy3H03Y632 j1WmsyGOtwJgoKvZ3a54yVFBpgP11zxHbR0jtHXKt/Dd+taSeEKezezXdc6qbDxC /3TGbpux65bWukKEeyIQN/B3+4HZR88GbcVXlBBfjRHS9HtYq4mMmzSz420= Received: from [172.16.1.4] (222-152-101-125.jetstream.xtra.co.nz [222.152.101.125]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a79.g.dreamhost.com (Postfix) with ESMTPSA id 7D6E07D4057 for ; Wed, 5 Oct 2011 01:36:42 -0700 (PDT) From: aaron morton Mime-Version: 1.0 (Apple Message framework v1244.3) Content-Type: multipart/alternative; boundary="Apple-Mail=_4CA0E36D-0E13-4FB5-AB70-5CD4D949C330" Subject: Re: Weird problem with empty CF Date: Wed, 5 Oct 2011 21:36:40 +1300 In-Reply-To: <4E8BA25F.9060103@netseer.com> To: user@cassandra.apache.org References: <4E835ADD.2020809@netseer.com> <94DC18F0-5EA0-446D-AEE3-E1505E05E157@thelastpickle.com> <4E8B3C77.5020202@netseer.com> <98D1932E-600A-49DB-B55E-93AE4B290206@thelastpickle.com> <4E8BA25F.9060103@netseer.com> Message-Id: X-Mailer: Apple Mail (2.1244.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_4CA0E36D-0E13-4FB5-AB70-5CD4D949C330 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 No.=20 It's generally only an issue with heavy delete workloads, and it's = sometimes possible to design around it.=20 cheers =20 ----------------- Aaron Morton Freelance Cassandra Developer @aaronmorton http://www.thelastpickle.com On 5/10/2011, at 1:18 PM, Daning wrote: > Thanks. Do you have plan to improve this? I think tombstone should be = separated with live data since it serves different purpose, built in = separate SSTable or indexed differently. It is pretty costly to do = filtering while reading. >=20 > Daning >=20 > On 10/04/2011 01:34 PM, aaron morton wrote: >>=20 >> I would not get gc_grace seconds to 0, set to to something small.=20 >>=20 >> gc_grace_seconds or ttl is only the minimum amount of time the column = will stay in the data files. The columns are only purged when compaction = runs some time after that timespan has ended.=20 >>=20 >> If you are seeing issues where a heavy delete workload is having an = noticeably adverse effect on read performance then you should look at = the data model. Consider ways to spread the write / read / delete = workload over multiple rows. >>=20 >> If you cannot get away from it then experiment with reducing the = min_compactioon_threshold of the CF's so that compaction kicks in = quicker, and (potentially) tombstones are purged faster.=20 >>=20 >> Chees >>=20 >> =20 >> ----------------- >> Aaron Morton >> Freelance Cassandra Developer >> @aaronmorton >> http://www.thelastpickle.com >>=20 >> On 5/10/2011, at 6:03 AM, Daning wrote: >>=20 >>> Thanks Aaron. How about I set the gc_grace_seconds to 0 or like 2 = hours? I like to clean up tomebstone sooner, I don't care losing some = data and all my columns have ttl.=20 >>>=20 >>> If one node is down longer than gc_grace_seconds, and I got = tombstone removed, once the node is up, from my understanding deleted = data will be synced back. In this case my data will be processed twice = and it will not be a big deal to me. >>>=20 >>> Thanks, >>>=20 >>> Daning >>>=20 >>>=20 >>> On 10/04/2011 01:27 AM, aaron morton wrote: >>>>=20 >>>> Yes that's the slice query skipping past the tombstone columns.=20 >>>>=20 >>>> Cheers >>>>=20 >>>> ----------------- >>>> Aaron Morton >>>> Freelance Cassandra Developer >>>> @aaronmorton >>>> http://www.thelastpickle.com >>>>=20 >>>> On 4/10/2011, at 4:24 PM, Daning Wang wrote: >>>>=20 >>>>> Lots of SliceQueryFilter in the log, is that handling tombstone? >>>>>=20 >>>>> DEBUG [ReadStage:49] 2011-10-03 20:15:07,942 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317582939743663:true:4@1317582939933000 >>>>> DEBUG [ReadStage:50] 2011-10-03 20:15:07,942 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317573253148778:true:4@1317573253354000 >>>>> DEBUG [ReadStage:43] 2011-10-03 20:15:07,942 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317669552951428:true:4@1317669553018000 >>>>> DEBUG [ReadStage:33] 2011-10-03 20:15:07,942 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317581886709261:true:4@1317581886957000 >>>>> DEBUG [ReadStage:52] 2011-10-03 20:15:07,942 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317568165152246:true:4@1317568165482000 >>>>> DEBUG [ReadStage:36] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317567265089211:true:4@1317567265405000 >>>>> DEBUG [ReadStage:53] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317674324843122:true:4@1317674324946000 >>>>> DEBUG [ReadStage:38] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317571990078721:true:4@1317571990141000 >>>>> DEBUG [ReadStage:57] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317671855234221:true:4@1317671855239000 >>>>> DEBUG [ReadStage:54] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317558305262954:true:4@1317558305337000 >>>>> DEBUG [RequestResponseStage:11] 2011-10-03 20:15:07,941 = ResponseVerbHandler.java (line 48) Processing response on a callback = from 12347@/10.210.101.104 >>>>> DEBUG [RequestResponseStage:9] 2011-10-03 20:15:07,941 = AbstractRowResolver.java (line 66) Preprocessed data response >>>>> DEBUG [RequestResponseStage:13] 2011-10-03 20:15:07,941 = AbstractRowResolver.java (line 66) Preprocessed digest response >>>>> DEBUG [ReadStage:58] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317581337972739:true:4@1317581338044000 >>>>> DEBUG [ReadStage:64] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317582656796332:true:4@1317582656970000 >>>>> DEBUG [ReadStage:55] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317569432886284:true:4@1317569432984000 >>>>> DEBUG [ReadStage:45] 2011-10-03 20:15:07,941 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317572658687019:true:4@1317572658718000 >>>>> DEBUG [ReadStage:47] 2011-10-03 20:15:07,940 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317582281617755:true:4@1317582281717000 >>>>> DEBUG [ReadStage:48] 2011-10-03 20:15:07,940 SliceQueryFilter.java = (line 123) collecting 0 of 1: 1317549607869226:true:4@1317549608118000 >>>>> DEBUG [ReadStage:34] 2011-10-03 20:15:07,940 SliceQueryFilter.java = (line 123) collecting 0 of 1:=20 >>>>> On Thu, Sep 29, 2011 at 2:17 PM, aaron morton = wrote: >>>>> As with any situation involving the un-dead, it really is the = number of Zombies, Mummies or Vampires that is the concern. =20 >>>>>=20 >>>>> If you delete data there will always be tombstones. If you have a = delete heavy workload there will be more tombstones. This is why = implementing a queue with cassandra is a bad idea. >>>>>=20 >>>>> gc_grace_seconds (and column TTL) are the *minimum* about of time = the tombstones will stay in the data files, there is no maximum.=20 >>>>>=20 >>>>> Your read performance also depends on the number of SSTables the = row is spread over, see = http://thelastpickle.com/2011/04/28/Forces-of-Write-and-Read/ >>>>>=20 >>>>> If you really wanted to purge them then yes a repair and then = major compaction would be the way to go. Also consider if it's possible = to design the data model around the problem, e.g. partitioning rows by = date. IMHO I would look to make data model changes before implementing a = compaction policy, or consider if cassandra is the right store if you = have a delete heavy workload. >>>>>=20 >>>>> Cheers >>>>>=20 >>>>> =20 >>>>> ----------------- >>>>> Aaron Morton >>>>> Freelance Cassandra Developer >>>>> @aaronmorton >>>>> http://www.thelastpickle.com >>>>>=20 >>>>> On 30/09/2011, at 3:27 AM, Daning Wang wrote: >>>>>=20 >>>>>> Jonathan/Aaron, >>>>>>=20 >>>>>> Thank you guy's reply, I will change GCGracePeriod to 1 day to = see what will happen. >>>>>>=20 >>>>>> Is there a way to purge tombstones at anytime? because if = tombstones affect performance, we want them to be purged right away, not = after GCGracePeriod. We know all the nodes are up, and we can do repair = first to make sure the consistency before purging. >>>>>>=20 >>>>>> Thanks, >>>>>>=20 >>>>>> Daning >>>>>>=20 >>>>>>=20 >>>>>> On Wed, Sep 28, 2011 at 5:22 PM, aaron morton = wrote: >>>>>> if I had to guess I would say it was spending time handling = tombstones. If you see it happen again, and are interested, turn the = logging up to DEBUG and look for messages from something starting with = "Slice" >>>>>>=20 >>>>>> Minor (automatic) compaction will, over time, purge the = tombstones. Until then reads must read discard the data deleted by the = tombstones. If you perform a big (i.e. 100k's ) delete this can reduce = performance until compaction does it's thing. >>>>>>=20 >>>>>> My second guess would be read repair (or the simple consistency = checks on read) kicking in. That would show up in the "ReadRepairStage" = in TPSTATS >>>>>>=20 >>>>>> it may have been neither of those two things, just guesses. If = you have more issues let us know and provide some more info. >>>>>>=20 >>>>>> Cheers >>>>>>=20 >>>>>>=20 >>>>>> ----------------- >>>>>> Aaron Morton >>>>>> Freelance Cassandra Developer >>>>>> @aaronmorton >>>>>> http://www.thelastpickle.com >>>>>>=20 >>>>>> On 29/09/2011, at 6:35 AM, Daning wrote: >>>>>>=20 >>>>>> > I have an app polling a few CFs (select first N * from CF), = there were data in CFs but later were deleted so CFs were empty for a = long time. I found Cassandra CPU usage was getting high to 80%, normally = it uses less than 30%. I issued the select query manually and feel the = response is slow. I have tried nodetool compact/repair for those CFs but = that does not work. later, I issue 'truncate' for all the CFs and CPU = usage gets down to 1%. >>>>>> > >>>>>> > Can somebody explain to me why I need to truncate an empty CF? = and what else I could do to bring the CPU usage down? >>>>>> > >>>>>> > I am running 0.8.6. >>>>>> > >>>>>> > Thanks, >>>>>> > >>>>>> > Daning >>>>>> > >>>>>>=20 >>>>>>=20 >>>>>=20 >>>>>=20 >>>>=20 >>>=20 >>=20 >=20 --Apple-Mail=_4CA0E36D-0E13-4FB5-AB70-5CD4D949C330 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=iso-8859-1
http://www.thelastpickle.com

On 5/10/2011, at 1:18 PM, Daning wrote:

=20 =20
Thanks.  Do you have plan to improve this? I think tombstone = should be separated with live data since it serves different purpose, built in separate SSTable or indexed differently. It is pretty costly to do filtering while reading.

Daning

On 10/04/2011 01:34 PM, aaron morton wrote:
I would not get gc_grace seconds to 0, set to to something small. 

gc_grace_seconds or ttl is only the minimum amount of time the column will stay in the data files. The columns are only purged when compaction runs some time after that timespan has ended. 

If you are seeing issues where a heavy delete workload is having an noticeably adverse effect on read performance then you should look at the data model. Consider ways to spread the write / read / delete workload over multiple rows.

If you cannot get away from it then experiment with reducing the min_compactioon_threshold of the CF's so that compaction kicks in quicker, and (potentially) tombstones are purged faster. 

Chees

 
-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton

On 5/10/2011, at 6:03 AM, Daning wrote:

Thanks = Aaron.  How about I set the gc_grace_seconds to 0 or like 2 hours? I like to clean up tomebstone sooner, I don't care losing some data and all my columns have ttl.

If one node is down longer than gc_grace_seconds, and I got tombstone removed, once the node is up, from my understanding deleted data will be synced back. In this case my data will be processed twice and it will not be a big deal to me.

Thanks,

Daning


On 10/04/2011 01:27 AM, aaron morton wrote:
Yes that's the slice query skipping past the tombstone columns. 

Cheers

-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton

On 4/10/2011, at 4:24 PM, Daning Wang = wrote:

Lots of SliceQueryFilter = in the log, is that handling tombstone?

DEBUG [ReadStage:49] 2011-10-03 20:15:07,942 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317582939743663:true:4@1317582939933000
DEBUG [ReadStage:50] 2011-10-03 20:15:07,942 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317573253148778:true:4@1317573253354000
DEBUG [ReadStage:43] 2011-10-03 20:15:07,942 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317669552951428:true:4@1317669553018000
DEBUG [ReadStage:33] 2011-10-03 20:15:07,942 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317581886709261:true:4@1317581886957000
DEBUG [ReadStage:52] 2011-10-03 20:15:07,942 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317568165152246:true:4@1317568165482000
DEBUG [ReadStage:36] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317567265089211:true:4@1317567265405000
DEBUG [ReadStage:53] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317674324843122:true:4@1317674324946000
DEBUG [ReadStage:38] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317571990078721:true:4@1317571990141000
DEBUG [ReadStage:57] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317671855234221:true:4@1317671855239000
DEBUG [ReadStage:54] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317558305262954:true:4@1317558305337000
DEBUG [RequestResponseStage:11] 2011-10-03 20:15:07,941 ResponseVerbHandler.java (line 48) Processing response on a callback from 12347@/10.210.101.104
DEBUG [RequestResponseStage:9] 2011-10-03 20:15:07,941 AbstractRowResolver.java (line 66) Preprocessed data response
DEBUG [RequestResponseStage:13] 2011-10-03 20:15:07,941 AbstractRowResolver.java (line 66) Preprocessed digest response
DEBUG [ReadStage:58] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317581337972739:true:4@1317581338044000
DEBUG [ReadStage:64] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317582656796332:true:4@1317582656970000
DEBUG [ReadStage:55] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317569432886284:true:4@1317569432984000
DEBUG [ReadStage:45] 2011-10-03 20:15:07,941 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317572658687019:true:4@1317572658718000
DEBUG [ReadStage:47] 2011-10-03 20:15:07,940 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317582281617755:true:4@1317582281717000
DEBUG [ReadStage:48] 2011-10-03 20:15:07,940 SliceQueryFilter.java (line 123) collecting 0 of 1: 1317549607869226:true:4@1317549608118000
DEBUG [ReadStage:34] 2011-10-03 20:15:07,940 SliceQueryFilter.java (line 123) collecting 0 of 1:
On Thu, Sep 29, 2011 at 2:17 PM, aaron morton <aaron@thelastpickle.com> wrote:
As with any situation involving the un-dead, it really is the number of Zombies, Mummies or Vampires that is the concern.  

If you delete data there will always be tombstones. If you have a delete heavy workload there will be more tombstones. This is why implementing a queue with cassandra is a bad idea.

gc_grace_seconds (and column TTL) are the *minimum* about of time the tombstones will stay in the data files, there is no maximum. 

Your read performance also depends on the number of SSTables the row is spread over, see http://thelastpickle.com/2011/04/28/Forces-of-Write-and-= Read/

If you really wanted to purge them then yes a repair and then major compaction would be the way to go. Also consider if it's possible to design the data model around the problem, e.g. partitioning rows by date. IMHO I would look to make data model changes before implementing a compaction policy, or consider if cassandra is the right store if you have a delete heavy workload.

Cheers

 
=
-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton

On 30/09/2011, at 3:27 AM, Daning Wang wrote:

Jonathan/Aaron,

Thank you guy's reply, I will change GCGracePeriod to 1 day to see what will happen.

Is there a way to purge tombstones at anytime? because if tombstones affect performance, we want them to be purged right away, not after GCGracePeriod. We know all the nodes are up, and we can do repair first to make sure the consistency before = purging.

Thanks,

Daning


On = Wed, Sep 28, 2011 at 5:22 PM, aaron morton <aaron@thelastpickle.com> wrote:
if I had to guess I would say it was spending time handling tombstones. If you see it happen again, and are interested, turn the logging up to DEBUG and look for messages from something starting with "Slice"

Minor (automatic) compaction will, over time, purge the tombstones. Until then reads must read discard the data deleted by the tombstones. If you perform a big (i.e. 100k's ) delete this can reduce performance until compaction does it's = thing.

My second guess would be read repair (or the simple consistency checks on read) kicking in. That would show up in the "ReadRepairStage" in TPSTATS

it may have been neither of those two things, just guesses. If you have more issues let us know and provide some more info.

Cheers


-----------------
Aaron Morton
Freelance Cassandra Developer
@aaronmorton
http://www.thelastpickle.com

On 29/09/2011, at 6:35 AM, Daning wrote:

> I have an app polling a few CFs (select first N * from CF), there were data in CFs but later were deleted so CFs were empty for a long time. I found Cassandra CPU usage was getting high to 80%, normally it uses less than 30%. I issued the select query manually and feel the response is slow. I have tried nodetool compact/repair for those CFs but that does not work. later, I issue 'truncate' for all the CFs and CPU usage gets down to 1%.
>
> Can somebody explain to me why I need to truncate an empty CF? and what else I could do to bring the CPU usage down?
>
> I am running = 0.8.6.
>
> Thanks,
>
> Daning
>









= --Apple-Mail=_4CA0E36D-0E13-4FB5-AB70-5CD4D949C330--