thanks for you response.

@Ryan Svihla,yeah you are right,there will be a ttl.only store most recent
data.

@Chris
good idea on getting the  instantaneous  cross-datacenter latency.but seems
still have issues.
1.based on application insert/update record,not a regular generate
record.once the network between application server and cassandra is bad,
cannot capture the latency value,because casssandra dont know it is the
reason that application have not sent record.or request fail because of the
large latency.

2.as you suggested,it seems that cannot get the latency at a certain time
in recent.
network latency always stable,but when workload are heavy and replication
cross datacenter need to wait.and it will increase cross-datacenter latency.
so may be there is a large difference between this minute and next minute

stone

On Mon, Aug 8, 2016 at 9:10 PM, Chris Lohfink <clohfin...@gmail.com> wrote:

> If you invoke the values operation on the mbean every minute (or whatever
> period) you can get a histogram of the cross dc the latencies. Just keep
> track of the values of each bin in histogram and look at the delta from
> previous time to the current time to find how many latencies occurred in
> each bins range during the period.
>
> Also can wait for CASSANDRA-11752
> <https://issues.apache.org/jira/browse/CASSANDRA-11752> for the a
> "recent" histogram (although would need to apply it to this histogram as
> well).
>
> Chris Lohfink
>
> On Mon, Aug 8, 2016 at 8:50 AM, Ryan Svihla <r...@foundev.pro> wrote:
>
>> The first issue I can think of is the Latency table, if I understand you
>> correctly, has an unbounded size for the partition key of DC and will over
>> time just get larger as more measurements are recorded.
>>
>> Regards,
>>
>> Ryan Svihla
>>
>> On Aug 8, 2016, at 2:58 AM, Stone Fang <cnstonef...@gmail.com> wrote:
>>
>> *objective*:get cassandra cross-datacenter latency in time
>>
>> *existing ticket:*
>>
>> there is a ticket [track cross-datacenter latency](https://issues.apache
>> .org/jira/browse/CASSANDRA-11569)
>> but it is a statistics value from node starting,i want to get the
>> instantaneous value in a certain time.
>>
>> *thought*
>>
>> want to write a message into **MESSAGE TABLE** in 1s timer task(the
>> period is similar to most of cross datacenter latency )
>> ,and replicate to other datacenter,there will be a delay.and I capture
>> it,and write to **LATENCY TABLE**.i can query the latency value from this
>> table with the condition of certain time.
>>
>> *schema*
>>
>> message table for replicating data cross datacenter
>>
>>
>>     create keyspace heartbeat with replication=
>>     {'class':'NetworkTopologyStrategy','dc1':1, 'dc2':1...};
>>
>>
>>
>>      CREATE TABLE HEARTBEAT.MESSAGE{
>>             CREATED TIMESTAMP,
>>             FROMDC VARCHAR,
>>             PRIMARY KEY(CREATED,FROMDC)
>>         }
>>
>> latency Table for querying latency value
>>
>>      CREATE TABLE SYSTEM.LATENCY{
>>          FROMDC VARCHAR,
>>          ARRIVED TIMESTAMP,
>>          CREATED TIMESTAMP,
>>          LANTENCY BIGINT
>>          PRIMARY KEY(FROMDC,ARRIVED)
>>         }WITH CLUSTERING ORDER BY(ARRIVED DESC);
>>
>> problems
>>
>> 1.can this solution work to get the cross-datacenter latency?
>>
>>
>> 2.create heartbeat keyspace in cassandra bootstrap process,i need to load
>> Heartbeat keyspace in Scheam.java.and save this keyspace into SystemSchema.
>> also need to check if this keyspace has exist after first node start.so i
>> think this is not a good solution.
>>
>> 3.compared to 1,try another solution.generate heartbeat message in a
>> standalone jar.but always i need to capture heartbeat message mutation in
>> cassandra.so i need to check if the mutation is about heartbeat message.and
>> it seems strange that check the heartbeat keyspace which is not defined in
>> cassandra,but third-party.
>>
>> hope to see your thought on this.
>> thanks
>> stone
>>
>>
>

Reply via email to