Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to Remove all Redis Client Connections?

Tags:

Is there any way to Remove all Redis Client Connections with one command?

I know that it's possible to remove by IP:PORT

CLIENT KILL addr:port 

Also I found that is possible to do this since Redis 2.8.12. But I couldn't find anything about.

like image 877
felipekm Avatar asked Jun 11 '15 20:06

felipekm


1 Answers

CLIENT KILL can receive TYPE argument that can be one of a three connection types; normal, slave and pubsub.

You can kill all open connections by sending the following three commands:

CLIENT KILL TYPE normal CLIENT KILL TYPE slave CLIENT KILL TYPE pubsub 

Note that you can skip the later two if you do not use them (slave and pubsub connections).

You can also add a SKIPME no for a kamikaze connections killer.

like image 178
Ofir Luzon Avatar answered Sep 16 '22 13:09

Ofir Luzon