如何限制 redis 的内存

更新日期: 2022-01-07 阅读次数: 2886 字数: 118 分类: Redis

https://redis.io/topics/lru-cache

/etc/redis.conf

maxmemory 100mb

Failed to stop redis.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files See system logs and 'systemctl status redis.service' for details.

如何查看单个进程的内存占用

redis 默认没有最大内存限制

By Default maxmemory has no limits on 64-bit redis installation and on 32-bit installation it is 3GB.

You can set/change memory limit used by redis by setting maxmemory variable in redis.conf at ,

“/etc/redis/redis.conf”

For example if you want to set it to 512mb, you need to make an entry in redis.conf , like :

maxmemory 512mb

参考

  • https://community.rtcamp.com/t/what-is-the-default-max-memory-limit-for-redis/4853
  • https://redis.io/topics/lru-cache

微信关注我哦 👍

大象工具微信公众号

我是来自山东烟台的一名开发者,有感兴趣的话题,或者软件开发需求,欢迎加微信 zhongwei 聊聊, 查看更多联系方式