[ 
https://issues.apache.org/jira/browse/CASSANDRA-14281?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16426980#comment-16426980
 ] 

ASF GitHub Bot commented on CASSANDRA-14281:
--------------------------------------------

GitHub user burmanm opened a pull request:

    https://github.com/apache/cassandra/pull/217

    CASSANDRA-14281

    Remove locking from DEHR and use CAS update operation in rescaling to 
improve performance
    
    Add method to combine two Snapshots
    
    Use LongAdder[] instead of AtomicLongArray to reduce contention
    
    Read metrics from children LatencyMetrics instances when needed, instead of 
writing to parent instances each time.
    
    Add benchmark for LatencyMetrics and Reservoir
    
    When child is released, it replicates previous status to parents

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/burmanm/cassandra latency_metrics

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cassandra/pull/217.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #217
    
----
commit 98ad2320e6c28bcfd7afc6a7f2bf25b640bc957a
Author: Michael Burman <yak@...>
Date:   2018-03-01T12:59:53Z

    Remove locking from DEHR and use CAS update operation in rescaling to 
improve performance
    
    Add method to combine two Snapshots
    
    Use LongAdder[] instead of AtomicLongArray to reduce contention
    
    Read metrics from children LatencyMetrics instances when needed, instead of 
writing to parent instances each time.
    
    Add benchmark for LatencyMetrics and Reservoir
    
    When child is released, it replicates previous status to parents

----


> Improve LatencyMetrics performance by reducing write path processing
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-14281
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14281
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Michael Burman
>            Assignee: Michael Burman
>            Priority: Major
>
> Currently for each write/read/rangequery/CAS touching the CFS we write a 
> latency metric which takes a lot of processing time (up to 66% of the total 
> processing time if the update was empty). 
> The way latencies are recorded is to use both a dropwizard "Timer" as well as 
> "Counter". Latter is used for totalLatency and the previous is decaying 
> metric for rates and certain percentile metrics. We then replicate all of 
> these CFS writes to the KeyspaceMetrics and globalWriteLatencies. 
> Instead of doing this on the write phase we should merge the metrics when 
> they're read. This is much less common occurrence and thus we save a lot of 
> CPU time in total. This also speeds up the write path.
> Currently, the DecayingEstimatedHistogramReservoir acquires a lock for each 
> update operation, which causes a contention if there are more than one thread 
> updating the histogram. This impacts scalability when using larger machines. 
> We should make it lock-free as much as possible and also avoid a single 
> CAS-update from blocking all the concurrent threads from making an update.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to