နားလည်ထားရမယ့် အချက်
`maxmemory` ပြည့်သောအခါ policy အလိုက် keys ဖယ်သို့ writes reject လုပ်ပါတယ်။ `allkeys-lru/lfu` က cache workloads၊ `volatile-*` က TTL ပါ keys သာရွေး၊ `noeviction` က writes reject လုပ်ပါတယ်။ Redis eviction သည် sampled approximation ဖြစ်ပြီး replication/AOF buffers အတွက် operating-system headroom ချန်ရပါတယ်။
လက်တွေ့ scenario နဲ့ ချိတ်ကြည့်မယ်
Dedicated catalog-cache instance တွင် `allkeys-lfu` စမ်းပြီး hit ratio၊ evicted_keys၊ latency ကို load test လုပ်မယ်။ Session instance တွင် accidental eviction မဖြစ်အောင် separate capacity/policy သတ်မှတ်မယ်။ Alert ကို used_memory/maxmemory တစ်ခုတည်းမဟုတ်ဘဲ eviction rate နဲ့ miss rate ပါထည့်မယ်။
အတူတူ စမ်းရေးကြည့်မယ်
CONFIG GET maxmemory
CONFIG GET maxmemory-policy
CONFIG SET maxmemory 2gb
CONFIG SET maxmemory-policy allkeys-lfu
INFO stats
INFO memoryConfigured ceiling၊ policy နှင့် eviction counters ကိုစစ်နိုင်မည်။၅ မိနစ် စမ်းကြည့်
Pure cache၊ session store၊ mixed workload သုံးမျိုးအတွက် policy recommendation နဲ့ reason ရေးပါ။
သတိလေးတစ်ချက်
Runtime `CONFIG SET` သာလုပ်ပြီး config/automation မပြင်လျှင် restart နောက် setting ပျောက်နိုင်ပါတယ်။
Redis — Key Eviction — Redis