Redis TCP-backlog Configuration

Source: Internet
Author: User

There is a TCP-backlog configuration in redis2.8, which is described as follows:

# TCP listen () backlog.
#
# In high requests-per-second environments you need an high backlog in order
# To avoid slow clients connections issues. Note that the Linux Kernel
# Will silently truncate it to the value of/proc/sys/NET/CORE/somaxconn so
# Make sure to raise both the value of somaxconn and tcp_max_syn_backlog
# In order to get the desired effect.
TCP-Back log 100

Then run the SS Command to display:

12 State      Recv-Q Send-Q        Local Address:Port          Peer Address:Port LISTEN     0100*:6379*:*

We can see that the value of send-Q is 100, which is the TCP-backlog value we configured. to understand the meaning of this value, I learned some queue knowledge about TCP's three-way handshake. we can see that when the server receives the sny, it will enter a SYN queue. When the server finally receives the ACK, it will switch to the accept queue. the connection shown on the above terminal in the listen status, and its send-Q is the maximum value of this accept queue. the connection will be removed from the queue only after the server executes accept. the size of this value is affected by somaxconn, because it is the minimum value of both of them, so to increase it, you must modify the somaxconn value of the kernel.

Reference: http://jaseywang.me/2014/07/20/tcp-queue-%E7%9A%84%E4%B8%80%E4%BA%9B%E9%97% AE %E9%A2%98/

 

Redis TCP-backlog Configuration

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.