Managing clients
Generally speaking, Redis is a TCP server using the client-server model. Thus, it's of great importance for the Redis administrators to manage the clients connected to Redis Server. In this recipe, we will start by introducing how to collect the global information of the Redis instance and, then, we will go through how to list and kill the Redis clients from server side. Some important configuration options will also be shown.
Getting ready…
You need to finish setting up the replication of Redis Server as we described in the Setting up Redis replication recipe in Chapter 5, Replication.
How to do it...
The operations for managing clients are as follows:
- For demonstration purposes, start two
redis-benchmark
processes first:
bin$ nohup ./redis-benchmark -c 5 -n 100000 -r 1000 -d 1000 & bin$ nohup ./redis-benchmark -c 5 -n 100000 -r 1000 -d 1000 &
- In addition, issue the
BLPOP
command usingbin/redis-cli
, as follows:
$ bin/redis-cli BRPOP job_queue 0
- To collect the overall client...