cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-8897) Remove FileCacheService, instead pooling the buffers
Date Thu, 09 Apr 2015 09:14:14 GMT


Benedict commented on CASSANDRA-8897:

bq. If we adopted increasing slab sizes how do we know when it's time to increase the size

Each time we exhaust the current slab. i.e. we allocate a 64K slab first, then a 128K, 256K,
512K, and then we stick with 512K/1Mb from then on. That said, if we impose a maximum buffer
size of 64Kb, we could stick to a fixed 64Kb "slab" that is simply sliced from a larger slab.
i.e. Our shared pool allocates slabs of 1Mb, we slice it into 64Kb chunks, and share those
chunks, thus amortizing the page alignment costs. For simplicity we want to ensure that we
have allocation slabs at least as large as our maximum buffer size though.

bq. You mean it is actually possible to implement the slicing without locks, just with an
atomic pointer? Quite possibly I guess.

Yes, and we do this already elsewhere. Here there is an issue with the differing lifetimes
of the buffers, though, and the time at which we recycle. The ThreadLocal pools solve this
problem by letting us reclaim together

bq. When the segmented file is closed or when the read command is completed?

When the read command has completed. We close all of our readers at the same time, so we can
release all of the slabs at once. Of course we could just have a counter that is decremented
on each close and relinquish them all together that way, to keep our changes isolated.

> Remove FileCacheService, instead pooling the buffers
> ----------------------------------------------------
>                 Key: CASSANDRA-8897
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Benedict
>            Assignee: Stefania
>             Fix For: 3.0
> After CASSANDRA-8893, a RAR will be a very lightweight object and will not need caching,
so we can eliminate this cache entirely. Instead we should have a pool of buffers that are

This message was sent by Atlassian JIRA

View raw message