TCP/IP Backlog

Source: Internet
Author: User


In Linux, when an app creates a socket in the listen state, it assigns two queues to the socket.

  • SYN queue: Holds the socket in the SYN_REC state, specified by the kernel parameter tcp_max_syn_backlog.

  • Accept queue: Stores the socket in the established state, specified by the kernel parameter Somaxconn and the application itself, such as: Redis:tcp-backlog, take the minimum value in Somaxconn and Tcp-backlog.

  • The socket in the accept queue is consumed by the application.


The SYN queue is not full and the accept queue is full, at this point:

1) When the ACK of the TCP third handshake arrives at the server and the accept queue is full, the kernel loses the ACK packet.

2) due to the TCP retransmission mechanism, the sever end in the timeout period does not receive ack,server will retransmit syn+ack,client end multiplicity ACK packet.

3) After the retry number set by/proc/sys/net/ipv4/tcp_synack_retries has not received the ACK packet, it will no longer retry.


Reference article:

Http://veithen.github.io/2014/01/01/how-tcp-backlog-works-in-linux.html

http://blog.itpub.net/15480802/viewspace-1399303/


This article is from the "AMY" blog, please make sure to keep this source http://amy2015.blog.51cto.com/11407620/1767296

TCP/IP Backlog

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.