Redis Client Connections

Source: Internet
Author: User
Tags redis server

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

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.