-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(eviction): Tune eviction threshold in cache mode #4142
base: main
Are you sure you want to change the base?
fix(eviction): Tune eviction threshold in cache mode #4142
Conversation
cdd7fc0
to
b5e1611
Compare
5e6c873
to
2d7dd27
Compare
@adiholden I believe I've identified the issue: I'm calculating rss_threshold for each shard individually, but the current rss_memory value is a global metric for all shards |
9bd58cc
to
fe22e03
Compare
await asyncio.sleep(1) # Wait for RSS heartbeat update | ||
|
||
# First test that eviction is not triggered without connection creation | ||
stats_info = await async_client.info("stats") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets also add a check here that used memory is below maxmemory * 0.9 and rss curr memory is below
maxmemory * rss_oom_deny_ratio * 0.9
# Increase RSS memory by 30% of max memory | ||
# We can simulate RSS increase by creating new connections | ||
# Estimate memory per connection | ||
estimated_connection_memory = 15 * 1024 # 15 KB per connection |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this test supper stable and more controlled
I would run
CONFIG SET enable_heartbeat_eviction false
before creating the connections
after that check the rss make sure its above the threshold
then run
CONFIG SET enable_heartbeat_eviction true
and after that check that rss memory dropped below the threshold and check the stats for evicted keys as you did below
fixes dragonflydb#4139 Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
Signed-off-by: Stepan Bagritsevich <[email protected]>
0097d0a
to
40d6063
Compare
fixes #4139