Skip to content

[NEW] Perform a GET without changing the idletime #11409

@alexprengere

Description

@alexprengere

First of all, let me say I love Redis! And I am really sorry if there is an obvious solution I missed.

The problem/use-case that the feature addresses

I want to run some maintenance on my Redis instance, that has a LRU eviction policy and a max memory limit.
The idea is to loop over the keys, get the values length with strlen, and evict the keys whose values have the biggest lengths.
The issue: commands like get and strlen reset the idletime, which is not great regarding the eviction policy.

Description of the feature

I would like a way to have a way to run get/strlen commands without updating the idletime. Also, perhaps something similar for "freq" when on LFU policy.

Alternatives you've considered

I don't think it is possible to manually set the idletime, but if I am wrong, then I could store the idletime before doing the get, then restore it after.

Additional information

I will use Python with redis-py to implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions