-
Notifications
You must be signed in to change notification settings - Fork 959
Description
From Memory Overhead comparison #1835 (comment)
We can see memory efficiency makes great improvement in Valkey, but there is still a lot of work to be done in memory management and memory information extraction.
Feature Proposal 1: Add Keysizes section in INFO command output
Keysizes, this is the new section from INFO command output from Redis 8. This section reports a per-database, per-type histogram of key sizes. It provides insights into how many keys fall into specific size ranges.
Example:
Keysizes
db0_distrib_strings_sizes:4=1
db0_distrib_lists_items:2=1
db0_distrib_sets_items:2=1
db0_distrib_zsets_items:2=1,4=1
db0_distrib_hashes_items:2=1
Feature Proposal 2: Add bigkeys and hotkeys as new built-in command
valkey-cli support hotkeys and bigkeys options, however the usage is limited. For hotkeys option, it has at least 3 disadvantages: 1. it is not a built-in command 2. It only works with maxmemory-policy LFU so far, 3. User can not specify the access frequency for keys. For bigkeys option, it has at least 2 disadvantages as hotkeys: 1. it is not a built-in command. 2. User has no way to set big key size during runtime.
Feature Proposal 3: Add maxmemory-dataset in the valkey.conf
The discuss #831 and #1792 raise a thought to reconsider when the key eviction processes should begin. Now if user sets the maxmemory policy, the number of keys in memory could be less than it should be if key eviction is trigger, the reason is the CIB and COB could occupy more memory than user expects.
Feature Proposal 4: Automatically Slot Migration
If we have metrics for hotkey and hotslot in cluster mode, it is possible to implement the slot migration automatically to balance the user request among the nodes
Ref:
Feature to find bigkeys #1827
More refined memory management system #1792
Add maxmemory-reserved parameter for evicting key earlier to avoid OOM #831
Ability to accurately predict database size #940
Introduce slot-level memory metrics #852
Replication Flow Control – Prioritizing replication traffic in the replica #1838