နားလည်ထားရမယ့် အချက်
Redis capacity သည် raw payload size ထက် object overhead၊ allocator fragmentation၊ replication/persistence buffers များပါထည့်တွက်ရပါတယ်။ Big key က value/member count ကြီးပြီး command latency၊ deletion၊ network transfer ကိုထိခိုက်စေပါတယ်။ Hot key က traffic အများစု key တစ်ခုထဲကျသဖြင့် shard တစ်ခုကို overload ဖြစ်စေပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
`INFO memory`၊ `MEMORY STATS`၊ sampled `MEMORY USAGE` နဲ့ baseline ဆောက်မယ်။ `redis-cli --bigkeys` ကို production-safe scan settings ဖြင့် run၊ hot-key sampling ကို LFU policy နဲ့စစ်မယ်။ Large collections ကို time bucket/smaller keys ခွဲပြီး unlink/asynchronous deletion စဉ်းစားမယ်။
အတူတူ စမ်းရေးကြည့်မယ်
INFO memory
MEMORY STATS
MEMORY USAGE tutorial:42 SAMPLES 5
OBJECT ENCODING tutorial:42
UNLINK obsolete:large:key
# redis-cli --scan --pattern 'tutorial:*'
# redis-cli --bigkeysMemory baseline နှင့် oversized key candidates စာရင်းရမည်။၅ မိနစ် စမ်းကြည့်
2 KB average keys 5 million အတွက် 30% overhead + 20% headroom capacity estimate လုပ်ပါ။
သတိလေးတစ်ချက်
Production တွင် full keyspace ကို aggressive scan သို့ `KEYS *` မလုပ်ပါနှင့်။ Sampling နဲ့ off-peak scan သုံးပါ။
Redis — Memory Optimization — Redis