Skip to content

Warning when maxmemory setting is wrong #429

Description

@dspezia

Hi Salvatore/Pieter,

some people have issues with maxmemory setting.
See http://stackoverflow.com/questions/9987832/redis-with-resque-and-rails-err-command-not-allowed-when-used-memory-maxmemo

There are 3 situations IMO:

  • some people don't read the documentation and think the setting is in MB or GB. So they set something like 1 byte for maxmemory in the configuration file.
  • some people try to enforce a maxmemory limit in the configuration file while they already have a dump file. The limit they set is actually smaller than the data they already have.
  • some people may try to dynamically change the maxmemory setting and set a limit which is lower than the data they already have in memory.

Currently, Redis is silent in these situations, until the first set operation.

The third situation can be a genuine one (meaning that the users may actually want to decrease the memory consumption by setting a more aggressive memory reclamation policy). However, I believe the 2 first ones are clearly mistakes from the users and should be signaled.

I think an explicit warning in the log file at Redis startup time could be helpful:

  • once the dump file is loaded (or if there is no dump file to load), check used_memory
  • if maxmemory is enforced and used_memory > maxmemory, issue a warning about the maxmemory setting

Regards,
Didier.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions