I am trying to understand what is "client list" command from redis showing me. I was of the opinion that it shows me number of clients connected to redis irrespective of commands issued from the connected clients. For e.g: If I have a webapp connected to local redis server I am hoping to see one entry for the web app when I issue "client list"
But what I saw was below: Initial connect and firing redis SetAsync (I see 2 entries different ports in addr):
id=4 addr=[::1]:56674 laddr=[::1]:6379 fd=9 name= age=16 idle=4 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1280 rbp=0 obl=0 oll=0 omem=0 tot-mem=2184 events=r cmd=set user=default redir=-1 resp=2 lib-name=SE.Redis lib-ver=2.6.122.38350
id=5 addr=[::1]:56676 laddr=[::1]:6379 fd=10 name= age=16 idle=16 flags=P db=0 sub=1 psub=0 ssub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=1984 events=r cmd=subscribe user=default redir=-1 resp=2 lib-name=SE.Redis lib-ver=2.6.122.38350
When issuing GetAsync (I see 2 entries different ports in addr):
id=4 addr=[::1]:56674 laddr=[::1]:6379 fd=9 name= age=359 idle=4 flags=N db=0 sub=0 psub=0 ssub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1280 rbp=0 obl=0 oll=0 omem=0 tot-mem=2184 events=r cmd=get user=default redir=-1 resp=2 lib-name=SE.Redis lib-ver=2.6.122.38350
id=5 addr=[::1]:56676 laddr=[::1]:6379 fd=10 name= age=359 idle=6 flags=P db=0 sub=1 psub=0 ssub=0 multi=-1 qbuf=0 qbuf-free=0 argv-mem=0 multi-mem=0 rbs=1024 rbp=0 obl=0 oll=0 omem=0 tot-mem=1984 events=r cmd=ping user=default redir=-1 resp=2 lib-name=SE.Redis lib-ver=2.6.122.38350
Why are there extra entries? Does each set or get or keyexists request open a new connection?
IDatabaseinstance represents a pool of connections to a Redis server. Within this pool, connections can be reused for multiple operations, and the library manages the connections for you. So, multipleSET,GET, orKeyExistsrequests will typically reuse connections from the connection pool rather than opening a completely new connection for each request.SET,GET, orKeyExistscan reuse connections from this pool rather than opening a new connection for each request.CLIENT LISTcommand provides information about client connections to the Redis server. Each line in the output represents a single client connection.Sample code using
setandget: