Skip to content

Looking for suggestion for intensive write (and evict) #721

Answered by ben-manes
renyingxin asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure based on that description, so here are some random musings in case any of them strike home.

To support concurrent writes, a dedicated buffer is used so that writers don't serialize against an eviction lock. This buffer is capped to 128 * ceilingPowerOfTwo(NCPU), e.g. 1024 for an 8 core system. If populated then the cache tries to aggressively flush it. If full then writers fallback to acquiring the eviction lock, which deschedules to the thread and allows the holder to be prioritized. The thread evicting performs a batch of work by flushing the read and write buffers under the lock. Since this is a small, bounded buffer it doesn't cause runaway growth and can absorb small bur…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@renyingxin
Comment options

@ben-manes
Comment options

@ben-manes
Comment options

@renyingxin
Comment options

@ben-manes
Comment options

Answer selected by ben-manes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants