Skip to content

[Tech Request]: Add RSS pressure controller for memory cache target lifecycle #24664

Closed

Description

@LeftHandCold

Is there an existing issue for the same tech request?

  • I have checked the existing issues.

Does this tech request not affect user experience?

  • This tech request doesn't affect user experience.

What would you like to be added ?

Implement an RSS pressure controller for memory cache admission and eviction.

The controller should separate RSS pressure state from throttled actions:

  • Maintain explicit pressure states: none, soft, and hard.
  • Use hysteresis for state transitions:
    • none -> soft: RSS >= 85% of actual memory limit.
    • soft -> hard: RSS >= 92%.
    • hard -> soft: RSS <= 88%.
    • soft/hard -> none: RSS <= 80%.
  • Set memory cache admission target by pressure state:
    • soft: 80%.
    • hard: 50%.
  • Clear the memory cache admission target immediately when pressure exits.
  • Keep evict and debug.FreeOSMemory actions throttled by cooldown.
  • Keep the existing target TTL as a lease fallback: refresh it while pressure remains active, but do not use TTL as the primary exit mechanism.
  • Avoid stale asynchronous evict actions from restoring an old pressure target after the state has already changed.

Why is this needed ?

Step 1 and Step 2 already prevent RSS pressure from evicting objectio meta cache and keep hot/ghost data eligible for data cache admission. The remaining issue is in the control layer: the memory cache pressure target currently lives mainly by a fixed TTL, so it can continue limiting data cache admission after RSS has already returned to a safe level.

This makes cache recovery slower and can keep the data cache below its normal working set longer than necessary. A state-based controller makes pressure entry, escalation, downgrade, and exit follow the real RSS condition instead of a fixed timeout.

Additional information

This should be implemented as a focused first version. Adaptive targets, near-OOM emergency meta eviction, and cgroup memory.current based hard/near-OOM decisions can be tracked as follow-up improvements after observing the first controller behavior in nightly regression.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/tech-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions