Skip to content

Freeing keys when at maxmemory under heavy load  #5613

@g-d-l

Description

@g-d-l

We recently had an issue where redis would needlessly free keys when at maxmemory while under heavy client load. This turned out to be because on each loop through aeMain, redis would handle many pending client GET requests with large returned value sizes. To get back below maxmemory, redis would thus free keys after each client request, even though the buffers were tmporary.

We fixed this by calling handleClientsWithPendingWrites() in processInputBuffer() to prevent this "reply backlog". Another solution would be to not include pending client output buffer memory in freeMemoryGetNotCountedMemory(), perhaps.

Curious if others have an opinion on this. Happy to submit a patch if people feel this is an actual bug.

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