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

Andrei Dulceanu commented on OAK-6912:
--------------------------------------

[~frm], here's the output obtained when running the benchmark on both branches 
(Oak 1.6 r1793526 [0] and Oak 1.6 r1793527 [1]) with your change for 
{{SegmentCache}}:

|Oak 1.6 r1793527 (20170502)|{noformat}
# BasicWriteTest                   C     min     10%     50%     90%     max    
   N
Oak-Segment-Tar-Cold               1      59      62      66      76     918    
 824
{noformat}
{noformat}
CacheStats{hitCount=4564535, hitRate=1.00, missCount=0, missRate=0.00, 
requestCount=4564535, loadCount=0, loadSuccessCount=0, loadExceptionCount=0, 
totalLoadTime=0 min, 0 sec, averageLoadPenalty=0.00 ns, evictionCount=0, 
elementCount=26, totalWeight=4.3 MB, maxWeight=104.9 MB}
{noformat}|
|Oak 1.6 r1793526 (20170502)|{noformat}
# BasicWriteTest                   C     min     10%     50%     90%     max    
   N
Oak-Segment-Tar-Cold               1      59      62      65      73     272    
 868
{noformat}
{noformat}
CacheStats{hitCount=4802390, hitRate=1.00, missCount=0, missRate=0.00, 
requestCount=4802390, loadCount=0, loadSuccessCount=0, loadExceptionCount=0, 
totalLoadTime=0 min, 0 sec, averageLoadPenalty=0.00 ns, evictionCount=0, 
elementCount=27, totalWeight=4.5 MB, maxWeight=104.9 MB}
{noformat}|

The only difference between the two branches is the sequence of operations in 
{{SegmentCache#put}}. While r1793526, first calls {{SegmentId#loaded}} and then 
puts the segment in the cache, r1793527 does the other way round. Another thing 
that influences the numbers is the fact that the new implementation for 
{{SegmentCache#getSegment}} proposed by [~frm] loads first the segment and then 
calls {{SegmentId#loaded}}, which might explain the almost identical cache 
stats and durations recorded.

[0] 
https://github.com/dulceanu/jackrabbit-oak/tree/issues/1_6/20170502/r1793526_frm
[1] 
https://github.com/dulceanu/jackrabbit-oak/tree/issues/1_6/20170502/r1793527_frm

/cc [~mduerig]

> Cold standby performance regression due to segment caching
> ----------------------------------------------------------
>
>                 Key: OAK-6912
>                 URL: https://issues.apache.org/jira/browse/OAK-6912
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar, tarmk-standby
>    Affects Versions: 1.7.0
>            Reporter: Andrei Dulceanu
>            Assignee: Andrei Dulceanu
>              Labels: cold-standby, performance, scalability
>             Fix For: 1.8, 1.7.12
>
>
> The changes to the segment cache introduced in r1793527 [0] introduced a 
> performance regression on the primary for the case in which a standby is 
> attached to it. Below a benchmark duration comparison between primary w/o and 
> w/ standby for r1793527 (after the segment cache changes) and r1793526 
> (before the changes) :
> |Oak 1.6 r1793527 (20170502)|{noformat}
> # BasicWriteTest                   C     min     10%     50%     90%     max  
>      N
> Oak-Segment-Tar                    1      19      21      22      26     160  
>   2491
> Oak-Segment-Tar-DS                 1      56      59      63      70     181  
>    919
> Oak-Segment-Tar-Cold(Shared DS)    1      58      66     159     177     372  
>    302
> {noformat}|
> |Oak 1.6 r1793526 (20170502)|{noformat}
> # BasicWriteTest                   C     min     10%     50%     90%     max  
>      N
> Oak-Segment-Tar                    1      19      21      22      25      52  
>   2584
> Oak-Segment-Tar-DS                 1      56      60      63      69     158  
>    925
> Oak-Segment-Tar-Cold(Shared DS)    1      57      60      64      70     122  
>    915
> {noformat}|
> [0] 
> https://github.com/apache/jackrabbit-oak/commit/efafa4e1710621b7f3b8e92d0b2681669185fcd4



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to