Redis Client Connection

Source: Internet
Author: User
Tags time in milliseconds

Redis listens to a TCP port or UNIX socket to receive connections from clients. After a connection is established, redis performs the following operations internally:

    • First, the client socket is set to non-blocking mode because redis adopts the non-blocking multiplexing model for network event processing.
    • Then set the tcp_nodelay attribute for the socket to disable the Nagle algorithm.
    • Create a readable file event to listen to the data sent from the client socket.
Max connections

In redis2.4, the maximum number of connections is directly hardcoded in the Code, and in version 2.6 this value becomes configurable.

The default value of maxclients is 10000. You can also modify this value in redis. conf.

ConfigGetMaxclients1) "Maxclients"2) "10000"
Instance

For the following instances, we set the maximum number of connections to 100000 at service startup:

 
Redis-Server--Maxclients100000
Client commands
S. N. Command Description
1 Client list Returns the list of clients connected to the redis service.
2 Client setname Set the name of the current connection
3 Client getname Obtain the service name set through the client setname command
4 Client pause Suspends a client connection, specifying the suspension time in milliseconds
5 Client kill

Redis Client Connection

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.