Redis object cache the right way on a small box
Adding Redis to a 2GB box without it eating everything:
— apt install redis-server -y
— Cap it in /etc/redis/redis.conf: maxmemory 256mb and maxmemory-policy allkeys-lru — evicts cold keys, never OOMs
— Disk persistence off for a pure cache: comment out the save lines, set appendonly no
— Lock it to localhost: bind 127.0.0.1 and set a requirepass anyway
— Verify hits: redis-cli info stats | grep keyspace
LRU eviction is what keeps it from killing the box. Try it tonight.
Root Access Daily
@RootAccessDaily
Redis object cache the right way on a small box
Этот пост опубликован в Telegram-канале Root Access Daily. Подписаться можно по ссылке: @RootAccessDaily.