"The problem of a Go program system thread Skyrocket" conclusion

Source: Internet
Author: User
Tags rfc docker swarm

Original address: https://zhuanlan.zhihu.com/p/22474724

The author's conclusion is not well written, I say two sentences.

Conclusion: Docker swarm itself has a function called Settcpusertimeout, which calls the Conn. The File () method converts the TCP fd into blocking and does not close the corresponding FD. Equivalent to setting the Tcpusertimeout parameter each time, and then read the FD, will produce a new thread. Because the old thread is reading FD, and FD is set to blocking, then Golang's run time had to open a new one. Workaround: Do not use swarm this method, or submit to upstream let swarm fixed off, or call setsockoptint ... Curious gossip about what tcp_user_timeout is: According to RFC 5482, this option is used to communicate the TCP time-out to the peer. Incidentally, the RFC for TCP timeouts also includes: [RFC0793] [RFC1122]. Previously, TCP had a similar timeout option for TCP Keepalive. However, TCP keepalive is an option that is not recommended to open. Because the Committee felt that it would waste bandwidth and cause unnecessary network outages. Frankly speaking, TCP is a set of timers composed of a state machine, the designer is expected to interrupt the middle circuit, re-routing and other changes, will not affect the TCP state at both ends. Cond

"The problem of a Go program system thread Skyrocket" conclusion

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.