[
https://issues.apache.org/jira/browse/CASSANDRA-5863?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15206459#comment-15206459
]
Branimir Lambov commented on CASSANDRA-5863:
--------------------------------------------
Updated patch here:
|[code|https://github.com/blambov/cassandra/tree/5863-page-cache-4-rebase]|[utest|http://cassci.datastax.com/job/blambov-5863-page-cache-4-rebase-testall/]|[dtest|http://cassci.datastax.com/job/blambov-5863-page-cache-4-rebase-dtest/]|[cstar_perf|http://cstar.datastax.com/tests/id/9d46f64a-f003-11e5-9527-0256e416528f]|
The new version takes care of the eviction issue, adds metrics (misses,
requests, hit ratio, latency of read after a miss), refactors a bit more to
reduce the number of extra objects and clarify the code, and adds a
single-threaded fixed-seed benchmark (mostly taken from CASSANDRA-7019) that
clearly shows the effects, includes scans and compactions to highlight LRU
weaknesses, and should be more responsive to smaller changes in how the actual
caching is done.
The code still uses Guava's {{LoadingCache}}, experiments with other solutions
and a custom implementation will come next.
{{cstar_perf}} above clearly shows benefits. Data from a run of the included
{{CachingBench}} is shown below; it also demonstrates significant benefits,
also for uncompressed data:
{code}
Reader RandomAccessReader:CachingRebufferer:MmapRebufferer(... LZ4Compressor,
chunk length 65536)
Cache size 480 MB requests 16,434,534 hit ratio 0.846705
Operations completed in 442.415s
Reader RandomAccessReader:CachingRebufferer:StandardRebufferer(...
LZ4Compressor, chunk length 65536)
Cache size 480 MB requests 16,439,112 hit ratio 0.846770
Operations completed in 471.663s
Reader RandomAccessReader:BufferManagingRebufferer.Aligned:MmapRebufferer(...
LZ4Compressor, chunk length 65536)
Cache disabled
Operations completed in 703.370s
Reader
RandomAccessReader:BufferManagingRebufferer.Aligned:StandardRebufferer(...
LZ4Compressor, chunk length 65536)
Cache disabled
Operations completed in 847.063s
Reader RandomAccessReader:CachingRebufferer:SimpleReadRebufferer(... chunk
length 12288)
Cache size 479.88 MB requests 17,125,696 hit ratio 0.851649
Operations completed in 450.076s
Reader
RandomAccessReader:BufferManagingRebufferer.Unaligned:SimpleReadRebufferer(...
chunk length 12288)
Cache disabled
Operations completed in 564.559s
Reader RandomAccessReader:MmapRebufferer(...)
Cache disabled
Operations completed in 403.994s
{code}
> In process (uncompressed) page cache
> ------------------------------------
>
> Key: CASSANDRA-5863
> URL: https://issues.apache.org/jira/browse/CASSANDRA-5863
> Project: Cassandra
> Issue Type: Sub-task
> Reporter: T Jake Luciani
> Assignee: Branimir Lambov
> Labels: performance
> Fix For: 3.x
>
>
> Currently, for every read, the CRAR reads each compressed chunk into a
> byte[], sends it to ICompressor, gets back another byte[] and verifies a
> checksum.
> This process is where the majority of time is spent in a read request.
> Before compression, we would have zero-copy of data and could respond
> directly from the page-cache.
> It would be useful to have some kind of Chunk cache that could speed up this
> process for hot data, possibly off heap.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)