Why should bgsave be considered when redis dict is expanded, but not when it is reduced?

  1. Why does dict try not to expand its capacity when redis is in bgsave?
  2. Why does dict not have to consider whether it is in bgsave when downsizing?
Apr.19,2022
When

1.bgsave, dict is not expanded to minimize excessive separation of memory pages, and the system needs more overhead to reclaim memory.
2.bgsave is the process of persisting data to disk, and the condition for scaling down is that the number of elements is less than 10% of the array, and does not produce too much memory fragmentation or memory separation.

Menu