zoukankan      html  css  js  c++  java
  • Redis动态配制,限内存,免重启

    一、修改redis.conf。保证下次服务器或者Redis重启仍然生效

      # maxmemory <bytes>

      # 3.03GB

      # redis-cli>info

      #           >used_memory:3254690792

      maxmemory 3254857828

      maxmemory-policy allkeys-lru

      #过期key删除选项。建议开启

      lazyfree-lazy-expire yes

      # 设为9,消耗更多CPU及时回收内存

    maxmemory-samples 9

     

    # 减少slave节点flush操作时间

    slave-lazy-flush yes

     

    # 碎片整理总开关

    activedefrag yes

     

      关闭服务:$> redis-cli shutdown

      启动:$> ./redis-server redis.conf

     
    二、动态配制生效,免重启

      # redis-cli>CONFIG SET maxmemory 3254857828

           >CONFIG SET maxmemory-policy allkeys-lru

           >CONFIG SET maxmemory-samples 9

           >config set lazyfree-lazy-expire yes

           >config set activedefrag yes

  • 相关阅读:
    利用 innodb_force_recovery 解决MySQL服务器crash无法重启问题
    MySQL-5.7复制功能的默认设置改进
    MySQL explain
    MySQL服务器参数
    MySQL参数调优
    Oracle RAC(Real Application Clusters)
    MySQL show processlist 执行状态分析
    MongoDB 高可用集群架构简介
    docker网络
    centos 7.3镜像制作
  • 原文地址:https://www.cnblogs.com/wujinhong/p/12179135.html
Copyright © 2011-2022 走看看