26

How many total connections are or max how many connections are present in redis ?

How many connections are busy ?

How many connections are free waiting for the requests ?

which commands or configuration i need see to answer above questions ?

Am asking total / max connections not clients

2 Answers 2

44

Clients ARE connections. Redis doesn't know if two connections are from the same client.

Current

info clients

# Clients
connected_clients:2
client_longest_output_list:0
client_biggest_input_buf:0
blocked_clients:0

Maximum

config get maxclients

1) "maxclients"
2) "4064"

If you want to change maxclients, you may do so in conf file, or at runtime with the command config set maxclients <val>, but note that this value is limited by available file descriptors, so run appropriate ulimit -n <val> before.

3
  • so , config get maxclients , is giving 10000 as return value , means maximum 10000 connections are available in redis server , and info clients is giving connected_clients as 35 , means 35 total connections are being used at present , can you please confirm my interpretation ?
    – Bravo
    Jul 26, 2018 at 15:15
  • When I ran the config command in redis-cli, I got this error (error) ERR unknown command 'config', with args beginning with: 'get', 'maxclients'. Is config still available? Aug 12, 2020 at 0:57
  • 4
    Oh, I think it is because my redis server is hosted by ElasticCache. It does not expose the config command. Aug 12, 2020 at 1:07
6

As of writing this in Redis 2.6 the default limit is 10000 clients but can be over-ridden in the redis.conf

If the number that we require is more than the maximum number of file descriptors that can be opened by the File System, then REDIS sets the maximum number of clients/connections to what it can realistically handle.

Read more about it here

1
  • Good catch with the file descriptor limit!
    – Imaskar
    Apr 11, 2021 at 1:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.