Redis accepts connections on the configured listener TCP port and UNIX socket client, if enabled. When a new client connection is accepted, the following actions are performed:
Client sockets are placed in a non-blocking state because Redis uses multiplexing and non-blocking I/O operations.
The Tcp_nodelay option is set to ensure that we do not have a connection delay.
When creating a readable file, Redis is able to collect the client's query as soon as the new data is available for reading in the socket.
Maximum number of clients
The Redis configuration (redis.conf) property calls MaxClients, which describes the maximum number of clients that can connect to Redis. The basic syntax of the command is:
Config get maxclients1) "MaxClients" 2) "10000"
By default, this property is set to 10000 (which depends on the maximum number of file descriptor limits for the operating system), but you can change this property.
Example
In the example given below, we set the maximum number of clients to 100,000 when starting the server
Redis-server--maxclients 100000
Client commands
S.N. |
Command |
Description |
1 |
CLIENT LIST |
Returns the list of clients connected to the Redis server |
2 |
CLIENT SETNAME |
Specifies the name of the current connection |
3 |
CLIENT GETNAME |
Returns the name of the current connection set by client SetName. |
4 |
CLIENT PAUSE |
This is a connection control command that can pause the amount of time (in milliseconds) specified by all Redis customers. |
5 |
CLIENT KILL |
This command closes a specific client connection. |
Article reprinted from: Yi Hundred tutorials [http:/www.yiibai.com]
This article title: Redis client Connections
This address: http://www.yiibai.com/redis/redis_client_connection.html
Redis Client Connections