how do I kill idle redis clients

后端 未结 1 1316
滥情空心
滥情空心 2021-02-07 09:26

I want to timeout and kill idle redis clients. Is there a setting I can set to do this? I seem to remember setting a configuration somewhere but I can\'t seem to find it again

相关标签:
1条回答
  • 2021-02-07 09:51

    Have a look into the Redis configuration file (the one you use to launch Redis).

    # Close the connection after a client is idle for N seconds (0 to disable)
    timeout 0
    

    Just check the parameter is not commented out, and change the timeout parameter to put a non zero value in seconds. The instance should be restarted to take this parameter in account.

    To change this parameter on a running Redis instance, you can use a client command:

    > src/redis-cli config set timeout 10
    OK
    > src/redis-cli config get timeout
    1) "timeout"
    2) "10"
    
    0 讨论(0)
提交回复
热议问题