You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Alain RODRIGUEZ <ar...@gmail.com> on 2011/12/14 17:29:00 UTC

Counters != Counts

Hi everybody.

I'm using a lot of counters to make statistics on a 4 nodes cluster (ec2
m1.small) with phpcassa (cassandra v1.0.2).

I store some events and increment counters at the same time.

Counters give me over-counts compared with the count of every corresponding
events.

I sure that my non-counters counts are good.

I'm not sure why these over-counts happen, but I heard that recovering from
commitlogs can produce this.
I have some timeouts on phpcassa which are written in my apache logs while
a compaction is running. However I am always able to write at Quorum, so I
guess I shouldn't have to recover from cassandra commitlogs.

Where can these over-counts come from ?

Alain

Re: Counters != Counts

Posted by aaron morton <aa...@thelastpickle.com>.
Yes you can do a rolling restart. For more info on the counters architecture see the presentation here 
http://www.datastax.com/events/cassandrasf2011/presentations

Cheers

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

On 20/12/2011, at 10:10 PM, Alain RODRIGUEZ wrote:

> By the way, I wonder if a rolling restart is still possible when I am using counters ? Don't we lose the SPOF too, considering that counters are wrong every time we retry to write them with the client ?
> 
> 
> 2011/12/16 Alain RODRIGUEZ <ar...@gmail.com>
> Can we have a hope that counters will be replayed as safely as a classical data someday ? Do someone still work on jiras like issues.apache.org/jira/browse/CASSANDRA-2495 ? I thought that replaying a write from the client didn't lead to over-counts contrary to the internal cassandra replay from commitlog.
> 
> I just made a new connection pool with retries / 2 and timeouts * 4. I hope it will improve the accuracy of my counters.
> 
> Anyways, thank you for answering that fast.
> 
> Alain 
> 
> 2011/12/16 Tyler Hobbs <ty...@datastax.com>
> Probably quite a few of them are coming from automatic retries by phpcassa.  When working with counters, I recommend minimizing retries and/or increasing timeouts.  Usually this means you want to use a separate connection pool with different settings just for counters.
> 
> By the way, this advice applies to other clients as well.
> 
> 
> On Wed, Dec 14, 2011 at 10:29 AM, Alain RODRIGUEZ <ar...@gmail.com> wrote:
> Hi everybody.
> 
> I'm using a lot of counters to make statistics on a 4 nodes cluster (ec2 m1.small) with phpcassa (cassandra v1.0.2).
> 
> I store some events and increment counters at the same time.
> 
> Counters give me over-counts compared with the count of every corresponding events.
> 
> I sure that my non-counters counts are good.
> 
> I'm not sure why these over-counts happen, but I heard that recovering from commitlogs can produce this.
> I have some timeouts on phpcassa which are written in my apache logs while a compaction is running. However I am always able to write at Quorum, so I guess I shouldn't have to recover from cassandra commitlogs. 
> 
> Where can these over-counts come from ?
> 
> Alain
>  
> 
> 
> 
> -- 
> Tyler Hobbs
> DataStax
> 
> 
> 


Re: Counters != Counts

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
By the way, I wonder if a rolling restart is still possible when I am using
counters ? Don't we lose the SPOF too, considering that counters are wrong
every time we retry to write them with the client ?


2011/12/16 Alain RODRIGUEZ <ar...@gmail.com>

> Can we have a hope that counters will be replayed as safely as a classical
> data someday ? Do someone still work on jiras like
> issues.apache.org/jira/browse/CASSANDRA-2495 ? I thought that replaying a
> write from the client didn't lead to over-counts contrary to the internal
> cassandra replay from commitlog.
>
> I just made a new connection pool with retries / 2 and timeouts * 4. I
> hope it will improve the accuracy of my counters.
>
> Anyways, thank you for answering that fast.
>
> Alain
>
> 2011/12/16 Tyler Hobbs <ty...@datastax.com>
>
>> Probably quite a few of them are coming from automatic retries by
>> phpcassa.  When working with counters, I recommend minimizing retries
>> and/or increasing timeouts.  Usually this means you want to use a separate
>> connection pool with different settings just for counters.
>>
>> By the way, this advice applies to other clients as well.
>>
>>
>> On Wed, Dec 14, 2011 at 10:29 AM, Alain RODRIGUEZ <ar...@gmail.com>wrote:
>>
>>> Hi everybody.
>>>
>>> I'm using a lot of counters to make statistics on a 4 nodes cluster (ec2
>>> m1.small) with phpcassa (cassandra v1.0.2).
>>>
>>> I store some events and increment counters at the same time.
>>>
>>> Counters give me over-counts compared with the count of every
>>> corresponding events.
>>>
>>> I sure that my non-counters counts are good.
>>>
>>> I'm not sure why these over-counts happen, but I heard that recovering
>>> from commitlogs can produce this.
>>> I have some timeouts on phpcassa which are written in my apache logs
>>> while a compaction is running. However I am always able to write at Quorum,
>>> so I guess I shouldn't have to recover from cassandra commitlogs.
>>>
>>> Where can these over-counts come from ?
>>>
>>> Alain
>>>
>>>
>>
>>
>>
>> --
>> Tyler Hobbs
>> DataStax <http://datastax.com/>
>>
>>
>

Re: Counters != Counts

Posted by Alain RODRIGUEZ <ar...@gmail.com>.
Can we have a hope that counters will be replayed as safely as a classical
data someday ? Do someone still work on jiras like
issues.apache.org/jira/browse/CASSANDRA-2495 ? I thought that replaying a
write from the client didn't lead to over-counts contrary to the internal
cassandra replay from commitlog.

I just made a new connection pool with retries / 2 and timeouts * 4. I hope
it will improve the accuracy of my counters.

Anyways, thank you for answering that fast.

Alain

2011/12/16 Tyler Hobbs <ty...@datastax.com>

> Probably quite a few of them are coming from automatic retries by
> phpcassa.  When working with counters, I recommend minimizing retries
> and/or increasing timeouts.  Usually this means you want to use a separate
> connection pool with different settings just for counters.
>
> By the way, this advice applies to other clients as well.
>
>
> On Wed, Dec 14, 2011 at 10:29 AM, Alain RODRIGUEZ <ar...@gmail.com>wrote:
>
>> Hi everybody.
>>
>> I'm using a lot of counters to make statistics on a 4 nodes cluster (ec2
>> m1.small) with phpcassa (cassandra v1.0.2).
>>
>> I store some events and increment counters at the same time.
>>
>> Counters give me over-counts compared with the count of every
>> corresponding events.
>>
>> I sure that my non-counters counts are good.
>>
>> I'm not sure why these over-counts happen, but I heard that recovering
>> from commitlogs can produce this.
>> I have some timeouts on phpcassa which are written in my apache logs
>> while a compaction is running. However I am always able to write at Quorum,
>> so I guess I shouldn't have to recover from cassandra commitlogs.
>>
>> Where can these over-counts come from ?
>>
>> Alain
>>
>>
>
>
>
> --
> Tyler Hobbs
> DataStax <http://datastax.com/>
>
>

Re: Counters != Counts

Posted by Tyler Hobbs <ty...@datastax.com>.
Probably quite a few of them are coming from automatic retries by
phpcassa.  When working with counters, I recommend minimizing retries
and/or increasing timeouts.  Usually this means you want to use a separate
connection pool with different settings just for counters.

By the way, this advice applies to other clients as well.

On Wed, Dec 14, 2011 at 10:29 AM, Alain RODRIGUEZ <ar...@gmail.com>wrote:

> Hi everybody.
>
> I'm using a lot of counters to make statistics on a 4 nodes cluster (ec2
> m1.small) with phpcassa (cassandra v1.0.2).
>
> I store some events and increment counters at the same time.
>
> Counters give me over-counts compared with the count of every
> corresponding events.
>
> I sure that my non-counters counts are good.
>
> I'm not sure why these over-counts happen, but I heard that recovering
> from commitlogs can produce this.
> I have some timeouts on phpcassa which are written in my apache logs while
> a compaction is running. However I am always able to write at Quorum, so I
> guess I shouldn't have to recover from cassandra commitlogs.
>
> Where can these over-counts come from ?
>
> Alain
>
>



-- 
Tyler Hobbs
DataStax <http://datastax.com/>