500之后的TIME_WAIT

HTTP 500之后,会出现一段时间的TCP "TIME_WAIT"状态。因为500之后,服务器主动关闭了连接,导致TCP进入了"TIME_WAIT"状态。这段时间持续的长度为2个MSL时间长度。

MSL在RFC 1122上建议是2分钟,而源自berkeley的TCP实现传统上使用30秒。

```

caikiki@ubuntu:~$ netstat -pant
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 192.168.170.190:22      192.168.170.1:50463     ESTABLISHED -
tcp        0      0 192.168.170.190:22      192.168.170.1:50656     ESTABLISHED -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 192.168.170.190:80      192.168.170.1:63422     TIME_WAIT   -
caikiki@ubuntu:~$ date
Sun Jan 21 08:55:16 PST 2018

# 一分钟之后

caikiki@ubuntu:~$ netstat -pant
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 192.168.170.190:22      192.168.170.1:50463     ESTABLISHED -
tcp        0      0 192.168.170.190:22      192.168.170.1:50656     ESTABLISHED -
tcp6       0      0 :::80                   :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
caikiki@ubuntu:~$ date
Sun Jan 21 08:56:16 PST 2018

```

参考:

http://blog.oldboyedu.com/tcp-wait/


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值