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 3314D908F for ; Mon, 8 Oct 2012 19:14:53 +0000 (UTC) Received: (qmail 78713 invoked by uid 500); 8 Oct 2012 19:14:50 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 78685 invoked by uid 500); 8 Oct 2012 19:14:50 -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 78677 invoked by uid 99); 8 Oct 2012 19:14:50 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Oct 2012 19:14:50 +0000 X-ASF-Spam-Status: No, hits=-0.1 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of btalbot@aeriagames.com designates 74.125.149.250 as permitted sender) Received: from [74.125.149.250] (HELO na3sys009aog132.obsmtp.com) (74.125.149.250) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 08 Oct 2012 19:14:42 +0000 Received: from mail-vc0-f172.google.com ([209.85.220.172]) (using TLSv1) by na3sys009aob132.postini.com ([74.125.148.12]) with SMTP ID DSNKUHMmC4Okcx5achhyFwONXbgNxt1fP7Ww@postini.com; Mon, 08 Oct 2012 12:14:21 PDT Received: by mail-vc0-f172.google.com with SMTP id fl11so5630128vcb.31 for ; Mon, 08 Oct 2012 12:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aeriagames.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=GH2ATCUW13/8kG+MnENczU4f313CkT4mqn+drM61Z7U=; b=XmNWCYUuab9kzZssLUCyxwRlNXVNuHHfG8mhvwfS23T8RaIf2dnjMN/9X2zRPsKVrE tYpcH/hcyflQ0Gv+7gWjyxhYWq3OtC54AEhondOHf6/b35HnlS/pRU9Pl8wMZVm3Ce+m ujxFn3jM2JQrhc6ALNQajIppEwq1O7IgiAUno= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=GH2ATCUW13/8kG+MnENczU4f313CkT4mqn+drM61Z7U=; b=mKlEVaMiRICZiKj2gOWbv0PuXmi4TWtAeBxijyzDx0cQOVuu6tgxsl2gI1GsQ1syvQ yeUKCiuG2lQ5Koe9EdjkmaH2VI9hiZBlLZv0IEP/sY2xH1jOLGSCUIZEUY/qEdZVyMtz 51xYn/eSN/bN7VzJ8blrQbDZLD3Zuj7DzBqFiIet1QRLXiJ/vrf61vValaAy5jpJxAsf zG0pekuefEltBpMLpQQWhdVtTNRUmo1XZlVjtJNCB4kzrOuecb2CZfjG4TO+hN7LuzO/ bAA2GbNaXLBzM1bnXOXcCeOXFhCf7qHZStX1QjZsdbwLjmvdt0WB8hU7tkxZhx4ILwVk kf7g== MIME-Version: 1.0 Received: by 10.58.162.130 with SMTP id ya2mr3519633veb.2.1349723658616; Mon, 08 Oct 2012 12:14:18 -0700 (PDT) Received: by 10.58.15.195 with HTTP; Mon, 8 Oct 2012 12:14:18 -0700 (PDT) In-Reply-To: References: Date: Mon, 8 Oct 2012 12:14:18 -0700 Message-ID: Subject: Re: MBean cassandra.db.CompactionManager TotalBytesCompacted counts backwards From: Bryan Talbot To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=047d7b6766dc37812004cb910778 X-Gm-Message-State: ALoCoQn451qjSzCPE7MMGJPa4jANPX5xwHbjWCO6KqqjxMBtCqt/ppOy2KJPqacrCRew9HSJodGI --047d7b6766dc37812004cb910778 Content-Type: text/plain; charset=UTF-8 I'm attempting to plot how "busy" the node is doing compactions but there seems to only be a few metrics reported that might be suitable: CompletedTasks, PendingTasks, TotalBytesCompacted, TotalCompactionsCompleted. It's not clear to me what the difference between CompletedTasks and TotalCompactionsCompleted is but I am plotting TotalCompactionsCompleted / sec as one metric; however, this rate is nearly always less than 1 and doesn't capture how much resources are used doing the compaction. A compaction of 4 smallest SSTables counts the same as a compaction of 4 largest SSTables but the cost is hugely different. Thus, I'm also plotting TotalBytesCompacted / sec. Since the TotalBytesCompacted value sometimes moves backwards I'm not confident that it's reporting what it is meant to report. The code and comments indicate that it should only be incremented by the final size of the newly created SSTable or by the bytes-compacted-so-far for a larger compaction, so I don't see why it should be reasonable for it to sometimes decrease. How should the impact of compaction be measured if not by bytes compacted? -Bryan On Sun, Oct 7, 2012 at 7:39 AM, Edward Capriolo wrote: > I have not looked at this JMX object in a while, however the > compaction manager can support multiple threads. Also it moves from > 0-filesize each time it has to compact a set of files. > > That is more useful for showing current progress rather then lifetime > history. > > > > On Fri, Oct 5, 2012 at 7:27 PM, Bryan Talbot > wrote: > > I've recently added compaction rate (in bytes / second) to my monitors > for > > cassandra and am seeing some odd values. I wasn't expecting the values > for > > TotalBytesCompacted to sometimes decrease from one reading to the next. > It > > seems that the value should be monotonically increasing while a server is > > running -- obviously it would start again at 0 when the server is > restarted > > or if the counter rolls over (unlikely for a 64 bit long). > > > > Below are two samples taken 60 seconds apart: the value decreased by > > 2,954,369,012 between the two readings. > > > > reported_metric=[timestamp:1349476449, status:200, > > request:[mbean:org.apache.cassandra.db:type=CompactionManager, > > attribute:TotalBytesCompacted, type:read], value:7548675470069] > > > > previous_metric=[timestamp:1349476389, status:200, > > request:[mbean:org.apache.cassandra.db:type=CompactionManager, > > attribute:TotalBytesCompacted, type:read], value:7551629839081] > > > > > > I briefly looked at the code for CompactionManager and a few related > classes > > and don't see anyplace that is performing subtraction explicitly; > however, > > there are many additions of signed long values that are not validated and > > could conceivably contain a negative value thus causing the > > totalBytesCompacted to decrease. It's interesting to note that the all > of > > the differences I've seen so far are more than the overflow value of a > > signed 32 bit value. The OS (CentOS 5.7) and sun java vm (1.6.0_29) are > > both 64 bit. JNA is enabled. > > > > Is this expected and normal? If so, what is the correct interpretation > of > > this metric? I'm seeing the negatives values a few times per hour when > > reading it once every 60 seconds. > > > > -Bryan > > > -- Bryan Talbot Architect / Platform team lead, Aeria Games and Entertainment Silicon Valley | Berlin | Tokyo | Sao Paulo --047d7b6766dc37812004cb910778 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I'm attempting to plot how "busy" the node is doing compactio= ns but there seems to only be a few metrics reported that might be suitable= : CompletedTasks, PendingTasks, TotalBytesCompacted, TotalCompactionsComple= ted.

It's not clear to me what the difference between Complet= edTasks and TotalCompactionsCompleted is but I am plotting TotalCompactions= Completed / sec as one metric; however, this rate is nearly always less tha= n 1 and doesn't capture how much resources are used doing the compactio= n. =C2=A0A compaction of 4 smallest SSTables counts the same as a compactio= n of 4 largest SSTables but the cost is hugely different. =C2=A0Thus, I'= ;m also plotting TotalBytesCompacted / sec.

Since the TotalBytesCompacted value sometimes moves bac= kwards I'm not confident that it's reporting what it is meant to re= port. =C2=A0The code and comments indicate that it should only be increment= ed by the final size of the newly created SSTable or by the bytes-compacted= -so-far for a larger compaction, so I don't see why it should be reason= able for it to sometimes decrease.

How should the impact of compaction be measured if not = by bytes compacted?

-Bryan


On Sun, Oct 7, 2012 at 7:39 AM, Edward Capriolo <edlinuxguru@gmail.com> wrote:
I have not looked at this JMX object in a wh= ile, however the
compaction manager can support multiple threads. Also it moves from
0-filesize each time it has to compact a set of files.

That is more useful for showing current progress rather then lifetime histo= ry.



On Fri, Oct 5, 2012 at 7:27 PM, Bryan Talbot <btalbot@aeriagames.com> wrote:
> I've recently added compaction rate (in bytes / second) to my moni= tors for
> cassandra and am seeing some odd values. =C2=A0I wasn't expecting = the values for
> TotalBytesCompacted to sometimes decrease from one reading to the next= . =C2=A0It
> seems that the value should be monotonically increasing while a server= is
> running -- obviously it would start again at 0 when the server is rest= arted
> or if the counter rolls over (unlikely for a 64 bit long).
>
> Below are two samples taken 60 seconds apart: the value decreased by > 2,954,369,012 between the two readings.
>
> reported_metric=3D[timestamp:1349476449, status:200,
> request:[mbean:org.apache.cassandra.db:type=3DCompactionManager,
> attribute:TotalBytesCompacted, type:read], value:7548675470069]
>
> previous_metric=3D[timestamp:1349476389, status:200,
> request:[mbean:org.apache.cassandra.db:type=3DCompactionManager,
> attribute:TotalBytesCompacted, type:read], value:7551629839081]
>
>
> I briefly looked at the code for CompactionManager and a few related c= lasses
> and don't see anyplace that is performing subtraction explicitly; = however,
> there are many additions of signed long values that are not validated = and
> could conceivably contain a negative value thus causing the
> totalBytesCompacted to decrease. =C2=A0It's interesting to note th= at the all of
> the differences I've seen so far are more than the overflow value = of a
> signed 32 bit value. =C2=A0The OS (CentOS 5.7) and sun java vm (1.6.0_= 29) are
> both 64 bit. =C2=A0JNA is enabled.
>
> Is this expected and normal? =C2=A0If so, what is the correct interpre= tation of
> this metric? =C2=A0I'm seeing the negatives values a few times per= hour when
> reading it once every 60 seconds.
>
> -Bryan
>



--
= Bryan Talbot
Architect / Platform team lead, Aeria Games and Entertainm= ent
Silicon Valley | Berlin | Tokyo | Sao Paulo


--047d7b6766dc37812004cb910778--