TCP HTTP Optimizations

Source: Internet
Author: User

Tcp

1.tcp_keepalive_time

int keepAlive = 1; Turn on the KeepAlive property. Default value: 0 (OFF)

int keepidle = 60; If there is no data interaction within 60 seconds, the probe is made. Default value: 7200 (s)

int keepinterval = 5; The detection packet is detected at a time interval of 5 seconds. Default value: (s)

int keepcount = 2; Number of probe retries. All timeouts determine that the connection is invalid. Default value: 9 (Times)

SetSockOpt (S, Sol_socket, So_keepalive, (void*) &keepalive, sizeof (KEEPALIVE));

SetSockOpt (S, Sol_tcp, Tcp_keepidle, (void*) &keepidle, sizeof (Keepidle));

SetSockOpt (S, Sol_tcp, TCP_KEEPINTVL, (void*) &keepinterval, sizeof (Keepinterval));

SetSockOpt (S, Sol_tcp, tcp_keepcnt, (void*) &keepcount, sizeof (Keepcount));


MongoDB echo >/proc/sys/net/ipv4/tcp_keepalive_time default is 7200


Tcp_keepalive_time and RST Flag in NAT environment


This article is from the "people, to have their own ideas" blog, please be sure to keep this source http://szgb2016.blog.51cto.com/340201/1854649

TCP HTTP Optimizations

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.