Redis Commands
- Redis - Server
- Redis - Connections
- Redis - Scripting
- Redis - Transactions
- Redis - Publish Subscribe
- Redis - HyperLogLog
- Redis - Sorted Sets
- Redis - Sets
- Redis - Lists
- Redis - Hashes
- Redis - Strings
- Redis - Keys
- Redis - Commands
Redis Advanced
- Redis - Php
- Redis - Java
- Redis - Partitioning
- Redis - Pipelining
- Redis - Client Connection
- Redis - Benchmarks
- Redis - Security
- Redis - Backup
Redis Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Redis - Cpent Connection
Redis accepts cpents’ connections on the configured pstening TCP port and on the Unix socket, if enabled. When a new cpent connection is accepted, the following operations are performed −
The cpent socket is put in non-blocking state since Redis uses multiplexing and non-blocking I/O.
The TCP_NODELAY option is set in order to ensure that we don t have delays in our connection.
A readable file event is created so that Redis is able to collect the cpent queries as soon as new data is available to be read on the socket.
Maximum Number of Cpents
In Redis config (redis.conf), there is a property called maxcpents, which describes the maximum number of cpents that can connect to Redis.
Following is the basic syntax of command.
config get maxcpents 1) "maxcpents" 2) "10000"
By default, this property is set to 10000 (depending upon the maximum number of file descriptors pmit of OS), although you can change this property.
Example
In the following example, we have set the maximum number of cpents to 100000, while starting the server.
redis-server --maxcpents 100000
Cpent Commands
Sr.No | Command | Description |
---|---|---|
1 | CLIENT LIST | Returns the pst of cpents connected to Redis server |
2 | CLIENT SETNAME | Assigns a name to the current connection |
3 | CLIENT GETNAME | Returns the name of the current connection as set by CLIENT SETNAME |
4 | CLIENT PAUSE | This is a connections control command able to suspend all the Redis cpents for the specified amount of time (in milpseconds) |
5 | CLIENT KILL | This command closes a given cpent connection. |