English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Redis receives connections from clients by listening to a TCP port or a Unix socket. After a connection is established, Redis internally performs the following operations:
Firstly, the client socket will be set to non-blocking mode because Redis uses a non-blocking multi-threading model for network event handling.
Then set the TCP_NODELAY attribute for this socket to disable Nagle algorithm
Then create a readable file event to listen for data transmission from this client socket
In Redis2.4 In the previous version, the maximum number of connections was directly hardcoded in the code, while in2.6In this version, this value has become configurable.
The default value of maxclients is 10000, you can also modify this value in redis.conf.
config get maxclients 1) "maxclients" 2) "10000"
In the following example, we set the maximum number of connections to the service at startup 100000:
redis-server --maxclients 100000
S.N. | Command | Description |
---|---|---|
1 | CLIENT LIST | Return the list of clients connected to the redis service |
2 | CLIENT SETNAME | Set the name of the current connection |
3 | CLIENT GETNAME | Get the service name set with the CLIENT SETNAME command |
4 | CLIENT PAUSE | Suspend client connection, specify the suspension time in milliseconds |
5 | CLIENT KILL | Close Client Connection |