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

Ben Manes commented on CASSANDRA-5661:
--------------------------------------

Weights are trivial to add and I wanted to avoid adding non-critical features 
without more details. In your patch, it appears assumed that every queue as a 
single entry with the same size buffer and privately Jonathan's description of 
the problem stated 128KB per CRAR. If the weight is constant than they are 
merely a convenience mapping as it really is the number of entries.

Uncontended CAS is cheap, short lived allocations are trivial, and Doug Lea 
describes LTQ as lower overhead than CLQ (especially under load).

The use of weak references was an easy way to avoid race conditions when 
flushing out the primary structure. It could be replaced with lazy clean-up 
passes, which is what I originally started with. At this point it seemed unwise 
to complicate things without more information so I simplified it. The number of 
queues is probably going to be quite small, on the order of dozens, so the 
reference cost in this case is quite small.

You're trying to compare approaches, which is valid but better oriented towards 
discussing with Jonathan. The challenge presented to me is as described in the 
class's JavaDoc: an multiway object pool bounded by the total number of 
entries. I took a more general approach due to not knowing the trade-offs one 
could make with context to Cassandra's behavior.
                
> Discard pooled readers for cold data
> ------------------------------------
>
>                 Key: CASSANDRA-5661
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5661
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.1
>            Reporter: Jonathan Ellis
>            Assignee: Pavel Yaskevich
>             Fix For: 1.2.7
>
>         Attachments: CASSANDRA-5661.patch, DominatorTree.png, Histogram.png
>
>
> Reader pooling was introduced in CASSANDRA-4942 but pooled 
> RandomAccessReaders are never cleaned up until the SSTableReader is closed.  
> So memory use is "the worst case simultaneous RAR we had open for this file, 
> forever."
> We should introduce a global limit on how much memory to use for RAR, and 
> evict old ones.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to