Apsaradb for Redis pipeline and Redispipeline

Source: Internet
Author: User

Apsaradb for Redis pipeline and Redispipeline

Redis is a typical TCP Service Based on the C/S model. During the communication between the client and the server, the client usually initiates a request first, and the server executes the corresponding task after receiving the request, finally, send the obtained data or processing results to the client in response. In this process, the client waits for the results returned by the server in blocking mode.


In each request and response process, we have to bear the extra overhead brought about by network transmission. This overhead is usually called the RTT (Round Trip Time ). Now we assume that the RTT for each request and response is 250 milliseconds, and the server can process KB of data in another second. The result is that the server can process up to four requests per second.


How can we optimize this performance problem?

The above Synchronous Response Method is transformed to an asynchronous response method based on the command pipeline. After sending the command, the client does not have to wait for the server to respond immediately, but continues to send the subsequent command. After the command is sent, read the responses of all previous commands at one time. In this way, the RTT overhead in the synchronization mode can be reduced.


If the Redis server finds that the client request is based on a pipeline, after receiving and processing the request, the server will store the response data of each command in the queue and then send it to the client.


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.