将tcp_max_tw_buckets设置为很小的值会有什么副作用? [英] what is the side effect of setting tcp_max_tw_buckets to a very small value?

查看:318
本文介绍了将tcp_max_tw_buckets设置为很小的值会有什么副作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道将tcp_max_tw_buckets设置为相对较小的数字(例如30000或50000)是很正常的,以避免主机具有大量等待时间状态连接且应用程序无法打开新连接的情况.这是很多提到的东西.例如这样的问题:如何减少TIME_WAIT中的套接字数量?

I know it is quite normal setting tcp_max_tw_buckets to a relatively small number such as 30000 or 50000, to avoid the situation when a host have a lots of time-wait state connections and application failed to open new one. It is something mentioned quite a lots. such as the question like this: How to reduce number of sockets in TIME_WAIT?

像以前一样,我知道时间等待是一种避免TCP数据包的状态乱序,最好使用

As before I know time-wait is a state to avoid TCP packets out of order, and it may be better using some other approach to coping it. And if you setting it to a small number thing may went wrong.

我觉得我陷入了必须将tcp_max_tw_buckets设置为一个小数目的问题,并且不知道我应该避免的具体情况.

I feel I'm stucking at somewhere that I have to set tcp_max_tw_buckets to a small number, and don't know the specific scenarios I shall avoid it.

所以我的问题是将tcp_max_tw_buckets设置为一个很小的值会有什么副作用,我可以使用实验室环境设置一个特定的方案,即少量的tcp_max_tw_buckets会造成麻烦吗?

So my question is what is the side effect of setting tcp_max_tw_buckets to a very small value, and can I setup a specific scenario using lab environment, that a small number of tcp_max_tw_buckets will cause the trouble?

推荐答案

您可以在

As you can see in this Kernel source, that option prevents graceful termination of the socket. In terms of the socket state, you have reduced the time wait duration for this connection to zero.

那么接下来会发生什么呢?首先,您将在服务器上看到错误消息.剩下的就是争夺客户后续连接的条件. rfc 1337 的第二部分将介绍您所看到的内容.简而言之,某些连接可能会显示以下症状.

So what happens next? First off, you'll see the error message on your server. The rest is then a race condition for subsequent connections from your clients. Section 2 of rfc 1337 then covers what you may see. In short, some connections may show the following symptoms.

  1. 数据流损坏(因为套接字接受旧传输).
  2. 无限ACK循环(由于拾起了旧的重复ACK).
  3. 连接中断(由于旧数据处于SYN-SENT状态).

但是,要证明这一点可能很难.如同一RFC中所述:

However, proving this may be hard. As noted in the same RFC:

这三个危害H1,H2和H3已在模拟环境中运行的库存Sun OS 4.1.1 TCP上进行了演示,该环境大量复制了段.这种环境比大多数实际TCP所必须应付的要危险得多,并且对条件进行了仔细的调整以创建故障的必要条件.

The three hazards H1, H2, and H3 have been demonstrated on a stock Sun OS 4.1.1 TCP running in an simulated environment that massively duplicates segments. This environment is far more hazardous than most real TCP's must cope with, and the conditions were carefully tuned to create the necessary conditions for the failures.

这篇关于将tcp_max_tw_buckets设置为很小的值会有什么副作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆