zoukankan      html  css  js  c++  java
  • redis配置参数的热修改

    Redis使用config命令,可以对配置项参数热修改,不必重启。

    Redis最好不要重启,重启一次会引发如下问题:

    1. 如果数据很多(例如几个G),读起来很慢;
    2. 重启风险很大,Redis有内存陷阱
    3. 重启会引发读快照,读AOF文件

    使用config get * 获得所有的配置项的key

    127.0.0.1:6379> CONFIG GET *
     1) "dir"
     2) "/var/lib/redis"
     3) "dbfilename"
     4) "dump.rdb"
     5) "requirepass"
     6) (nil)
     7) "masterauth"
     8) (nil)
     9) "maxmemory"
    10) "0"
    11) "maxmemory-policy"
    12) "volatile-lru"
    13) "maxmemory-samples"
    14) "3"
    15) "timeout"
    16) "300"
    17) "appendonly"
    18) "no"
    19) "no-appendfsync-on-rewrite"
    20) "no"
    21) "appendfsync"
    22) "everysec"
    23) "save"
    24) "900 1 300 10 60 10000"
    25) "slave-serve-stale-data"
    26) "yes"
    27) "hash-max-zipmap-entries"
    28) "512"
    29) "hash-max-zipmap-value"
    30) "64"
    31) "list-max-ziplist-entries"
    32) "512"
    33) "list-max-ziplist-value"
    34) "64"
    35) "set-max-intset-entries"
    36) "512"
    37) "slowlog-log-slower-than"
    38) "10000"
    39) "slowlog-max-len"
    40) "64"
    

    更改redis持久化设置

    127.0.0.1:6379> CONFIG SET save "9000 10 3000 100 600 100000"
    OK
    

    再次查看redis配置

    127.0.0.1:6379> CONFIG GET *
     1) "dir"
     2) "/var/lib/redis"
     3) "dbfilename"
     4) "dump.rdb"
     5) "requirepass"
     6) (nil)
     7) "masterauth"
     8) (nil)
     9) "maxmemory"
    10) "0"
    11) "maxmemory-policy"
    12) "volatile-lru"
    13) "maxmemory-samples"
    14) "3"
    15) "timeout"
    16) "300"
    17) "appendonly"
    18) "no"
    19) "no-appendfsync-on-rewrite"
    20) "no"
    21) "appendfsync"
    22) "everysec"
    23) "save"
    24) "9000 10 3000 100 600 100000"
    25) "slave-serve-stale-data"
    26) "yes"
    27) "hash-max-zipmap-entries"
    28) "512"
    29) "hash-max-zipmap-value"
    30) "64"
    31) "list-max-ziplist-entries"
    32) "512"
    33) "list-max-ziplist-value"
    34) "64"
    35) "set-max-intset-entries"
    36) "512"
    37) "slowlog-log-slower-than"
    38) "10000"
    39) "slowlog-max-len"
    40) "64"
    
  • 相关阅读:
    字符串转换整数 (atoi)
    Z 字形变换
    最长回文子串
    寻找两个有序数组的中位数
    二维码QRCode
    多个线程访问url
    store procedure 翻页
    store procedure example
    使用graphics2D给图片上画字符
    procedure的over(partition by ) function
  • 原文地址:https://www.cnblogs.com/mikeguan/p/7363680.html
Copyright © 2011-2022 走看看