当前位置:网站首页>time_ Wait and close_ Cause of wait
time_ Wait and close_ Cause of wait
2022-07-29 02:35:00 【Meme_ xp】
1.time_wait How to produce
First call close() The party initiating the active closure , Sending the last ACK After that, I will enter time_wait The state of , It means that the sender will keep 2MSL Time will come back to the original state .MSL It's worth the maximum lifetime of packets in the network . To produce this result makes this TCP Connected to the 2MSL Connection waiting period .
2.time_wait The cause of the State
1) In order to achieve TCP Reliable release of full duplex connection
2) In order to make the old packets disappear in the network due to expiration
3.time_wait How can states avoid
The server can be set up SO_REUSEADDR Socket option to notify the kernel , If the port is busy , but TCP The connection is located at TIME_WAIT Ports can be reused in state .
The server keeps a lot of TIME_WAIT state
reason
Some crawler servers or WEB The server .
Bring problems
Maintain these states to Server Burden .
The solution is simple , Is to enable the server to quickly recycle and reuse those TIME_WAIT Resources for . Optimize parameter solution
The server keeps a lot of CLOSE_WAIT state
In case of passively closing the connection , After having received FIN, But I haven't sent my own FIN The moment of , Connection is in CLOSE_WAIT state .
After the other party's connection is closed , The program didn't detect , Or the program simply forgot to close the connection at this time , So this resource has been occupied by the program .
I think that's the case , There is no way to solve this problem through the server kernel parameters , The server does not have the right to reclaim the resources preempted by the program , Unless the program is terminated . Check the code and solve it
边栏推荐
- 结合Retrofit 改造OKHttp 缓存
- Derivation of Euler angle differential equation
- fopen、_ Wfopen reads Unicode encoded files
- Kubesphere multi node installation
- Code random notes_ Hash_ 349 intersection of two numbers
- 一文理解分布式开发中的服务治理
- When I look at the source code, what am I thinking?
- 3d智能工厂工艺流转可视化交互展示应用优点
- [golang learning notes 2.2] map, structure and interface
- 无线振弦采集系统工作流程
猜你喜欢
Jmeter之BeanShell生成MD5加密数据写入数据库
Day 15 (VLAN related knowledge)
Understand the evolution of redis architecture in one article
On Multithreading
When synchronized encounters this thing, there is a big hole, so be careful
VR safety training of mine mining virtual reality improves employees' vigilance and protection awareness
XSS range (II) xss.haozi
数据安全与隐私计算峰会-安全求交集在隐私计算中的发展和应用:学习
6年测试经验,教大家测试~如何把控项目
How does the Devops team defend against API attacks?
随机推荐
MySQL basic operation and comprehensive instance project based on MySQL basic operation
Chapter 3 business function development (deletion and modification of clue remarks)
0728~面试题梳理
Work queue_ queue
Excel uses countif statistics
工程经济学知识点总结
KBxxxxxx不一定是补丁,也可能是某个问题解决方案的描述
[mqtt from introduction to improvement series | 09] Wireshark packet capturing and analyzing mqtt messages
ROS2/ROS1开发过程中的一些记录
Time pit in MySQL driver
“12306”的架构到底有多牛逼?
“两个披萨”团队的分支管理实践
XSS range (II) xss.haozi
Explain the four asynchronous solutions of JS in detail: callback function, promise, generator, async/await
Altium designer outputs Gerber and other production documents
7/28 Gauss elimination to solve linear equations + Gauss elimination to solve XOR linear equations + find the combination number II
MySQL基本操作和基于MySQL基本操作的综合实例项目
Object based real-time spatial audio rendering - Dev for dev column
ES2022 的 8 个实用的新功能
The outsourcing company "mixed" for two years, and I only did five things seriously. Now I get byte offer smoothly.