• redis 连接数 修改


    查看:

    方法1:在redis-cli命令行使用:info clients可以查看当前的redis连接数

    127.0.0.1:6379> info clients

    Clients

    connected_clients:621
    client_longest_output_list:0
    client_biggest_input_buf:0
    blocked_clients:0
    127.0.0.1:6379>

    方法2:config get maxclients 可以查询redis允许的最大连接数

    127.0.0.1:6379> CONFIG GET maxclients
    ##1) "maxclients"
    ##2) "10000"
    127.0.0.1:6379>

    设置:

    1. 在2.6之后版本,可以修改最大连接数配置,默认10000,可以在redis.conf配置文件中修改

    ...

    maxclients 10000

    ...

    2.config set maxclients num 可以设置redis允许的最大连接数

    127.0.0.1:6379> CONFIG set maxclients 10
    OK
    127.0.0.1:6379>

    3.启动redis.service服务时加参数--maxclients 100000来设置最大连接数限制

    redis-server --maxclients 100000 -f /etc/redis.conf
    获取客户端信息命令

    CLIENT LIST 获取客户端列表

    CLIENT SETNAME 设置当前连接点redis的名称

    CLIENT GETNAME 查看当前连接的名称

    CLIENT KILL ip:port 杀死指定连接

    CLIENT LIST
    ##id=3 addr=127.0.0.1:36588 fd=5 name= age=7 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client


    CLIENT SETNAME js
    ##OK


    CLIENT LIST
    ##id=3 addr=127.0.0.1:36588 fd=5 name=js age=37 idle=0 flags=N db=0 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=32768 obl=0 oll=0 omem=0 events=r cmd=client


    CLIENT GETNAME
    ##"js"


    CLIENT KILL id 3
    ##(integer) 0


    释放超时链接配置:

    查看超时配置
    config get timeout

    设置超时配置
    config set timeout 600



    作者:达微
    链接:https://www.jianshu.com/p/390d83e3b24f
    来源:简书
    著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
  • 相关阅读:
    Python3---常见函数---super()
    Python3---常见函数---type()
    Python3---面对对象
    Python3---BeautifulSoup---节点选择器
    Python3---Beautiful Soup
    0X01应用程序黑客技术
    Python3---标准库---re
    (trie) UVA
    (trie)UVALive
    (平方分割)POJ 2104 K-th Number
  • 原文地址:https://www.cnblogs.com/lgj8/p/13385115.html
Copyright © 2020-2023  润新知