Kalyana Sundaram
Kalyana Sundaram

Reputation: 223

How do redis store data

If redis stores data as key value pair in memory, what is the size of hash table redis creates initially to store key-value pairs? Do it create a table of size equivalent to maxmemory parameter in config file?

Upvotes: 2

Views: 420

Answers (1)

Didier Spezia
Didier Spezia

Reputation: 73306

No, the size of the hash table of the main dictionary is dynamic.

The initial size is 4 entries. Then it grows to accommodate the data, following powers of 2. Growing is dynamic, so rehashing is incrementally performed in background. Expensive rehashing operations can not block a simple set command.

Upvotes: 3

Related Questions