Skip to content

Added comment to maxmemory-clients conf to mention the performance issue#1840

Merged
enjoy-binbin merged 5 commits intovalkey-io:unstablefrom
enjoy-binbin:maxmemory_clients
Feb 16, 2026
Merged

Added comment to maxmemory-clients conf to mention the performance issue#1840
enjoy-binbin merged 5 commits intovalkey-io:unstablefrom
enjoy-binbin:maxmemory_clients

Conversation

@enjoy-binbin
Copy link
Member

@enjoy-binbin enjoy-binbin commented Mar 12, 2025

It's worth mentioning that enabling maxmemory-clients will affect the
performance so people can perform its own benchmark before enabling it.

This is an old top comment

The client eviction introduced in 2753429,
at that time, the main idea of our introduction was to protect key data
from being evicted, which is the server's perspective.

In fact, the accumulated client output buffer can also violate the maxmemory
contract and causing the machine to OOM.

…default

The client eviction introduced in 2753429,
at that time, the main idea of our introduction was to protect key data
from being evicted, which is the server's perspective.

In fact, the accumulated client output buffer can also violate the maxmemory
contract and causing the machine to OOM.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin enjoy-binbin added the major-decision-pending Major decision pending by TSC team label Mar 12, 2025
@codecov
Copy link

codecov bot commented Mar 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.75%. Comparing base (73838a0) to head (0975a7c).
⚠️ Report is 40 commits behind head on unstable.

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1840      +/-   ##
============================================
+ Coverage     74.69%   74.75%   +0.05%     
============================================
  Files           129      129              
  Lines         71199    71199              
============================================
+ Hits          53185    53222      +37     
+ Misses        18014    17977      -37     

see 18 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hwware
Copy link
Contributor

hwware commented Mar 12, 2025

I am not sure if 100% as default value is reasonable

Copy link
Contributor

@hpatro hpatro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't enable it by default. It cause throughput degradation (extra cpu cycle during command processing) due to constant tracking/metric update of client's input/output buffer size during read/write flow.

redis/redis#11348

@zuiderkwast
Copy link
Contributor

zuiderkwast commented Mar 31, 2025

We discussed this briefly before we released 8.0. Here is the discussion: #653 (comment).

My thoughts:

  • Clients using 100% of the configured maxmemory is very unlikely. If it happens, then we have other serious problems: It means all keys are being evicted or are already evicted, or if key eviction is disabled, we are already far over maxmemory and clients receive the OOM error.
  • I'm concerned about the performance degradation raised by @hpatro.
  • A better value would be 50% or 10% but we can't use that as the default value because it would be a breaking change. I think users who want client eviction need to configure it themselves.

@hwware
Copy link
Contributor

hwware commented Apr 1, 2025

We discussed this briefly before we released 8.0. Here is the discussion: #653 (comment).

My thoughts:

  • Clients using 100% of the configured maxmemory is very unlikely. If it happens, then we have other serious problems: It means all keys are being evicted or are already evicted, or if key eviction is disable, we are already far over maxmemory and clients receive the OOM error.
  • I'm concerned about the performance degradation raised by @hpatro.
  • A better value would be 50% or 10% but we can use that as the default value because it would be a breaking change. I think users who want client eviction need to configure it themselves.

I prefer to leave it and let client decide the default value.

@madolson
Copy link
Member

madolson commented Apr 7, 2025

Consensus from our weekly meeting was that we aren't entirely clear what problem this is trying to solve. There were concerns about folks migrating from Redis seeing different performance. So the preference was to not change the default and let users decide. This seems aligned with what other folks have said in this thread.

@enjoy-binbin enjoy-binbin removed this from Valkey 9.0 Jul 2, 2025
@enjoy-binbin enjoy-binbin changed the title Enable client eviction by default, set maxmemory-clients too 100% by default Added comment to maxmemory-clients conf to mention the performance issue Jan 30, 2026
@enjoy-binbin
Copy link
Member Author

@hpatro @zuiderkwast

I revert the change and only add the comment to mention the performance issue, please check.

Signed-off-by: Binbin <[email protected]>
@enjoy-binbin enjoy-binbin removed the major-decision-pending Major decision pending by TSC team label Jan 30, 2026
@enjoy-binbin enjoy-binbin merged commit 223bfa8 into valkey-io:unstable Feb 16, 2026
24 checks passed
@enjoy-binbin enjoy-binbin deleted the maxmemory_clients branch February 16, 2026 03:23
harrylin98 pushed a commit to harrylin98/valkey_forked that referenced this pull request Feb 19, 2026
…sue (valkey-io#1840)

It's worth mentioning that enabling `maxmemory-clients` will affect the
performance so people can perform its own benchmark before enabling it.

Signed-off-by: Binbin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants