Redis Client Connections

Source: Internet
Author: User
Tags time in milliseconds

Redis receives a connection from a client by listening to a TCP port or a Unix socket, and when a connection is established, the following actions are performed within Redis:

    • First, the client socket is set to non-blocking mode because Redis uses a non-blocking multiplexing model for network event processing.
    • Then set the Tcp_nodelay property for this socket, disable the Nagle algorithm
    • Then create a readable file event to listen to the data sent by this client socket
Maximum number of 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 for MaxClients is 10000, and you can modify the value in redis.conf.

    1. Config get maxclients
    2. 1) "maxclients"
    3. 2) "10000"
Instance

The following example sets the maximum number of connections to 100000 when the service starts:

    1. Redis-Server --maxclients 100000
Client commands
S.N. Command Description
1 CLIENT LIST Returns a list of clients connected to the Redis service
2 CLIENT SETNAME Set the name of the current connection
3 CLIENT GETNAME Gets the service name set by the CLIENT SETNAME command
4 CLIENT PAUSE Suspends the client connection, specifying the pending time in milliseconds
5 CLIENT KILL Close client connections

Redis Client Connections

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.