Skip to content

Redis incremented by 0 #1094

@balous

Description

@balous

I am wondering why ratelimit can send zero increment requests to redis database.

When getHitsAddend() returns zero, for example when STOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMIT and the counter is over limit, ratelimit sends INCRBY(0) request to redis. Such a behavior is even verified by unit tests so I think this must have been made intentionally.

I'd guess that the purpose of STOP_CACHE_KEY_INCREMENT_WHEN_OVERLIMIT is to avoid unnecessary load on redis but zero increments make redis load too.

So what is the purpose? Anyone knows?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions