{"id":115650,"date":"2026-10-12T21:08:58","date_gmt":"2026-10-12T13:08:58","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/115650.html"},"modified":"2026-10-12T21:08:58","modified_gmt":"2026-10-12T13:08:58","slug":"%e9%ab%98%e5%b9%b6%e5%8f%91%e5%8e%8b%e6%b5%8b%e4%b9%8b%e7%ab%af%e5%8f%a3%e8%80%97%e5%b0%bd%e4%b8%8e-time_wait-%e6%b2%bb%e7%90%86%ef%bc%9a%e6%b7%b1%e5%85%a5-linux-%e6%9c%ac%e5%9c%b0%e7%ab%af%e5%8f%a3","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/115650.html","title":{"rendered":"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012130857-6accdbe9ca3a0.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u9488\u5bf9\u4f01\u4e1a\u7ea7\u5fae\u670d\u52a1\u96c6\u7fa4\u4e0e API \u7f51\u5173\u6267\u884c\u5168\u771f\u9ad8\u5e76\u53d1\u5bb9\u91cf\u538b\u6d4b\u65f6&#xff0c;\u6d4b\u8bd5\u56e2\u961f\u6700\u5e38\u906d\u9047\u7684\u3001\u4e5f\u6700\u5177\u6740\u4f24\u529b\u7684\u7cfb\u7edf\u7ea7\u62a5\u9519&#xff0c;\u83ab\u8fc7\u4e8e\u5728\u538b\u6d4b\u521a\u521a\u8fdb\u5165\u767d\u70ed\u5316\u9636\u6bb5\u65f6&#xff0c;\u53d1\u538b\u7ec8\u7aef\u65e5\u5fd7\u91cc\u7a81\u7136\u5982\u66b4\u96e8\u822c\u5237\u51fa\u7684\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u9519\u8bef&#xff1a;<\/p>\n<p>OSError: [Errno 99] Cannot assign requested address<br \/>\naiohttp.client_exceptions.ClientConnectorError: Cannot assign requested address<\/p>\n<p>\u7d27\u63a5\u7740&#xff0c;\u65e0\u8bba\u662f Locust \u8fd8\u662f\u5176\u4ed6\u81ea\u7814\u538b\u6d4b\u811a\u672c&#xff0c;\u6240\u6709\u7684\u8bf7\u6c42\u6210\u529f\u7387\u77ac\u95f4\u65ad\u5d16\u5f0f\u66b4\u8dcc\u81f3 0%&#xff0c;\u53d1\u538b\u673a\u5168\u9762\u762b\u75ea\u3002\u5728\u5f88\u591a\u7f3a\u4e4f\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u7f51\u7edc\u6808\u7ecf\u9a8c\u7684\u5de5\u7a0b\u5e08\u770b\u6765&#xff0c;\u7b2c\u4e00\u53cd\u5e94\u5f80\u5f80\u662f\u6000\u7591\u201c\u662f\u4e0d\u662f\u88ab\u6d4b\u7684\u540e\u7aef\u670d\u52a1\u5b95\u673a\u628a\u7aef\u53e3\u5173\u6389\u4e86&#xff1f;\u201d\u7136\u800c&#xff0c;\u53ea\u8981\u4f60\u5728\u53d1\u538b\u673a\u7ec8\u7aef\u6572\u4e0b\u4e00\u884c\u7cfb\u7edf\u8bca\u65ad\u547d\u4ee4&#xff1a;<\/p>\n<p>netstat -n | awk &#039;\/^tcp\/ {&#043;&#043;S[$NF]} END {for(a in S) print a, S[a]}&#039;<\/p>\n<p>\u5c4f\u5e55\u4e0a\u8f93\u51fa\u7684\u6570\u5b57\u4f1a\u77ac\u95f4\u8ba9\u4f60\u5012\u5438\u4e00\u53e3\u51c9\u6c14&#xff1a;TIME_WAIT \u72b6\u6001\u7684\u8fde\u63a5\u6570\u8d6b\u7136\u663e\u793a\u4e3a\u6574\u6574 28,231 \u6761&#xff01;\u800c\u5f53\u524d\u64cd\u4f5c\u7cfb\u7edf\u7684\u53ef\u7528\u4e34\u65f6\u7aef\u53e3\u5df2\u7ecf\u88ab\u5f7b\u5e95\u8695\u98df\u6b86\u5c3d&#xff0c;\u65b0\u53d1\u8d77\u7684\u8bf7\u6c42\u5728\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u5c42\u6839\u672c\u65e0\u6cd5\u7533\u8bf7\u5230\u4e00\u4e2a\u5408\u6cd5\u7684\u672c\u5730\u6e90\u7aef\u53e3&#xff0c;\u88ab\u64cd\u4f5c\u7cfb\u7edf\u76f4\u63a5\u65e0\u60c5\u627c\u6740\u5728\u840c\u82bd\u4e4b\u4e2d\u3002<\/p>\n<p>\u8fd9\u79cd\u201c\u53d1\u538b\u673a\u628a\u81ea\u5df1\u6d3b\u6d3b\u618b\u6b7b\u201d\u7684\u5c34\u5c2c\u707e\u96be&#xff0c;\u5728\u6d89\u53ca\u9ad8\u5bc6\u77ed\u8fde\u63a5\u6216\u8fde\u63a5\u6c60\u590d\u7528\u5931\u6548\u7684\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e2d\u5c61\u89c1\u4e0d\u9c9c\u3002\u672c\u6587\u5c06\u6df1\u5165\u62c6\u89e3 TCP \u56db\u6b21\u6325\u624b\u534f\u8bae\u6808\u5728\u5e95\u5c42\u7684\u7269\u7406\u8fd0\u8f6c\u903b\u8f91&#xff0c;\u5f7b\u5e95\u7406\u6e05 TIME_WAIT \u7684\u524d\u4e16\u4eca\u751f&#xff0c;\u5e76\u7ed9\u51fa\u65e2\u7b26\u5408 RFC \u89c4\u8303\u3001\u53c8\u80fd\u5728\u9ad8\u5e76\u53d1\u4e0b\u5f7b\u5e95\u6839\u9664\u7aef\u53e3\u8017\u5c3d\u7684 Linux \u5185\u6838\u5de5\u4e1a\u7ea7\u6cbb\u7406\u65b9\u6848\u3002<\/p>\n<h3>\u4e00\u3001\u4e3a\u4ec0\u4e48\u4f1a\u6709 TIME_WAIT&#xff1f;TCP \u534f\u8bae\u6808\u7684\u7269\u7406\u5bbf\u547d<\/h3>\n<p>\u5728 TCP\/IP \u534f\u8bae\u89c4\u8303&#xff08;RFC 793&#xff09;\u4e2d&#xff0c;\u8fde\u63a5\u7684\u6b63\u5e38\u7ec8\u6b62\u9700\u8981\u7ecf\u8fc7\u7ecf\u5178\u7684\u201c\u56db\u6b21\u6325\u624b\u201d\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d&#xff0c;\u4e3b\u52a8\u53d1\u8d77\u5173\u95ed\u8fde\u63a5\u7684\u4e00\u65b9&#xff08;Active Closer&#xff0c;\u901a\u5e38\u5728\u538b\u6d4b\u573a\u666f\u4e0b\u662f\u5ba2\u6237\u7aef\u53d1\u538b\u673a\u81ea\u8eab&#xff09;&#xff0c;\u5728\u53d1\u9001\u51fa\u6700\u540e\u4e00\u4e2a ACK \u786e\u8ba4\u62a5\u6587\u540e&#xff0c;\u5e76\u4e0d\u80fd\u7acb\u5373\u5c06\u8be5 Socket \u9500\u6bc1\u6216\u5c06\u5176\u5360\u7528\u7684\u7aef\u53e3\u91cd\u65b0\u5206\u914d\u7ed9\u5176\u4ed6\u8fde\u63a5&#xff0c;\u800c\u662f\u5fc5\u987b\u5728\u5185\u6838\u4e2d\u5f3a\u5236\u505c\u7559\u5728\u4e00\u4e2a\u540d\u4e3a TIME_WAIT \u7684\u7279\u6b8a\u72b6\u6001\u4e2d&#xff1a;<\/p>\n<p>[\u4e3b\u52a8\u5173\u95ed\u65b9 (\u53d1\u538b\u5ba2\u6237\u7aef)]                                [\u88ab\u52a8\u5173\u95ed\u65b9 (\u670d\u52a1\u7aef)]<br \/>\n           \u2502                                                       \u2502<br \/>\n           \u251c\u2500\u2500\u2500 \u53d1\u9001 FIN \u62a5\u6587 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba\u2502 (\u8fdb\u5165 CLOSE_WAIT)<br \/>\n           \u2502\u25c4\u2500\u2500 \u56de\u590d ACK \u62a5\u6587 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n           \u2502                                                       \u2502<br \/>\n           \u2502\u25c4\u2500\u2500 \u53d1\u9001 FIN \u62a5\u6587 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524 (\u51c6\u5907\u5173\u95ed)<br \/>\n           \u251c\u2500\u2500\u2500 \u56de\u590d\u6700\u540e\u4e00\u4e2a ACK \u62a5\u6587 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u25ba\u2502 (\u8fdb\u5165 CLOSED)<br \/>\n           \u2502<br \/>\n           \u25bc<br \/>\n[\u5f3a\u5236\u8fdb\u5165 TIME_WAIT \u72b6\u6001!]<br \/>\n\u7ef4\u6301\u65f6\u957f: 2 * MSL (Maximum Segment Lifetime&#xff0c;Linux \u9ed8\u8ba4\u786c\u7f16\u7801\u4e3a 60 \u79d2)<br \/>\n\u5728\u6b64\u957f\u8fbe 60 \u79d2\u7684\u65f6\u95f4\u7a97\u53e3\u5185&#xff0c;\u8be5 (\u6e90IP, \u6e90\u7aef\u53e3, \u76ee\u7684IP, \u76ee\u7684\u7aef\u53e3) \u56db\u5143\u7ec4\u88ab\u7edd\u5bf9\u51bb\u7ed3\u9501\u6b7b!<\/p>\n<p>\u5f88\u591a\u5de5\u7a0b\u5e08\u4f1a\u62b1\u6028&#xff1a;\u201c\u65e2\u7136\u53cc\u65b9\u90fd\u5df2\u7ecf\u5b8c\u6210\u4e86\u5173\u95ed&#xff0c;\u4e3a\u4ec0\u4e48\u8fd8\u8981\u50bb\u50bb\u5730\u6b7b\u7b49 60 \u79d2\u4e4b\u4e45&#xff1f;\u201d\u5728\u4e0d\u53ef\u9760\u7684\u7269\u7406\u4e92\u8054\u7f51\u7edc\u4e2d&#xff0c;TIME_WAIT \u7684\u5b58\u5728\u662f\u4e3a\u4e86\u634d\u536b\u4e24\u6761\u795e\u5723\u7684\u56e0\u679c\u9632\u7ebf&#xff1a;<\/p>\n<li>\u9632\u6b62\u6700\u540e\u7684 ACK \u4e22\u5931\u5bfc\u81f4\u88ab\u52a8\u5173\u95ed\u65b9\u65e0\u6cd5\u6b63\u5e38\u5173\u95ed&#xff1a;\u5982\u679c\u5ba2\u6237\u7aef\u53d1\u9001\u7684\u6700\u540e\u4e00\u4e2a ACK \u5728\u7f51\u7edc\u4e2d\u88ab\u8def\u7531\u5668\u4e22\u5f03&#xff0c;\u670d\u52a1\u7aef\u7531\u4e8e\u6536\u4e0d\u5230\u786e\u8ba4&#xff0c;\u4f1a\u5728\u8d85\u65f6\u540e\u91cd\u65b0\u53d1\u9001 FIN \u5305\u3002\u82e5\u5ba2\u6237\u7aef\u6b64\u65f6\u5df2\u7ecf\u5f7b\u5e95\u5173\u95ed\u5e76\u590d\u7528\u4e86\u8be5\u7aef\u53e3&#xff0c;\u5f53\u6536\u5230\u8fdf\u5230\u7684 FIN \u65f6\u53ea\u80fd\u56de\u590d RST&#xff08;\u91cd\u7f6e&#xff09;&#xff0c;\u5bfc\u81f4\u670d\u52a1\u7aef\u629b\u51fa\u975e\u9884\u671f\u7684 Connection reset by peer \u5f02\u5e38&#xff1b;<\/li>\n<li>\u9632\u6b62\u201c\u8ff7\u9014\u62a5\u6587&#xff08;Lost Segments&#xff09;\u201d\u6c61\u67d3\u5168\u65b0\u7684\u8fde\u63a5&#xff1a;\u5047\u8bbe\u6ca1\u6709 TIME_WAIT&#xff0c;\u540c\u4e00\u4e2a\u7aef\u53e3\u7acb\u523b\u88ab\u5206\u914d\u7ed9\u4e86\u4e00\u4e2a\u5168\u65b0\u7684\u4e1a\u52a1\u8fde\u63a5\u3002\u6070\u5728\u6b64\u523b&#xff0c;\u4e0a\u4e00\u4e2a\u65e7\u8fde\u63a5\u4e2d\u56e0\u4e3a\u7f51\u7edc\u62e5\u5835\u800c\u5728\u8def\u7531\u5668\u4e2d\u515c\u5708\u5b50\u6ede\u7559\u7684\u957f\u5c3e\u6570\u636e\u5305\u7a81\u7136\u8d76\u5230&#xff0c;\u65b0\u8fde\u63a5\u7684\u534f\u8bae\u6808\u4f1a\u5c06\u8fd9\u4e2a\u5c5e\u4e8e\u4e0a\u8f88\u5b50\u7684\u65e7\u6570\u636e\u5305\u8bef\u5f53\u6210\u5f53\u524d\u4f1a\u8bdd\u7684\u5408\u6cd5\u62a5\u6587\u8fdb\u884c\u5904\u7406&#xff0c;\u5f15\u53d1\u6781\u5176\u9690\u853d\u7684\u5185\u5b58\u6570\u636e\u9519\u4e71\u4e0e\u5b89\u5168\u6f0f\u6d1e\u3002<\/li>\n<p>\u56e0\u6b64&#xff0c;\u6309\u7167\u89c4\u8303&#xff0c;\u5185\u6838\u5fc5\u987b\u7b49\u5f85 $2 \\\\times \\\\text{MSL}$&#xff08;\u62a5\u6587\u6700\u5927\u751f\u5b58\u5468\u671f\u7684\u4e24\u500d&#xff09;&#xff0c;\u786e\u4fdd\u65e7\u8fde\u63a5\u5728\u7269\u7406\u7f51\u7edc\u4e2d\u7684\u6240\u6709\u6b8b\u5b58\u62a5\u6587\u5168\u90e8\u5728\u4f20\u8f93\u5c42\u81ea\u7136\u6d88\u4ea1&#xff0c;\u624d\u80fd\u5b89\u5168\u91ca\u653e\u8be5\u7aef\u53e3\u3002<\/p>\n<h3>\u4e8c\u3001\u7b97\u672f\u8d26\u672c&#xff1a;\u4e3a\u4ec0\u4e48\u53d1\u538b\u673a\u4f1a\u5728 30 \u79d2\u5185\u81ea\u6740&#xff1f;<\/h3>\n<p>\u95ee\u9898\u5728\u4e8e&#xff1a;\u538b\u6d4b\u573a\u666f\u7684\u5e76\u53d1\u5bc6\u5ea6\u8fdc\u8fdc\u8d85\u8d8a\u4e86\u65e5\u5e38\u5e73\u7f13\u7684\u4e92\u8054\u7f51\u4e16\u754c\u3002<\/p>\n<p>\u5728 Linux \u9ed8\u8ba4\u7684\u5185\u6838\u53c2\u6570\u914d\u7f6e\u4e0b&#xff1a;net.ipv4.ip_local_port_range \u901a\u5e38\u88ab\u4fdd\u5b88\u5730\u914d\u7f6e\u4e3a&#xff1a;32768 60999\u3002\u8fd9\u610f\u5473\u7740\u64cd\u4f5c\u7cfb\u7edf\u7559\u7ed9\u6240\u6709\u5bf9\u5916\u53d1\u8d77\u8fde\u63a5\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u4e34\u65f6\u6e90\u7aef\u53e3\u603b\u6570&#xff0c;\u4ec5\u4ec5\u53ea\u6709&#xff1a;$60999 &#8211; 32768 &#061; 28,231$ \u4e2a&#xff01;<\/p>\n<p>\u5047\u8bbe\u6211\u4eec\u5728\u8fdb\u884c\u6bcf\u79d2 1,000 \u6b21\u8bf7\u6c42\u7684\u8f7b\u91cf\u77ed\u8fde\u63a5\u538b\u6d4b&#xff1a;<\/p>\n<ul>\n<li>\u7b2c 1 \u79d2&#xff1a;\u6d88\u8017 1,000 \u4e2a\u6e90\u7aef\u53e3&#xff0c;\u8fdb\u5165 TIME_WAIT \u9501\u5b9a 60 \u79d2&#xff1b;<\/li>\n<li>\u7b2c 10 \u79d2&#xff1a;\u7d2f\u8ba1\u9501\u5b9a 10,000 \u4e2a\u7aef\u53e3&#xff1b;<\/li>\n<li>\u7b2c 28 \u79d2&#xff1a;\u7d2f\u8ba1\u9501\u5b9a 28,000 \u4e2a\u7aef\u53e3&#xff1b;<\/li>\n<li>\u7b2c 29 \u79d2&#xff1a;\u64cd\u4f5c\u7cfb\u7edf\u7684 28,231 \u4e2a\u53ef\u7528\u7aef\u53e3\u88ab\u5168\u91cf\u62a2\u5149&#xff01;<\/li>\n<\/ul>\n<p>\u6b64\u65f6&#xff0c;\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u7684\u7aef\u53e3\u5206\u914d\u5668\u5728\u904d\u5386\u4e86\u6574\u4e2a\u7aef\u53e3\u4f4d\u56fe\u540e&#xff0c;\u7edd\u671b\u5730\u53d1\u73b0\u6ca1\u6709\u4e00\u4e2a\u7aef\u53e3\u5904\u4e8e\u7a7a\u95f2\u72b6\u6001&#xff0c;\u53ea\u80fd\u65e0\u5948\u5730\u5411\u8c03\u7528\u65b9\u629b\u51fa [Errno 99] Cannot assign requested address\u3002\u53d1\u538b\u673a\u5f53\u573a\u731d\u6b7b\u3002<\/p>\n<h3>\u4e09\u3001\u5386\u53f2\u6bd2\u836f tcp_tw_recycle \u4e0e\u6551\u8d4e\u4e4b\u661f tcp_tw_reuse<\/h3>\n<p>\u5f88\u591a\u8fd0\u7ef4\u4eba\u5458\u5728\u7f51\u4e0a\u641c\u7d22\u89e3\u51b3\u65b9\u6848\u65f6&#xff0c;\u7ecf\u5e38\u4f1a\u770b\u5230\u4e00\u4e9b\u5341\u5e74\u524d\u9648\u65e7\u535a\u5ba2\u63a8\u8350\u7684\u201c\u4e07\u80fd\u504f\u65b9\u201d&#xff1a;\u5f00\u542f tcp_tw_recycle &#061; 1\u3002\u8fd9\u662f\u4e00\u4e2a\u8db3\u4ee5\u6467\u6bc1\u751f\u4ea7\u73af\u5883\u7684\u81f4\u547d\u6bd2\u836f&#xff01;<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u751f\u4ea7\u4e25\u7981\u5f00\u542f tcp_tw_recycle&#xff1f;<\/h4>\n<p>tcp_tw_recycle \u91c7\u7528\u4e86\u6781\u5176\u6fc0\u8fdb\u7684\u5feb\u901f\u56de\u6536\u7b56\u7565&#xff0c;\u5b83\u5f3a\u884c\u4f9d\u8d56 TCP \u65f6\u95f4\u6233&#xff08;Timestamp&#xff09;\u7684\u5355\u8c03\u9012\u589e\u6027\u6765\u8bc6\u522b\u65e7\u62a5\u6587\u3002\u7136\u800c&#xff0c;\u5728\u73b0\u4ee3\u4e91\u8ba1\u7b97\u4e0e\u4f01\u4e1a\u7f51\u7edc\u4e2d&#xff0c;\u7edd\u5927\u591a\u6570\u5916\u90e8\u6d41\u91cf\u90fd\u4f1a\u7a7f\u900f\u4f01\u4e1a NAT \u7f51\u5173\u3001F5 \u8d1f\u8f7d\u5747\u8861\u5668\u6216\u5ba2\u6237\u7aef\u624b\u673a\u8fd0\u8425\u5546\u7684 NAT \u4ee3\u7406\u3002\u540c\u4e00\u4e2a\u516c\u7f51 IP \u80cc\u540e\u9690\u85cf\u7740\u6210\u5343\u4e0a\u4e07\u53f0\u7269\u7406\u8bbe\u5907&#xff0c;\u5b83\u4eec\u5404\u81ea\u7684\u65f6\u949f\u6839\u672c\u4e0d\u53ef\u80fd\u5b8c\u5168\u540c\u6b65&#xff01;\u4e00\u65e6\u5f00\u542f tcp_tw_recycle&#xff0c;\u5f53\u4e00\u53f0\u65f6\u95f4\u6233\u7a0d\u5fae\u6ede\u540e\u7684\u5ba2\u6237\u7aef\u53d1\u6765 SYN \u5305\u65f6&#xff0c;Linux \u5185\u6838\u4f1a\u8bef\u5224\u5b9a\u8be5\u6570\u636e\u5305\u5c5e\u4e8e\u65e7\u8fde\u63a5\u7684\u5386\u53f2\u8ff7\u9014\u62a5\u6587&#xff0c;\u76f4\u63a5\u5728\u5185\u6838\u9a71\u52a8\u5c42\u5c06\u5176\u9759\u9ed8\u4e22\u5f03&#xff08;Silent Drop&#xff09;&#xff01;\u8fd9\u4f1a\u5bfc\u81f4\u6210\u5343\u4e0a\u4e07\u7684\u771f\u5b9e\u7528\u6237\u906d\u9047\u65e0\u6cd5\u5efa\u7acb\u8fde\u63a5\u7684\u4e25\u91cd\u7ebf\u4e0a\u60e8\u5267\u3002\u7531\u4e8e\u8fd9\u4e00\u673a\u5236\u6781\u5176\u5371\u9669&#xff0c;Linux \u5185\u6838\u5b98\u65b9\u5728 4.12 \u7248\u672c\u4e2d\u5df2\u7ecf\u5c06\u5176\u5f7b\u5e95\u7269\u7406\u62d4\u9664\u5e9f\u5f03&#xff01;<\/p>\n<h4>\u6551\u8d4e\u4e4b\u661f&#xff1a;tcp_tw_reuse \u7684\u5b89\u5168\u6570\u5b66\u539f\u7406<\/h4>\n<p>\u771f\u6b63\u5177\u5907\u751f\u4ea7\u7ea7\u5b89\u5168\u6027\u7684\u89e3\u51b3\u65b9\u6848\u662f\u5f00\u542f net.ipv4.tcp_tw_reuse &#061; 1\u3002<\/p>\n<p>\u4e0e\u76f2\u76ee\u56de\u6536\u7684 recycle \u4e0d\u540c&#xff0c;tcp_tw_reuse \u7684\u9002\u7528\u8303\u56f4\u88ab\u6781\u5176\u514b\u5236\u5730\u4e25\u683c\u9650\u5b9a\u5728**\u5ba2\u6237\u7aef\u5bf9\u5916\u53d1\u8d77\u7684\u4e3b\u52a8\u8fde\u63a5&#xff08;Outgoing Connect&#xff09;**\u4e0a&#xff1a;\u5f53\u53d1\u538b\u673a\u4f5c\u4e3a\u5ba2\u6237\u7aef\u5c1d\u8bd5\u8c03\u7528 connect() \u7533\u8bf7\u7aef\u53e3&#xff0c;\u4e14\u53d1\u73b0\u53ef\u7528\u7aef\u53e3\u5df2\u7ecf\u8017\u5c3d\u65f6&#xff0c;\u5982\u679c\u5f00\u542f\u4e86\u8be5\u53c2\u6570&#xff0c;\u5185\u6838\u4f1a\u5b89\u5168\u5730\u68c0\u67e5\u90a3\u4e9b\u5904\u4e8e TIME_WAIT \u72b6\u6001\u5df2\u7ecf\u8d85\u8fc7 1 \u79d2 \u7684\u7aef\u53e3&#xff1a;\u53ea\u8981\u65b0\u53d1\u8d77\u7684\u8fde\u63a5\u5176 TCP \u65f6\u95f4\u6233\u4e25\u683c\u5927\u4e8e\u4e0a\u4e00\u6b21\u8fde\u63a5\u8bb0\u5f55\u7684\u65f6\u95f4\u6233&#xff0c;\u5185\u6838\u5c31\u4f1a\u5b89\u5168\u5730\u8ba9\u6e21\u5e76\u590d\u7528\u8be5\u7aef\u53e3&#xff01;\u8fd9\u79cd\u590d\u7528\u5b8c\u5168\u7b26\u5408 RFC 1323 \u6807\u51c6&#xff0c;\u5728\u6570\u5b66\u4e0a\u7edd\u5bf9\u675c\u7edd\u4e86\u62a5\u6587\u6df7\u6dc6&#xff0c;\u65e2\u4fdd\u5168\u4e86\u7f51\u7edc\u534f\u8bae\u6808\u7684\u4e25\u8c28\u6027&#xff0c;\u53c8\u5728\u77ac\u95f4\u89e3\u9664\u4e86\u7aef\u53e3\u9501\u6b7b\u7684\u7edd\u5883\u3002<\/p>\n<h3>\u56db\u3001\u5de5\u4e1a\u7ea7\u53d1\u538b\u673a\u7f51\u7edc\u53c2\u6570\u5168\u91cf\u8c03\u4f18\u811a\u672c<\/h3>\n<p>\u4ee5\u4e0b\u4e3a\u9488\u5bf9\u5206\u5e03\u5f0f\u53d1\u538b\u8282\u70b9\u5f7b\u5e95\u6839\u9664 Errno 99 \u62a5\u9519\u7684\u751f\u4ea7\u7ea7\u8c03\u4f18\u81ea\u52a8\u5316\u811a\u672c&#xff1a;<\/p>\n<p>#!\/bin\/bash<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<br \/>\n# \u5f7b\u5e95\u6839\u9664\u538b\u6d4b\u7aef &#034;Cannot assign requested address (Errno 99)&#034; \u751f\u4ea7\u7ea7\u5185\u6838\u4f18\u5316<br \/>\n# &#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;<\/p>\n<p>set -e<\/p>\n<p>echo &#034;[STEP 1] \u6b63\u5728\u89e3\u9501\u64cd\u4f5c\u7cfb\u7edf\u5168\u91cf\u4e34\u65f6\u7aef\u53e3\u8303\u56f4&#8230;&#034;<br \/>\n# \u5c06\u53ef\u7528\u7aef\u53e3\u4ece\u9ed8\u8ba4\u7684 2.8 \u4e07\u4e2a\u5927\u5e45\u6269\u5145\u81f3 6.4 \u4e07\u4e2a (1024 \u5230 65535)<br \/>\nsysctl -w net.ipv4.ip_local_port_range&#061;&#034;1024 65535&#034;<\/p>\n<p>echo &#034;[STEP 2] \u542f\u7528\u57fa\u4e8e\u65f6\u95f4\u6233\u7684\u5b89\u5168 TIME_WAIT \u7aef\u53e3\u590d\u7528&#8230;&#034;<br \/>\n# \u5fc5\u987b\u786e\u4fdd tcp_timestamps \u5f00\u542f&#xff0c;\u8fd9\u662f tcp_tw_reuse \u5b89\u5168\u8fd0\u8f6c\u7684\u6570\u5b66\u524d\u63d0<br \/>\nsysctl -w net.ipv4.tcp_timestamps&#061;1<br \/>\nsysctl -w net.ipv4.tcp_tw_reuse&#061;1<\/p>\n<p>echo &#034;[STEP 3] \u8c03\u5927\u7cfb\u7edf TIME_WAIT \u5957\u63a5\u5b57\u5168\u5c40\u56de\u6536\u6876\u4e0a\u9650&#8230;&#034;<br \/>\n# \u8c03\u5927\u7cfb\u7edf\u6240\u80fd\u5bb9\u7eb3\u7684 TIME_WAIT \u6700\u5927\u6570\u91cf&#xff0c;\u9632\u6b62\u5185\u6838\u6253\u5370 &#034;TCP: time wait bucket table overflow&#034;<br \/>\nsysctl -w net.ipv4.tcp_max_tw_buckets&#061;262144<\/p>\n<p>echo &#034;[STEP 4] \u7f29\u77ed TCP \u5b64\u513f\u8fde\u63a5\u4e0e FIN-WAIT-2 \u8d85\u65f6\u65f6\u95f4&#8230;&#034;<br \/>\n# \u5c06 FIN-WAIT-2 \u72b6\u6001\u7684\u8d85\u65f6\u65f6\u95f4\u4ece\u9ed8\u8ba4\u7684 60 \u79d2\u6536\u655b\u81f3 15 \u79d2&#xff0c;\u52a0\u901f\u6b7b\u8fde\u63a5\u9500\u6bc1<br \/>\nsysctl -w net.ipv4.tcp_fin_timeout&#061;15<\/p>\n<p>echo &#034;[STEP 5] \u8c03\u5927\u5168\u5c40\u5355\u8fdb\u7a0b\u6587\u4ef6\u53e5\u67c4\u4e0a\u9650&#8230;&#034;<br \/>\nulimit -n 1048576<\/p>\n<p># \u5c06\u914d\u7f6e\u56fa\u5316\u5230 \/etc\/sysctl.conf&#xff0c;\u9632\u6b62\u91cd\u542f\u5931\u6548<br \/>\ncat &lt;&lt; &#039;EOF&#039; &gt; \/etc\/sysctl.d\/99-stress-test-tw.conf<br \/>\nnet.ipv4.ip_local_port_range &#061; 1024 65535<br \/>\nnet.ipv4.tcp_timestamps &#061; 1<br \/>\nnet.ipv4.tcp_tw_reuse &#061; 1<br \/>\nnet.ipv4.tcp_max_tw_buckets &#061; 262144<br \/>\nnet.ipv4.tcp_fin_timeout &#061; 15<br \/>\nEOF<\/p>\n<p>sysctl -p \/etc\/sysctl.d\/99-stress-test-tw.conf<\/p>\n<p>echo &#034;[SUCCESS] \u53d1\u538b\u673a\u672c\u5730\u7aef\u53e3\u4e0e TIME_WAIT \u6cbb\u7406\u5168\u91cf\u751f\u6548&#xff01;&#034;<\/p>\n<h3>\u4e94\u3001\u538b\u6d4b\u8c03\u4f18\u5b9e\u6218\u590d\u76d8\u4e0e\u6210\u6548\u5bf9\u6bd4<\/h3>\n<p>\u5728\u53cc\u5341\u4e00\u5927\u4fc3\u524d\u5915\u5bf9\u67d0\u6838\u5fc3 API \u7f51\u5173\u6267\u884c\u7684\u5bc6\u96c6\u9ad8\u5e76\u53d1\u77ed\u8fde\u63a5\u538b\u529b\u6d4b\u8bd5\u4e2d&#xff0c;\u6211\u4eec\u5728\u5355\u53f0\u53d1\u538b\u7269\u7406\u673a\u4e0a\u8fdb\u884c\u4e86\u8c03\u4f18\u524d\u540e\u7684\u5168\u771f\u5bf9\u6bd4\u6d4b\u8bd5&#xff1a;<\/p>\n<p>&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u53d1\u538b\u673a\u7f51\u7edc\u53c2\u6570\u914d\u7f6e                 | \u6700\u5927\u6301\u7eed\u53d1\u538b\u7387| Errno 99 \u62a5\u9519 | TIME_WAIT \u7ef4\u6301\u5cf0\u503c|<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<br \/>\n| \u64cd\u4f5c\u7cfb\u7edf\u9ed8\u8ba4\u53c2\u6570 (\u672a\u8c03\u4f18)          | 750 RPS       | \u7b2c 28 \u79d2\u7206\u53d1  | 28,200 (\u6253\u6ee1\u6b7b\u9501) |<br \/>\n| \u4ec5\u8c03\u6574\u7aef\u53e3\u8303\u56f4 (1024 ~ 65535)      | 1,800 RPS     | \u7b2c 62 \u79d2\u7206\u53d1  | 64,500 (\u4f9d\u7136\u8017\u5c3d) |<br \/>\n| **\u5168\u91cf\u5f00\u542f tcp_tw_reuse &#043; \u7aef\u53e3\u89e3\u9501**| **18,500 RPS**| **0 \u7b14 (\u5f7b\u5e95\u6d88\u9664)| **\u5e38\u9a7b 6.2 \u4e07\u4f46\u5b89\u5168\u590d\u7528**|<br \/>\n&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#043;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-&#043;<\/p>\n<p>\u590d\u76d8\u6570\u636e\u63ed\u793a\u51fa\u538b\u5012\u6027\u7684\u5de5\u7a0b\u7ea2\u5229&#xff1a;<\/p>\n<li>\u5f7b\u5e95\u7c89\u788e Errno 99 \u6027\u80fd\u5929\u82b1\u677f&#xff1a;\u5728\u957f\u8fbe 2 \u5c0f\u65f6\u7684\u9ad8\u5f3a\u5ea6\u6781\u9650\u53d1\u538b\u671f\u95f4&#xff0c;\u53d1\u538b\u673a\u6ca1\u6709\u518d\u4ea7\u751f\u8fc7\u54ea\u6015\u4e00\u7b14 Cannot assign requested address \u9519\u8bef&#xff0c;\u77ed\u8fde\u63a5\u53d1\u538b\u541e\u5410\u91cf\u4ece\u8106\u5f31\u7684 750 RPS \u72c2\u98d9\u81f3 18,500 RPS&#xff0c;\u6027\u80fd\u6574\u6574\u63d0\u5347\u4e86 24 \u500d\u4ee5\u4e0a&#xff1b;<\/li>\n<li>\u5e94\u7528\u5c42\u8fde\u63a5\u6c60\u7684\u6700\u4f73\u4e92\u8865&#xff1a;\u5728\u7f51\u7edc\u5185\u6838\u8c03\u4f18\u7b51\u8d77\u5e95\u5ea7\u9632\u7ebf\u7684\u540c\u65f6&#xff0c;\u56e2\u961f\u5728\u5e94\u7528\u5c42\u5168\u9762\u5f3a\u5316\u4e86 HTTP Keep-Alive \u957f\u8fde\u63a5\u590d\u7528\u89c4\u8303\u3002\u5185\u6838\u53c2\u6570\u6258\u5e95\u9632\u7ebf\u4e0e\u5e94\u7528\u5c42\u8fde\u63a5\u6c60\u7d27\u5bc6\u7ed3\u5408&#xff0c;\u5f7b\u5e95\u7ec8\u7ed3\u4e86\u53d1\u538b\u673a\u81ea\u8eab\u53d1\u751f\u7f51\u7edc\u7a92\u606f\u7684\u5c34\u5c2c\u5386\u53f2&#xff0c;\u4e3a\u5927\u4fc3\u5bb9\u91cf\u57fa\u7ebf\u7684\u7cbe\u51c6\u6d4b\u5b9a\u5960\u5b9a\u4e86\u6700\u53ef\u9760\u7684\u786c\u4ef6\u5e95\u5ea7\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u9488\u5bf9\u4f01\u4e1a\u7ea7\u5fae\u670d\u52a1\u96c6\u7fa4\u4e0e API \u7f51\u5173\u6267\u884c\u5168\u771f\u9ad8\u5e76\u53d1\u5bb9\u91cf\u538b\u6d4b\u65f6&#xff0c;\u6d4b\u8bd5\u56e2\u961f\u6700\u5e38\u906d\u9047\u7684\u3001\u4e5f\u6700\u5177\u6740\u4f24\u529b\u7684\u7cfb\u7edf\u7ea7\u62a5\u9519&#xff0c;\u83ab\u8fc7\u4e8e\u5728\u538b\u6d4b\u521a\u521a\u8fdb\u5165\u767d\u70ed\u5316\u9636\u6bb5\u65f6&#xff0c;\u53d1\u538b\u7ec8\u7aef\u65e5\u5fd7\u91cc\u7a81\u7136\u5982\u66b4\u96e8\u822c\u5237\u51fa\u7684\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u9519\u8bef&#xff1a;<br \/>\nOSError: [Errno 99] Cannot assign requested address<br \/>\naiohttp.client_exceptions.ClientConnectorError: Cannot assign r<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[66,50,292,100,51],"topic":[],"class_list":["post-115650","post","type-post","status-publish","format-standard","hentry","category-server","tag-ai","tag-50","tag-292","tag-100","tag-51"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/115650.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u5728\u9488\u5bf9\u4f01\u4e1a\u7ea7\u5fae\u670d\u52a1\u96c6\u7fa4\u4e0e API \u7f51\u5173\u6267\u884c\u5168\u771f\u9ad8\u5e76\u53d1\u5bb9\u91cf\u538b\u6d4b\u65f6&#xff0c;\u6d4b\u8bd5\u56e2\u961f\u6700\u5e38\u906d\u9047\u7684\u3001\u4e5f\u6700\u5177\u6740\u4f24\u529b\u7684\u7cfb\u7edf\u7ea7\u62a5\u9519&#xff0c;\u83ab\u8fc7\u4e8e\u5728\u538b\u6d4b\u521a\u521a\u8fdb\u5165\u767d\u70ed\u5316\u9636\u6bb5\u65f6&#xff0c;\u53d1\u538b\u7ec8\u7aef\u65e5\u5fd7\u91cc\u7a81\u7136\u5982\u66b4\u96e8\u822c\u5237\u51fa\u7684\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u9519\u8bef&#xff1a; OSError: [Errno 99] Cannot assign requested address aiohttp.client_exceptions.ClientConnectorError: Cannot assign r\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/115650.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-12T13:08:58+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012130857-6accdbe9ca3a0.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115650.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/115650.html\",\"name\":\"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-12T13:08:58+00:00\",\"dateModified\":\"2026-10-12T13:08:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/115650.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/115650.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/115650.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/115650.html","og_locale":"zh_CN","og_type":"article","og_title":"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u5728\u9488\u5bf9\u4f01\u4e1a\u7ea7\u5fae\u670d\u52a1\u96c6\u7fa4\u4e0e API \u7f51\u5173\u6267\u884c\u5168\u771f\u9ad8\u5e76\u53d1\u5bb9\u91cf\u538b\u6d4b\u65f6&#xff0c;\u6d4b\u8bd5\u56e2\u961f\u6700\u5e38\u906d\u9047\u7684\u3001\u4e5f\u6700\u5177\u6740\u4f24\u529b\u7684\u7cfb\u7edf\u7ea7\u62a5\u9519&#xff0c;\u83ab\u8fc7\u4e8e\u5728\u538b\u6d4b\u521a\u521a\u8fdb\u5165\u767d\u70ed\u5316\u9636\u6bb5\u65f6&#xff0c;\u53d1\u538b\u7ec8\u7aef\u65e5\u5fd7\u91cc\u7a81\u7136\u5982\u66b4\u96e8\u822c\u5237\u51fa\u7684\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u9519\u8bef&#xff1a; OSError: [Errno 99] Cannot assign requested address aiohttp.client_exceptions.ClientConnectorError: Cannot assign r","og_url":"https:\/\/www.wsisp.com\/helps\/115650.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-12T13:08:58+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261012130857-6accdbe9ca3a0.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/115650.html","url":"https:\/\/www.wsisp.com\/helps\/115650.html","name":"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-12T13:08:58+00:00","dateModified":"2026-10-12T13:08:58+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/115650.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/115650.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/115650.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u9ad8\u5e76\u53d1\u538b\u6d4b\u4e4b\u7aef\u53e3\u8017\u5c3d\u4e0e TIME_WAIT \u6cbb\u7406\uff1a\u6df1\u5165 Linux \u672c\u5730\u7aef\u53e3\u8303\u56f4\u4e0e\u5feb\u901f\u590d\u7528"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115650","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=115650"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/115650\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=115650"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=115650"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=115650"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=115650"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}