{"id":123819,"date":"2026-11-08T06:57:25","date_gmt":"2026-11-07T22:57:25","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/123819.html"},"modified":"2026-11-08T06:57:25","modified_gmt":"2026-11-07T22:57:25","slug":"%e5%8f%a5%e6%9f%84%e4%b8%8a%e9%99%90-512%ef%bc%8c%e5%b9%b6%e5%8f%91-254-%e5%b0%b1%e6%92%9e%e5%a2%99%ef%bc%9a%e9%a2%84%e7%ae%97%e6%80%8e%e4%b9%88%e7%ae%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/123819.html","title":{"rendered":"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97"},"content":{"rendered":"<p>        \/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/<br \/>\n        #content_views .toc,<br \/>\n        \/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/<br \/>\n        #content_views.markdown_views &gt; p:empty:has(+ .toc),<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty,<br \/>\n        \/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/<br \/>\n        #content_views.htmledit_views #main-toc,<br \/>\n        #content_views.htmledit_views #hr-toc,<br \/>\n        #content_views.htmledit_views p[id*=\\&#8221;-toc\\&#8221;] {<br \/>\n          display: none !important;<br \/>\n        }<br \/>\n        \/* \u76ee\u5f55\u53bb\u6389\u540e\uff0c\u7d27\u8ddf\u7684\u9996\u4e2a\u6807\u9898\u4e0d\u518d\u591a\u51fa\u4e00\u5757\u4e0a\u8fb9\u8ddd *\/<br \/>\n        #content_views.markdown_views &gt; .toc + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + h4,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h1,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h2,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h3,<br \/>\n        #content_views.markdown_views &gt; .toc + p:empty + h4 {<br \/>\n          margin-top: 0 !important;<br \/>\n        }<\/p>\n<p>\u7248\u6743\u4e0e\u5185\u5bb9\u6765\u6e90\u58f0\u660e<br \/>\n\u672c\u6587\u4e3a\u539f\u521b\u6574\u7406\u3002\u6587\u4e2d\u6d89\u53ca\u5b98\u65b9\u6587\u6863\u3001\u5f00\u6e90\u4ed3\u5e93\u3001\u8bba\u6587\u4e0e\u516c\u5f00\u62a5\u9053\u7684\u5185\u5bb9&#xff0c;\u5747\u5728\u9644\u8868 A \u4e2d\u6807\u6ce8\u6765\u6e90&#xff1b;\u5f15\u7528\u5b98\u65b9\u539f\u6587\u4fdd\u6301\u539f\u6837&#xff0c;\u4e0d\u4f5c\u6539\u5199\u3002\u6587\u4e2d\u547d\u4ee4\u3001\u7248\u672c\u53f7\u4e0e\u754c\u9762\u622a\u56fe\u4ee5\u672c\u6587\u6210\u6587\u65f6\u7684\u5b9e\u6d4b\/\u6838\u9a8c\u7ed3\u679c\u4e3a\u51c6&#xff0c;\u6807\u6ce8\u300c\u5f85\u9a8c\u8bc1\u300d\u7684\u90e8\u5206\u8bf7\u4ee5\u4f60\u672c\u5730\u73af\u5883\u5b9e\u9645\u8f93\u51fa\u4e3a\u5224\u65ad\u4f9d\u636e\u3002\u672c\u6587\u4e0d\u63a8\u8350\u4efb\u4f55\u4e0d\u5408\u89c4\u7684\u8f6f\u4ef6\u83b7\u53d6\u65b9\u5f0f&#xff0c;\u4e5f\u4e0d\u5bf9\u4efb\u4f55\u6536\u76ca\u7ed3\u679c\u4f5c\u627f\u8bfa\u3002\u8f6c\u8f7d\u8bf7\u6ce8\u660e\u51fa\u5904\u3002<\/p>\n<p>\u628a\u90a3\u6bb5\u4e8c\u5341\u51e0\u884c\u7684\u811a\u672c\u5728\u672c\u5730\u8dd1\u4e00\u904d&#xff0c;\u8f6f\u4e0a\u9650\u538b\u5230 512&#xff0c;\u8fdb\u7a0b\u8d77\u6765\u65f6\u5df2\u7ecf\u5360\u4e86 4 \u4e2a fd&#xff0c;\u7136\u540e\u6bcf\u7ec4&#034;\u8bf7\u6c42&#034;\u5360 2 \u4e2a\u4e14\u4e0d\u91ca\u653e&#xff0c;\u5c4f\u5e55\u4e0a\u4f1a\u4f9d\u6b21\u505c\u5728\u8fd9\u4e24\u884c&#xff1a;\u4e0d\u91ca\u653e&#xff1a;\u6210\u529f\u5360\u7528 254 \u7ec4\u540e&#xff0c;\u7b2c 255 \u6b21\u5206\u914d\u5931\u8d25&#xff0c;\u9884\u7b97\u516c\u5f0f&#xff1a;\u5e76\u53d1\u4e0a\u9650 &#061; (512 &#8211; 4 &#8211; \u9884\u7559 16) \/ \u6bcf\u8bf7\u6c42 2 &#061; 246\u3002\u540c\u4e00\u53f0\u673a\u5668\u3001\u540c\u4e00\u4e2a\u4e0a\u9650&#xff0c;\u4e00\u4e2a\u8bf4 254&#xff0c;\u4e00\u4e2a\u8bf4 246\u3002<\/p>\n<p>\u8fd9\u4e24\u4e2a\u6570\u5b57\u6ca1\u6709\u8c01\u7b97\u9519&#xff0c;\u5b83\u4eec\u5728\u56de\u7b54\u4e24\u4e2a\u4e0d\u540c\u7684\u95ee\u9898&#xff1a;254 \u662f&#034;\u6700\u591a\u80fd\u585e\u591a\u5c11&#034;&#xff0c;246 \u662f&#034;\u80fd\u585e\u591a\u5c11\u8fd8\u7559\u5f97\u51fa\u4f59\u91cf&#034;\u3002\u5de5\u7a0b\u4e0a\u771f\u6b63\u80fd\u5199\u8fdb\u914d\u7f6e\u7684\u662f\u540e\u8005&#xff0c;\u800c\u7edd\u5927\u591a\u6570\u5bb9\u91cf\u4f30\u7b97\u51fa\u95ee\u9898&#xff0c;\u4e0d\u662f\u516c\u5f0f\u5199\u9519&#xff0c;\u662f\u628a\u524d\u8005\u5f53\u6210\u4e86\u540e\u8005\u3002<\/p>\n<h3>\u5148\u628a\u300c\u5e76\u53d1\u6570\u300d\u548c\u300c\u53e5\u67c4\u6570\u300d\u62c6\u5f00&#xff1a;\u5b83\u4eec\u4e0d\u662f\u4e00\u56de\u4e8b<\/h3>\n<p>\u5e76\u53d1\u662f&#034;\u540c\u4e00\u65f6\u523b\u5728\u5904\u7406\u591a\u5c11\u4ef6\u4e8b&#034;&#xff0c;\u53e5\u67c4\u662f&#034;\u8fdb\u7a0b\u540c\u65f6\u6525\u7740\u591a\u5c11\u4e2a\u5185\u6838\u5bf9\u8c61&#034;\u3002\u8fd9\u4e24\u8005\u53ea\u6709\u5728&#034;\u6bcf\u4ef6\u4e8b\u5360\u7528\u56fa\u5b9a\u4e2a\u6570&#034;\u8fd9\u4e2a\u524d\u63d0\u4e0b\u624d\u6210\u6b63\u6bd4&#xff0c;\u800c\u8fd9\u4e2a\u524d\u63d0\u6070\u6070\u662f\u6700\u5bb9\u6613\u4e0d\u6210\u7acb\u7684\u4e00\u73af\u2014\u2014\u6240\u4ee5\u4f30\u5bb9\u91cf\u65f6\u5148\u522b\u95ee\u5e76\u53d1\u591a\u5c11&#xff0c;\u5148\u95ee\u6bcf\u4e2a\u8bf7\u6c42\u5360\u51e0\u4e2a\u3002<\/p>\n<h4>\u53e5\u67c4\u662f\u8fdb\u7a0b\u624b\u91cc\u7684\u63d2\u5ea7&#xff0c;\u4e0d\u662f\u7ebf\u7a0b\u7684<\/h4>\n<p>\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff08;file descriptor&#xff0c;\u4e0b\u9762\u7b80\u79f0 fd&#xff09;\u662f\u8fdb\u7a0b\u6253\u5f00\u6587\u4ef6\u3001\u5957\u63a5\u5b57\u3001\u7ba1\u9053\u65f6&#xff0c;\u5185\u6838\u53d1\u56de\u6765\u7684\u4e00\u4e2a\u5c0f\u6574\u6570\u3002\u4f60\u62ff\u5230\u7684\u4e0d\u662f\u90a3\u4e2a\u5bf9\u8c61\u672c\u8eab&#xff0c;\u53ea\u662f\u4e00\u4e2a\u7f16\u53f7&#xff1b;\u4ee5\u540e\u6bcf\u6b21\u8bfb\u5199&#xff0c;\u90fd\u662f\u628a\u8fd9\u4e2a\u7f16\u53f7\u9012\u56de\u5185\u6838&#xff0c;\u8ba9\u5b83\u66ff\u4f60\u53bb\u64cd\u4f5c\u771f\u6b63\u7684\u5bf9\u8c61\u3002\u8fd9\u4e2a\u8bbe\u8ba1\u6709\u4e2a\u76f4\u63a5\u540e\u679c&#xff1a;\u7f16\u53f7\u662f\u6709\u9650\u8d44\u6e90&#xff0c;\u7528\u5b8c\u4e86\u5c31\u518d\u4e5f\u5f00\u4e0d\u4e86\u65b0\u7684&#xff0c;\u54ea\u6015\u5185\u5b58\u8fd8\u5269\u4e00\u5927\u534a\u3001CPU \u8fd8\u7a7a\u7740\u3002<\/p>\n<p>Python \u6587\u6863\u5bf9\u8fd9\u6761\u4e0a\u9650\u7684\u5b9a\u4e49\u5f88\u5e72\u8106&#xff1a;\u300cRLIMIT_NOFILE \u2014 The maximum number of open file descriptors for the current process.\u300d\u4e3b\u8bed\u662f the current process&#xff0c;\u4e0d\u662f\u673a\u5668\u3001\u4e0d\u662f\u5bb9\u5668\u3001\u4e5f\u4e0d\u662f\u8d26\u53f7\u3002\u540c\u4e00\u4e2a\u8fdb\u7a0b\u91cc\u5f00 8 \u4e2a\u7ebf\u7a0b\u8fd8\u662f 1 \u4e2a\u7ebf\u7a0b&#xff0c;\u8d26\u90fd\u8bb0\u5728\u540c\u4e00\u672c\u4e0a\u3002\u6240\u4ee5&#034;\u6211\u8fd9\u53f0\u673a\u5668\u5185\u5b58\u591f&#034;\u8fd9\u53e5\u8bdd&#xff0c;\u5bf9\u53e5\u67c4\u95ee\u9898\u4e00\u70b9\u89e3\u91ca\u529b\u90fd\u6ca1\u6709\u3002<\/p>\n<h4>\u8f6f\u4e0a\u9650\u662f\u6b64\u523b\u751f\u6548\u7684\u7ebf&#xff0c;\u786c\u4e0a\u9650\u662f\u5b83\u78b0\u4e0d\u5230\u7684\u5929\u82b1\u677f<\/h4>\n<p>\u540c\u4e00\u4efd\u6587\u6863\u628a\u8fd9\u4e24\u6761\u7ebf\u7684\u5173\u7cfb\u5199\u6e05\u695a\u4e86&#xff1a;\u300cEach resource is controlled by a pair of limits: a soft limit and a hard limit. The soft limit is the current limit, and may be lowered or raised by a process over time. The soft limit can never exceed the hard limit.\u300d<\/p>\n<p>\u7ffb\u6210\u4eba\u8bdd&#xff1a;\u8f6f\u4e0a\u9650\u662f\u73b0\u5728\u6b63\u5728\u751f\u6548\u7684\u90a3\u4e2a\u6570\u5b57&#xff0c;\u8fdb\u7a0b\u81ea\u5df1\u5c31\u80fd\u5f80\u4e0a\u8c03&#xff1b;\u786c\u4e0a\u9650\u662f\u5b83\u8c03\u4e0d\u8fc7\u53bb\u7684\u90a3\u9053\u574e&#xff0c;\u901a\u5e38\u8981\u66f4\u9ad8\u7684\u6743\u9650\u624d\u52a8\u5f97\u4e86\u3002\u8fd9\u6761\u8bed\u4e49\u76f4\u63a5\u51b3\u5b9a\u6392\u969c\u987a\u5e8f\u2014\u2014\u5148\u8bfb\u8f6f\u4e0a\u9650&#xff0c;\u518d\u770b\u5b83\u79bb\u786c\u4e0a\u9650\u8fd8\u6709\u591a\u5c11\u7a7a\u95f4\u3002\u5982\u679c\u8f6f\u4e0a\u9650\u5df2\u7ecf\u8d34\u7740\u786c\u4e0a\u9650&#xff0c;&#034;\u628a\u6570\u5b57\u8c03\u5927&#034;\u8fd9\u6761\u8def\u5f53\u573a\u5c31\u65ad\u4e86&#xff0c;\u53ea\u80fd\u56de\u5934\u53bb\u538b\u6bcf\u8bf7\u6c42\u5360\u7528\u3002<\/p>\n<p>\u672c\u6587\u4e0d\u53bb\u80cc\u5404\u7cfb\u7edf\u3001\u5404\u53d1\u884c\u7248\u7684\u9ed8\u8ba4\u4e0a\u9650&#xff0c;\u4e00\u662f\u90a3\u4e9b\u6570\u503c\u968f\u5185\u6838\u7248\u672c\u548c\u542f\u52a8\u65b9\u5f0f\u53d8\u5316&#xff0c;\u4e8c\u662f\u80cc\u4e0b\u6765\u4e5f\u7528\u4e0d\u4e0a&#xff1a;\u6b63\u786e\u7684\u505a\u6cd5\u662f\u5728\u4f60\u81ea\u5df1\u7684\u8fdb\u7a0b\u91cc\u8bfb\u4e00\u6b21&#xff0c;\u8bfb\u5230\u7684\u624d\u662f\u4f60\u7684\u3002\u4e0b\u9762\u7b2c 4 \u7ae0\u90a3\u6bb5\u811a\u672c\u7b2c\u4e00\u6b65\u5e72\u7684\u5c31\u662f\u8fd9\u4ef6\u4e8b\u3002<\/p>\n<h4>\u4e09\u6761\u7ebf\u7ecf\u5e38\u88ab\u6df7\u6210\u540c\u4e00\u6761<\/h4>\n<p>\u6392\u969c\u65f6\u6700\u5e38\u542c\u5230\u7684\u63cf\u8ff0\u662f&#034;\u5e76\u53d1\u4e0a\u4e0d\u53bb&#034;\u3002\u53ef\u5e76\u53d1\u3001\u7ebf\u7a0b\u6570\u3001\u53e5\u67c4\u6570\u662f\u4e09\u6761\u72ec\u7acb\u7684\u7ebf&#xff0c;\u5361\u5728\u4e0d\u540c\u7684\u5730\u65b9&#xff0c;\u8868\u73b0\u4e5f\u4e0d\u4e00\u6837\u3002\u5206\u4e0d\u6e05\u662f\u54ea\u6761\u7ebf&#xff0c;\u6539\u7684\u4e1c\u897f\u5c31\u662f\u9519\u7684\u3002<\/p>\n<table>\n<tr>\u6307\u6807\u5b83\u6570\u7684\u662f\u4ec0\u4e48\u8c01\u5728\u9650\u5236\u5b83\u649e\u4e0a\u65f6\u4f60\u5148\u770b\u5230\u4ec0\u4e48<\/tr>\n<tbody>\n<tr>\n<td>\u5e76\u53d1\u6570<\/td>\n<td>\u540c\u4e00\u65f6\u523b\u5728\u5904\u7406\u591a\u5c11\u4e2a\u8bf7\u6c42<\/td>\n<td>\u4f60\u7684\u4ee3\u7801\u4e0e\u6846\u67b6\u7684\u5e76\u53d1\u6a21\u578b<\/td>\n<td>\u8bf7\u6c42\u5f00\u59cb\u6392\u961f&#xff0c;\u5ef6\u8fdf\u62ac\u5347<\/td>\n<\/tr>\n<tr>\n<td>\u7ebf\u7a0b\u6570<\/td>\n<td>\u540c\u65f6\u6709\u591a\u5c11\u4e2a\u6267\u884c\u6808<\/td>\n<td>\u7ebf\u7a0b\u6808\u5185\u5b58\u4e0e\u8c03\u5ea6\u5f00\u9500<\/td>\n<td>\u4e0a\u4e0b\u6587\u5207\u6362\u53d8\u591a&#xff0c;\u5185\u5b58\u4e0a\u6da8<\/td>\n<\/tr>\n<tr>\n<td>\u53e5\u67c4\u6570<\/td>\n<td>\u8fdb\u7a0b\u540c\u65f6\u63e1\u7740\u591a\u5c11\u4e2a\u5185\u6838\u5bf9\u8c61<\/td>\n<td>RLIMIT_NOFILE \u7684\u8f6f\u4e0a\u9650<\/td>\n<td>\u65b0\u8fde\u63a5\u6839\u672c\u5efa\u4e0d\u8d77\u6765<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u628a\u8fd9\u5f20\u8868\u8bfb\u5b8c&#xff0c;\u4e00\u53e5\u8bdd\u5c31\u591f\u7528\u4e86&#xff1a;\u5e76\u53d1\u9ad8\u4e0d\u4e00\u5b9a\u53e5\u67c4\u9ad8&#xff0c;\u4f46\u53e5\u67c4\u9ad8\u5230\u9876&#xff0c;\u5e76\u53d1\u4e00\u5b9a\u4e0a\u4e0d\u53bb\u3002\u53cd\u8fc7\u6765&#xff0c;\u53e5\u67c4\u591f\u7528\u4e5f\u4e0d\u4ee3\u8868\u5e76\u53d1\u80fd\u4e0a\u53bb\u2014\u2014\u90a3\u53ef\u80fd\u662f\u7ebf\u7a0b\u6c60\u6216\u8005\u4e0b\u6e38\u5728\u5361\u4f60\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48&#034;\u52a0\u673a\u5668&#034;\u7ecf\u5e38\u6ca1\u7528&#xff1a;\u74f6\u9888\u5728\u8fdb\u7a0b\u5185\u7684\u7f16\u53f7\u8868\u4e0a&#xff0c;\u52a0\u4e00\u53f0\u673a\u5668\u53ea\u662f\u591a\u4e86\u51e0\u4e2a\u540c\u6837\u4f1a\u88ab\u585e\u6ee1\u7684\u8fdb\u7a0b\u3002<\/p>\n<h3>\u6bcf\u4e00\u4e2a\u8bf7\u6c42\u5230\u5e95\u5360\u51e0\u4e2a\u53e5\u67c4&#xff0c;\u8981\u6570\u51fa\u6765\u800c\u4e0d\u662f\u731c<\/h3>\n<p>\u6bcf\u4e2a\u8bf7\u6c42\u7684\u53e5\u67c4\u5360\u7528\u8bb0\u4f5c k\u3002k \u662f\u4e2a\u80fd\u6570\u51fa\u6765\u7684\u6574\u6570&#xff0c;\u4e0d\u662f&#034;\u5927\u6982\u4e00\u4e24\u4e2a&#034;\u3002\u628a\u5b83\u4f30\u5c0f\u4e00\u534a&#xff0c;\u5bb9\u91cf\u5c31\u4f1a\u7b97\u5927\u4e00\u500d&#xff0c;\u7136\u540e\u5728\u6700\u4e0d\u8be5\u51fa\u95ee\u9898\u7684\u65f6\u5019\u51fa\u95ee\u9898\u3002<\/p>\n<h4>\u4e00\u7ec4 socketpair \u5c31\u662f\u4e24\u4e2a fd&#xff0c;\u4e0d\u662f\u4e00<\/h4>\n<p>\u5148\u770b\u4e00\u6761\u6700\u5e72\u51c0\u7684\u66f2\u7ebf&#xff1a;\u8bf7\u6c42\u6570\u4ece 50 \u4e00\u8def\u52a0\u5230 400&#xff0c;\u770b\u8fdb\u7a0b\u7684 fd \u6570\u600e\u4e48\u53d8\u3002<\/p>\n<p>&#x1f9ea; \u5b9e\u6d4b\u73af\u5883&#xff1a;Python 3.13.12 \/ macOS \/ \u4ec5\u7528\u6807\u51c6\u5e93<\/p>\n<p><span class=\"token keyword\">import<\/span> os<br \/>\n<span class=\"token keyword\">import<\/span> socket<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">fd_count<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>os<span class=\"token punctuation\">.<\/span>listdir<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\/dev\/fd&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u8bf7\u6c42\u6570  \u5fd8\u4e86\u5173\u65f6\u7684 fd \u6570  \u7528\u5b8c\u5373\u5173\u7684 fd \u6570&#034;<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">for<\/span> n <span class=\"token keyword\">in<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">100<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">200<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">400<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    leak <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span>socket<span class=\"token punctuation\">.<\/span>socketpair<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token keyword\">for<\/span> _ <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">]<\/span><br \/>\n    leaked <span class=\"token operator\">&#061;<\/span> fd_count<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> a<span class=\"token punctuation\">,<\/span> b <span class=\"token keyword\">in<\/span> leak<span class=\"token punctuation\">:<\/span><br \/>\n        a<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        b<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> _ <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span>n<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        a<span class=\"token punctuation\">,<\/span> b <span class=\"token operator\">&#061;<\/span> socket<span class=\"token punctuation\">.<\/span>socketpair<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        a<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        b<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>n<span class=\"token punctuation\">:<\/span><span class=\"token format-spec\">&gt;6<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>leaked<span class=\"token punctuation\">:<\/span><span class=\"token format-spec\">&gt;17<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>fd_count<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><span class=\"token format-spec\">&gt;17<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8bf7\u6c42\u6570  \u5fd8\u4e86\u5173\u65f6\u7684 fd \u6570  \u7528\u5b8c\u5373\u5173\u7684 fd \u6570<br \/>\n    50               104                 4<br \/>\n   100               204                 4<br \/>\n   200               404                 4<br \/>\n   400               804                 4<\/p>\n<p>\u56db\u884c\u8bfb\u6570&#xff1a;104\u3001204\u3001404\u3001804\u3002\u628a\u5b83\u4eec\u548c\u7b2c\u4e00\u5217\u7684\u8bf7\u6c42\u6570\u5bf9\u4e00\u4e0b&#xff0c;\u89c4\u5f8b\u662f 2n &#043; 4\u2014\u2014\u6bcf\u4e2a\u8bf7\u6c42\u8d21\u732e 2 \u4e2a&#xff0c;\u53e6\u5916\u6709 4 \u4e2a\u662f\u8fdb\u7a0b\u81ea\u5df1\u7684\u5bb6\u5e95\u3002\u8fd9\u4e2a 2 \u4e0d\u662f&#034;\u4e00\u4e2a\u8fde\u63a5\u4e00\u4e2a fd&#034;\u7684\u5e38\u8bc6&#xff0c;\u800c\u662f\u56e0\u4e3a\u4e00\u7ec4 socketpair \u6709\u4e24\u7aef&#xff0c;\u4e24\u7aef\u90fd\u5728\u540c\u4e00\u4e2a\u8fdb\u7a0b\u91cc&#xff0c;\u5c31\u90fd\u8bb0\u5728\u4f60\u5934\u4e0a\u3002<\/p>\n<p>\u7b2c\u4e09\u5217\u66f4\u6709\u610f\u601d&#xff1a;\u4e0d\u7ba1\u8dd1 50 \u6b21\u8fd8\u662f 400 \u6b21&#xff0c;\u7528\u5b8c\u7acb\u523b\u5173\u6389\u4e4b\u540e&#xff0c;fd \u6570\u6052\u4e3a 4\u3002\u8fd9\u4e00\u5217\u662f&#034;\u6ca1\u6709\u6cc4\u6f0f&#034;\u957f\u4ec0\u4e48\u6837&#xff0c;\u8bb0\u4f4f\u5b83&#xff0c;\u540e\u9762\u6240\u6709\u6392\u969c\u90fd\u662f\u62ff\u5f53\u524d fd \u6570\u8ddf\u8fd9\u4e2a\u57fa\u7ebf\u6bd4\u3002<\/p>\n<p>\u8981\u8bf4\u660e\u7684\u662f&#xff0c;\u811a\u672c\u628a\u4e00\u7ec4 socketpair \u5f53\u6210&#034;\u4e00\u6b21\u8bf7\u6c42\u7684\u4e24\u7aef&#034;&#xff0c;\u662f\u4e3a\u4e86\u628a k&#061;2 \u8fd9\u79cd\u60c5\u51b5\u6446\u5230\u53f0\u9762\u4e0a\u3002\u771f\u5b9e\u670d\u52a1\u91cc k \u7531\u8bf7\u6c42\u8def\u5f84\u51b3\u5b9a&#xff1a;\u53ea\u6709\u5165\u7ad9\u8fde\u63a5\u65f6\u53ef\u80fd\u662f 1&#xff0c;\u63a5\u4e86\u4e0a\u6e38\u3001\u53c8\u5199\u4e34\u65f6\u6587\u4ef6\u65f6\u5c31\u53ef\u80fd\u662f 3\u30014\u3002\u6240\u4ee5\u4e0b\u9762\u8fd9\u5f20\u6e05\u70b9\u8868&#xff0c;\u4f60\u8981\u6309\u81ea\u5df1\u7684\u8def\u5f84\u91cd\u586b\u4e00\u904d\u3002<\/p>\n<h4>\u628a\u4e00\u6b21\u8bf7\u6c42\u7684\u8def\u5f84\u644a\u5f00\u6570<\/h4>\n<p>\u6570 k \u7684\u65b9\u6cd5\u4e0d\u662f\u731c&#xff0c;\u662f\u628a\u8bf7\u6c42\u8d70\u4e00\u904d&#xff0c;\u51e1\u662f&#034;\u5f00\u4e86\u6ca1\u5173&#034;\u7684\u5730\u65b9\u90fd\u8bb0\u4e00\u7b14\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u63a5\u4e86\u4e0a\u6e38\u3001\u53c8\u843d\u4e34\u65f6\u6587\u4ef6\u7684\u8bf7\u6c42&#xff0c;\u9010\u9879\u6e05\u70b9&#xff1a;<\/p>\n<table>\n<tr>\u53e5\u67c4\u6765\u6e90\u672c\u4f8b\u5360\u51e0\u4e2a\u4ec0\u4e48\u65f6\u5019\u91ca\u653e\u6f0f\u4e86\u4e4b\u540e\u7684\u8868\u73b0<\/tr>\n<tbody>\n<tr>\n<td>\u5165\u7ad9\u8fde\u63a5<\/td>\n<td>1<\/td>\n<td>\u8bf7\u6c42\u5904\u7406\u5b8c\u5173\u95ed\u8fde\u63a5<\/td>\n<td>\u8bf7\u6c42\u5806\u79ef\u65f6\u9636\u68af\u4e0a\u5347&#xff0c;\u4e0d\u56de\u843d<\/td>\n<\/tr>\n<tr>\n<td>\u4e0a\u6e38\u8fde\u63a5<\/td>\n<td>1<\/td>\n<td>\u7528\u5b8c\u5f52\u8fd8\u7ed9\u6c60<\/td>\n<td>\u6c60\u88ab\u501f\u7a7a\u540e\u8bf7\u6c42\u5f00\u59cb\u6392\u961f<\/td>\n<\/tr>\n<tr>\n<td>\u4e34\u65f6\u6587\u4ef6<\/td>\n<td>1<\/td>\n<td>\u5199\u5b8c\u5373\u5220<\/td>\n<td>\u4e34\u65f6\u76ee\u5f55\u91cc\u6b8b\u7559\u6587\u4ef6\u8d8a\u6765\u8d8a\u591a<\/td>\n<\/tr>\n<tr>\n<td>\u65e5\u5fd7\u6587\u4ef6<\/td>\n<td>0&#xff08;\u8fdb\u7a0b\u5e38\u9a7b&#xff09;<\/td>\n<td>\u8fdb\u7a0b\u9000\u51fa\u65f6<\/td>\n<td>\u4e0d\u968f\u8bf7\u6c42\u589e\u957f&#xff0c;\u4e0d\u8ba1\u5165 k<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u52a0\u8d77\u6765 k&#061;3\u3002\u6362\u6210\u4f60\u7684\u670d\u52a1&#xff0c;\u628a\u8fd9\u5f20\u8868\u6309\u771f\u5b9e\u8def\u5f84\u91cd\u586b&#xff0c;\u52a0\u51fa\u6765\u7684\u548c\u624d\u662f\u4f60\u7684 k\u3002\u6ce8\u610f\u6700\u540e\u4e00\u884c&#xff1a;\u5e38\u9a7b\u7684\u65e5\u5fd7\u53e5\u67c4\u3001\u76d1\u542c\u5957\u63a5\u5b57\u3001\u914d\u7f6e\u6587\u4ef6\u53e5\u67c4&#xff0c;\u90fd\u7b97\u5728\u57fa\u7ebf\u91cc&#xff0c;\u4e0d\u4e58\u5e76\u53d1\u6570\u2014\u2014\u5b83\u4eec\u5929\u5929\u5728&#xff0c;\u53ea\u662f\u4e0d\u6da8\u3002<\/p>\n<h4>k \u8981\u53d6\u5cf0\u503c&#xff0c;\u4e0d\u662f\u5747\u503c<\/h4>\n<p>\u4e00\u4e2a\u8bf7\u6c42\u5728\u4e2d\u9014\u53ef\u80fd\u540c\u65f6\u6301\u6709\u6bd4\u7a33\u6001\u66f4\u591a\u7684\u53e5\u67c4&#xff1a;\u8bfb\u914d\u7f6e\u6587\u4ef6\u65f6\u5f00\u7740\u6587\u4ef6\u3001\u540c\u65f6\u53c8\u5411\u4e0a\u6e38\u8981\u6570\u636e&#xff0c;\u4e24\u4e2a\u540c\u65f6\u5728\u624b&#xff1b;\u7b49\u6570\u636e\u5904\u7406\u5b8c&#xff0c;\u6587\u4ef6\u5173\u4e86&#xff0c;\u4e0a\u6e38\u8fde\u63a5\u8fd8\u5360\u7740\u3002\u7b97\u5bb9\u91cf\u8981\u7528\u8fd9\u4e2a\u5cf0\u503c&#xff0c;\u56e0\u4e3a\u649e\u5899\u53ea\u53d1\u751f\u5728\u5cf0\u503c\u90a3\u4e00\u523b&#xff0c;\u800c\u5747\u503c\u4f1a\u628a\u8fd9\u4e2a\u77ac\u95f4\u62b9\u5e73\u3002<\/p>\n<p>\u8fd8\u6709\u4e00\u6761\u66f4\u597d\u7528\u7684\u6027\u8d28&#xff1a;\u6cc4\u6f0f\u7684\u66f2\u7ebf\u662f\u7ebf\u6027\u7684&#xff0c;\u659c\u7387\u5c31\u662f k\u3002\u4e0a\u4e00\u8282\u90a3\u5f20\u8868\u91cc&#xff0c;\u5fd8\u4e86\u5173\u65f6 fd \u6570\u662f 2n&#043;4&#xff0c;\u4e00\u6761\u7b14\u76f4\u7684\u659c\u7ebf&#xff1b;\u8fd9\u6761\u659c\u7ebf\u548c\u8f6f\u4e0a\u9650\u7684\u4ea4\u70b9&#xff0c;\u5c31\u662f\u4f60\u649e\u5899\u7684\u51c6\u786e\u4f4d\u7f6e\u3002\u6240\u4ee5\u770b\u5230 fd \u6570\u968f\u65f6\u95f4\u5355\u8c03\u4e0a\u5347&#xff0c;\u4e0d\u7528\u6000\u7591&#xff0c;\u5148\u53bb\u627e\u90a3\u6761\u6f0f\u5173\u7684\u8def\u5f84\u3002<\/p>\n<h3>\u9884\u7b97\u516c\u5f0f&#xff1a;\u8f6f\u4e0a\u9650\u3001\u57fa\u7ebf\u5360\u7528\u3001\u9884\u7559\u4e09\u5757<\/h3>\n<p>\u80fd\u62ff\u6765\u5206\u914d\u7684\u4ece\u6765\u4e0d\u662f\u8f6f\u4e0a\u9650\u672c\u8eab&#xff0c;\u662f&#034;\u8f6f\u4e0a\u9650\u51cf\u53bb\u57fa\u7ebf\u3001\u518d\u51cf\u53bb\u9884\u7559&#034;\u4e4b\u540e\u5269\u4e0b\u7684\u90a3\u4e00\u622a&#xff0c;\u518d\u9664\u4ee5 k\u3002\u8fd9\u4e09\u5757\u5c11\u7b97\u4efb\u4f55\u4e00\u5757&#xff0c;\u7b97\u51fa\u6765\u7684\u5e76\u53d1\u90fd\u662f\u7eb8\u9762\u4e0a\u7684\u3002<\/p>\n<h4>\u4e09\u5757\u5f00\u9500\u5404\u81ea\u600e\u4e48\u8bfb<\/h4>\n<p>\u8f6f\u4e0a\u9650\u4e00\u884c\u4ee3\u7801\u5c31\u80fd\u8bfb&#xff1a;resource.getrlimit(resource.RLIMIT_NOFILE) \u8fd4\u56de\u4e00\u5bf9\u503c&#xff0c;\u7b2c\u4e00\u4e2a\u5c31\u662f\u5f53\u524d\u751f\u6548\u7684\u8f6f\u4e0a\u9650\u3002\u57fa\u7ebf\u4e5f\u597d\u8bfb&#xff1a;\u8fdb\u7a0b\u542f\u52a8\u5b8c\u3001\u8fd8\u6ca1\u63a5\u7b2c\u4e00\u4e2a\u8bf7\u6c42\u65f6&#xff0c;\u6570\u4e00\u6b21 fd \u4e2a\u6570&#xff0c;\u672c\u6587\u8fd9\u53f0\u673a\u5668\u4e0a\u662f 4\u3002\u96be\u7684\u662f\u7b2c\u4e09\u5757\u3002<\/p>\n<p>\u9884\u7559\u662f\u7559\u7ed9&#034;\u4e0d\u5728\u8bf7\u6c42\u8def\u5f84\u4e0a\u3001\u4f46\u7167\u6837\u8981\u5f00 fd&#034;\u7684\u52a8\u4f5c\u7684&#xff1a;\u65e5\u5fd7\u8f6e\u8f6c\u8981\u65b0\u5efa\u6587\u4ef6\u3001\u5065\u5eb7\u68c0\u67e5\u8981\u5efa\u8fde\u63a5\u3001\u8fde\u63a5\u6c60\u91cd\u5efa\u8981\u91cd\u65b0\u63e1\u624b\u3001\u914d\u7f6e\u70ed\u52a0\u8f7d\u8981\u6253\u5f00\u65b0\u6587\u4ef6\u3002\u8fd9\u4e9b\u52a8\u4f5c\u4e0d\u4f1a\u56e0\u4e3a\u4f60\u5728\u8dd1\u6ee1\u8d1f\u8f7d\u5c31\u505c\u4e0b\u6765\u7b49\u4f60\u3002\u672c\u6587\u7edf\u4e00\u53d6 16&#xff0c;\u7406\u7531\u6709\u4e24\u6761&#xff1a;\u4e00\u662f 2 \u7684\u6574\u6570\u500d&#xff0c;\u9664\u4e0b\u6765\u6574\u9f50&#xff1b;\u4e8c\u662f\u591f 8 \u7ec4\u4e34\u65f6\u5bf9&#xff0c;\u7a81\u53d1\u65f6\u591f\u7528\u3002<\/p>\n<p>\u628a\u4e09\u5757\u5199\u6210\u4e00\u4e2a\u5f0f\u5b50&#xff0c;\u5c31\u662f\u672c\u6587\u552f\u4e00\u7684\u516c\u5f0f&#xff1a;<\/p>\n<p>\u5e76\u53d1\u4e0a\u9650 &#061;&#xff08;\u8f6f\u4e0a\u9650 \u2212 \u57fa\u7ebf \u2212 \u9884\u7559&#xff09;\u00f7 \u6bcf\u8bf7\u6c42\u5360\u7528 k&#xff0c;\u5411\u4e0b\u53d6\u6574<\/p>\n<p>\u5411\u4e0b\u53d6\u6574\u4e0d\u662f\u62a0\u95e8&#xff0c;\u662f\u5fc5\u987b\u2014\u2014\u591a\u7b97\u534a\u4e2a\u8bf7\u6c42\u4e5f\u662f\u591a\u7b97&#xff0c;\u800c\u591a\u7b97\u7684\u90a3\u534a\u4e2a\u6b63\u597d\u4f1a\u5728\u6ee1\u8f7d\u65f6\u5f00\u4e0d\u51fa fd\u3002<\/p>\n<h4>\u628a\u540c\u4e00\u4e2a\u516c\u5f0f\u4ee3\u8fdb\u56db\u79cd\u60c5\u5f62<\/h4>\n<table>\n<tr>\u60c5\u5f62\u8f6f\u4e0a\u9650\u57fa\u7ebf\u9884\u7559k\u5e76\u53d1\u4e0a\u9650<\/tr>\n<tbody>\n<tr>\n<td>\u7406\u8bba\u88c5\u6ee1&#xff08;\u4e0d\u7559\u9884\u7559&#xff09;<\/td>\n<td>512<\/td>\n<td>4<\/td>\n<td>0<\/td>\n<td>2<\/td>\n<td>254<\/td>\n<\/tr>\n<tr>\n<td>\u672c\u6587\u53d6\u503c<\/td>\n<td>512<\/td>\n<td>4<\/td>\n<td>16<\/td>\n<td>2<\/td>\n<td>246<\/td>\n<\/tr>\n<tr>\n<td>k \u53d8\u5927\u5230 3<\/td>\n<td>512<\/td>\n<td>4<\/td>\n<td>16<\/td>\n<td>3<\/td>\n<td>164<\/td>\n<\/tr>\n<tr>\n<td>\u57fa\u7ebf\u88ab\u5403\u6389\u4e00\u5927\u622a<\/td>\n<td>512<\/td>\n<td>100<\/td>\n<td>16<\/td>\n<td>2<\/td>\n<td>198<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7b2c\u4e00\u884c 254 \u548c\u7b2c 4 \u7ae0\u7684\u5b9e\u6d4b\u8f93\u51fa\u5bf9\u5f97\u4e0a&#xff0c;\u56e0\u4e3a\u811a\u672c\u672c\u6765\u5c31\u662f\u6309\u8fd9\u4e2a\u5f0f\u5b50\u94fa\u7684\u3002\u5b83\u540c\u65f6\u66b4\u9732\u4e86\u4e00\u4e2a\u5bb9\u6613\u88ab\u5ffd\u7565\u7684\u72b6\u6001&#xff1a;\u88c5\u6ee1 254 \u7ec4\u7684\u65f6\u5019&#xff0c;\u8fdb\u7a0b\u624b\u4e0a\u4e00\u4e2a\u7a7a\u95f2 fd \u90fd\u6ca1\u6709\u4e86\u3002\u8fd9\u65f6\u5019\u54ea\u6015\u53ea\u662f\u60f3\u5199\u4e00\u884c\u65e5\u5fd7\u3001\u60f3\u628a\u9519\u8bef\u4fe1\u606f\u56de\u7ed9\u5ba2\u6237\u7aef&#xff0c;\u90fd\u53ef\u80fd\u56e0\u4e3a\u5f00\u4e0d\u51fa\u65b0 fd \u800c\u5931\u8d25\u2014\u2014\u6570\u5b57\u662f\u5bf9\u7684&#xff0c;\u72b6\u6001\u662f\u4e0d\u80fd\u4e0a\u7ebf\u7684\u3002<\/p>\n<p>\u7b2c\u4e09\u884c\u662f\u5728\u8bf4\u53e6\u4e00\u4ef6\u4e8b&#xff1a;k \u4ece 2 \u53d8\u6210 3&#xff0c;\u5e76\u53d1\u4e0a\u9650\u5c31\u4ece 246 \u6389\u5230 164&#xff0c;\u6389\u4e86\u4e09\u5206\u4e4b\u4e00\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48&#034;\u6570\u51fa\u6765&#034;\u6bd4&#034;\u731c\u4e00\u4e2a&#034;\u91cd\u8981&#xff0c;k \u6bcf\u591a\u4e00&#xff0c;\u5bb9\u91cf\u5c31\u5c11\u4e00\u5927\u5757\u3002<\/p>\n<p>\u7b2c\u56db\u884c\u66f4\u503c\u5f97\u8b66\u60d5&#xff1a;\u57fa\u7ebf\u4ece 4 \u6da8\u5230 100&#xff0c;\u516c\u5f0f\u91cc\u76f4\u63a5\u5c11\u6389 48 \u4e2a\u5e76\u53d1\u3002\u57fa\u7ebf\u4e3a\u4ec0\u4e48\u4f1a\u957f&#xff1f;\u6700\u5e38\u89c1\u7684\u662f\u542f\u52a8\u65f6\u9884\u52a0\u8f7d\u4e86\u4e00\u5806\u6587\u4ef6\u53e5\u67c4\u3001\u6216\u8005\u6846\u67b6\u81ea\u5df1\u5f00\u4e86\u76d1\u542c\u7aef\u53e3\u548c\u5185\u90e8\u7ba1\u9053\u3002\u8fd9\u7c7b\u5f00\u9500\u5728\u538b\u6d4b\u65f6\u770b\u4e0d\u89c1&#xff0c;\u56e0\u4e3a\u5b83\u4e0d\u968f\u8bf7\u6c42\u53d8\u5316&#xff0c;\u53ea\u5728\u7b97\u5bb9\u91cf\u65f6\u54ac\u4f60\u4e00\u53e3\u3002<\/p>\n<h4>\u60f3\u8c03\u5927\u4e0a\u9650\u4e4b\u524d&#xff0c;\u5148\u786e\u8ba4 k \u91cc\u6ca1\u6709\u6cc4\u6f0f<\/h4>\n<p>&#034;\u8dd1 1000 \u6b21\u540e fd \u6570\u4ecd\u4e3a 4&#034;\u548c&#034;50 \u5230 400 \u65f6\u6052\u4e3a 4&#034;\u5176\u5b9e\u5728\u56de\u7b54\u540c\u4e00\u4e2a\u95ee\u9898&#xff1a;\u5173\u6389\u4e4b\u540e\u6709\u6ca1\u6709\u56de\u6765\u3002\u56de\u6765\u4e86&#xff0c;\u8bf4\u660e k \u91cc\u6ca1\u6709\u6cc4\u6f0f&#xff0c;\u5bb9\u91cf\u95ee\u9898\u5c31\u662f\u7eaf\u7b97\u672f&#xff0c;\u5957\u516c\u5f0f\u5c31\u884c&#xff1b;\u6ca1\u56de\u6765&#xff0c;\u8bf4\u660e\u4f60\u5728\u8ddf\u4e00\u6761\u659c\u7ebf\u8d5b\u8dd1&#xff0c;\u8c03\u5927\u4e0a\u9650\u53ea\u662f\u628a\u649e\u5899\u65f6\u95f4\u5f80\u540e\u63a8&#xff0c;\u659c\u7387\u4e0d\u53d8\u3002<\/p>\n<p>\u5224\u636e\u53ef\u4ee5\u5199\u5f97\u5f88\u6b7b&#xff1a;\u538b 1000 \u6b21\u8bf7\u6c42&#xff0c;\u7ed3\u675f\u540e fd \u6570\u4e0e\u57fa\u7ebf\u7684\u5dee\u5728 2 \u4ee5\u5185&#xff0c;\u7b97\u6ca1\u6709\u6cc4\u6f0f&#xff1b;\u5dee\u503c\u968f\u8bf7\u6c42\u6570\u7ebf\u6027\u589e\u957f&#xff0c;\u5c31\u662f\u6cc4\u6f0f\u3002\u8fd9\u6761\u5224\u636e\u4e0d\u9700\u8981\u4efb\u4f55\u5de5\u5177&#xff0c;\u6570\u4e00\u4e0b \/dev\/fd \u76ee\u5f55\u91cc\u7684\u6761\u76ee\u5c31\u591f\u4e86\u2014\u2014\u672c\u6587\u811a\u672c\u91cc\u7684 fd_count() \u5e72\u7684\u5c31\u662f\u8fd9\u4ef6\u4e8b\u3002\u987a\u5e26\u8bf4\u660e&#xff0c;\u8fd9\u4e2a\u8def\u5f84\u662f macOS \u4e0a\u7684\u5199\u6cd5&#xff0c;\u6362\u5230\u522b\u7684\u7cfb\u7edf\u4e0d\u4e00\u5b9a\u5b58\u5728&#xff0c;\u811a\u672c\u90a3\u4e00\u884c\u8981\u6362\u6210\u5bf9\u5e94\u5e73\u53f0\u7684\u7b49\u4ef7\u5199\u6cd5&#xff08;\u672c\u6587\u672a\u5728\u5176\u4ed6\u7cfb\u7edf\u6838\u9a8c&#xff0c;\u6807\u5f85\u9a8c\u8bc1&#xff09;\u3002<\/p>\n<h3>\u7528\u4e00\u4e2a\u6700\u5c0f\u670d\u52a1\u8dd1\u901a&#xff0c;\u770b\u5b83\u5728\u54ea\u4e00\u6b65\u649e\u5899<\/h3>\n<p>\u4e09\u4e2a\u5e38\u6570\u4e0d\u7528\u731c&#xff0c;\u4e8c\u5341\u51e0\u884c\u811a\u672c\u5c31\u80fd\u91cf\u51fa\u6765\u3002\u91cf\u5b8c\u4f60\u4f1a\u62ff\u5230\u56db\u4e2a\u6570\u5b57&#xff1a;\u8f6f\u4e0a\u9650\u3001\u57fa\u7ebf\u3001\u649e\u5899\u70b9\u3001\u4ee5\u53ca\u5e26\u4e0a\u9884\u7559\u4e4b\u540e\u7684\u7b54\u6848\u3002<\/p>\n<h4>\u4e09\u6b65\u91cf\u51fa\u4e09\u4e2a\u5e38\u6570<\/h4>\n<p>\u7b2c\u4e00\u6b65\u628a\u8f6f\u4e0a\u9650\u538b\u5230\u4e00\u4e2a\u597d\u7b97\u7684\u503c&#xff0c;\u540c\u65f6\u8bfb\u51fa\u786c\u4e0a\u9650&#xff0c;\u786e\u8ba4\u538b\u5f97\u4e0b\u53bb&#xff1b;\u7b2c\u4e8c\u6b65\u4e00\u7ec4\u4e00\u7ec4\u5730\u5360\u3001\u4e0d\u91ca\u653e&#xff0c;\u76f4\u5230\u5206\u914d\u5931\u8d25&#xff0c;\u8bb0\u4e0b\u6210\u529f\u4e86\u591a\u5c11\u7ec4&#xff1b;\u7b2c\u4e09\u6b65\u6539\u6210\u7528\u5b8c\u5373\u5173&#xff0c;\u540c\u6837\u8dd1 1000 \u6b21&#xff0c;\u770b fd \u6570\u6709\u6ca1\u6709\u56de\u5230\u57fa\u7ebf\u3002\u4e09\u6b65\u90fd\u5728\u540c\u4e00\u4e2a\u8fdb\u7a0b\u91cc\u505a\u5b8c&#xff0c;\u4e2d\u95f4\u4e0d\u9700\u8981\u91cd\u542f\u3002<\/p>\n<p>&#x1f9ea; \u5b9e\u6d4b\u73af\u5883&#xff1a;Python 3.13.12 \/ macOS \/ \u4ec5\u7528\u6807\u51c6\u5e93<\/p>\n<p><span class=\"token keyword\">import<\/span> os<br \/>\n<span class=\"token keyword\">import<\/span> resource<br \/>\n<span class=\"token keyword\">import<\/span> socket<\/p>\n<p><span class=\"token keyword\">def<\/span> <span class=\"token function\">fd_count<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>os<span class=\"token punctuation\">.<\/span>listdir<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\/dev\/fd&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>soft<span class=\"token punctuation\">,<\/span> hard <span class=\"token operator\">&#061;<\/span> resource<span class=\"token punctuation\">.<\/span>getrlimit<span class=\"token punctuation\">(<\/span>resource<span class=\"token punctuation\">.<\/span>RLIMIT_NOFILE<span class=\"token punctuation\">)<\/span><br \/>\nresource<span class=\"token punctuation\">.<\/span>setrlimit<span class=\"token punctuation\">(<\/span>resource<span class=\"token punctuation\">.<\/span>RLIMIT_NOFILE<span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token number\">512<\/span><span class=\"token punctuation\">,<\/span> hard<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\nlimit<span class=\"token punctuation\">,<\/span> _ <span class=\"token operator\">&#061;<\/span> resource<span class=\"token punctuation\">.<\/span>getrlimit<span class=\"token punctuation\">(<\/span>resource<span class=\"token punctuation\">.<\/span>RLIMIT_NOFILE<span class=\"token punctuation\">)<\/span><br \/>\nbase <span class=\"token operator\">&#061;<\/span> fd_count<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u8f6f\u4e0a\u9650 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>limit<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#xff0c;\u542f\u52a8\u57fa\u7ebf\u5360\u7528 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>base<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u4e2a fd&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>held<span class=\"token punctuation\">,<\/span> iters <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><br \/>\n<span class=\"token keyword\">try<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">while<\/span> iters <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">1000<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        held<span class=\"token punctuation\">.<\/span>append<span class=\"token punctuation\">(<\/span>socket<span class=\"token punctuation\">.<\/span>socketpair<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span>   <span class=\"token comment\"># \u6bcf\u6b21\u8bf7\u6c42\u5360 2 \u4e2a fd&#xff0c;\u5fd8\u4e86\u5173<\/span><br \/>\n        iters <span class=\"token operator\">&#043;&#061;<\/span> <span class=\"token number\">1<\/span><br \/>\n<span class=\"token keyword\">except<\/span> OSError <span class=\"token keyword\">as<\/span> e<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u4e0d\u91ca\u653e&#xff1a;\u6210\u529f\u5360\u7528 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token builtin\">len<\/span><span class=\"token punctuation\">(<\/span>held<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u7ec4\u540e&#xff0c;\u7b2c <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>iters <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u6b21\u5206\u914d\u5931\u8d25&#xff0c;\u9519\u8bef\u7c7b\u578b <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token builtin\">type<\/span><span class=\"token punctuation\">(<\/span>e<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>__name__<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u4e0d\u91ca\u653e&#xff1a;\u53ef\u7528 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>limit <span class=\"token operator\">&#8211;<\/span> base<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u4e2a&#xff0c;\u6bcf\u7ec4 2 \u4e2a&#xff0c;\u7406\u8bba\u88c5\u6ee1 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">(<\/span>limit <span class=\"token operator\">&#8211;<\/span> base<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/\/<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> \u7ec4&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">for<\/span> pair <span class=\"token keyword\">in<\/span> held<span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">for<\/span> s <span class=\"token keyword\">in<\/span> pair<span class=\"token punctuation\">:<\/span><br \/>\n        s<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token keyword\">for<\/span> _ <span class=\"token keyword\">in<\/span> <span class=\"token builtin\">range<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">1000<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    a<span class=\"token punctuation\">,<\/span> b <span class=\"token operator\">&#061;<\/span> socket<span class=\"token punctuation\">.<\/span>socketpair<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span>             <span class=\"token comment\"># \u7528\u5b8c\u7acb\u523b\u5173\u95ed<\/span><br \/>\n    a<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n    b<span class=\"token punctuation\">.<\/span>close<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u6b63\u786e\u91ca\u653e&#xff1a;\u8fde\u8dd1 1000 \u6b21\u540e fd \u6570\u4ecd\u4e3a <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>fd_count<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>fds_per_req<span class=\"token punctuation\">,<\/span> reserve <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">16<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string-interpolation\"><span class=\"token string\">f&#034;\u9884\u7b97\u516c\u5f0f&#xff1a;\u5e76\u53d1\u4e0a\u9650 &#061; (<\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>limit<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> &#8211; <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>base<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> &#8211; \u9884\u7559 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>reserve<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">) \/ \u6bcf\u8bf7\u6c42 <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span>fds_per_req<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\"> &#034;<\/span><\/span><br \/>\n      <span class=\"token string-interpolation\"><span class=\"token string\">f&#034;&#061; <\/span><span class=\"token interpolation\"><span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">(<\/span>limit <span class=\"token operator\">&#8211;<\/span> base <span class=\"token operator\">&#8211;<\/span> reserve<span class=\"token punctuation\">)<\/span> <span class=\"token operator\">\/\/<\/span> fds_per_req<span class=\"token punctuation\">}<\/span><\/span><span class=\"token string\">&#034;<\/span><\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>\u8f6f\u4e0a\u9650 512&#xff0c;\u542f\u52a8\u57fa\u7ebf\u5360\u7528 4 \u4e2a fd<br \/>\n\u4e0d\u91ca\u653e&#xff1a;\u6210\u529f\u5360\u7528 254 \u7ec4\u540e&#xff0c;\u7b2c 255 \u6b21\u5206\u914d\u5931\u8d25&#xff0c;\u9519\u8bef\u7c7b\u578b OSError<br \/>\n\u4e0d\u91ca\u653e&#xff1a;\u53ef\u7528 508 \u4e2a&#xff0c;\u6bcf\u7ec4 2 \u4e2a&#xff0c;\u7406\u8bba\u88c5\u6ee1 254 \u7ec4<br \/>\n\u6b63\u786e\u91ca\u653e&#xff1a;\u8fde\u8dd1 1000 \u6b21\u540e fd \u6570\u4ecd\u4e3a 4<br \/>\n\u9884\u7b97\u516c\u5f0f&#xff1a;\u5e76\u53d1\u4e0a\u9650 &#061; (512 &#8211; 4 &#8211; \u9884\u7559 16) \/ \u6bcf\u8bf7\u6c42 2 &#061; 246<\/p>\n<h4>\u8f93\u51fa\u91cc\u90a3\u56db\u4e2a\u6570\u5b57\u5206\u522b\u5728\u8bf4\u4ec0\u4e48<\/h4>\n<p>\u7b2c\u4e00\u884c\u7684 512 \u548c 4 \u662f\u516c\u5f0f\u7684\u5206\u5b50&#xff1a;\u8f6f\u4e0a\u9650\u548c\u57fa\u7ebf\u3002\u8fd9\u4e24\u4e2a\u6570\u6362\u53f0\u673a\u5668\u3001\u6362\u4e2a\u542f\u52a8\u65b9\u5f0f\u5c31\u4f1a\u53d8&#xff0c;\u6240\u4ee5\u5fc5\u987b\u81ea\u5df1\u8dd1\u4e00\u6b21&#xff0c;\u6284\u522b\u4eba\u7684\u6ca1\u6709\u610f\u4e49\u3002<\/p>\n<p>\u7b2c\u4e8c\u884c\u7684 254 \u548c 255 \u662f&#034;\u521a\u597d\u88c5\u6ee1&#034;\u7684\u8bc1\u636e&#xff0c;\u5fc5\u987b\u8fde\u7740\u8bfb\u3002254 \u7ec4\u7528\u6389 508 \u4e2a fd&#xff0c;\u6b63\u597d\u7b49\u4e8e 512 \u51cf 4&#xff1b;\u7b2c 255 \u6b21\u8981 2 \u4e2a&#xff0c;\u624b\u4e0a\u4e00\u4e2a\u90fd\u6ca1\u6709&#xff0c;\u4e8e\u662f\u5206\u914d\u5931\u8d25\u3002\u524d\u4e00\u4e2a\u6570\u5b57\u544a\u8bc9\u4f60\u6700\u591a\u80fd\u88c5\u591a\u5c11&#xff0c;\u540e\u4e00\u4e2a\u544a\u8bc9\u4f60\u4ece\u54ea\u4e00\u6b21\u5f00\u59cb\u88c5\u4e0d\u4e0b\u3002<\/p>\n<p>\u7b2c\u4e09\u884c\u662f\u628a\u7406\u8bba\u503c\u518d\u8bf4\u4e00\u904d&#xff0c;\u9632\u6b62\u4f60\u628a&#034;\u6210\u529f\u5360\u7528&#034;\u548c&#034;\u7406\u8bba\u88c5\u6ee1&#034;\u5f53\u6210\u4e24\u56de\u4e8b\u2014\u2014\u5b83\u4eec\u5728\u8fd9\u91cc\u6570\u503c\u76f8\u540c&#xff0c;\u662f\u56e0\u4e3a 512 \u51cf 4 \u6070\u597d\u80fd\u88ab 2 \u6574\u9664\u3002\u6362\u4e2a\u4e0d\u80fd\u88ab\u6574\u9664\u7684\u4e0a\u9650&#xff0c;\u8fd9\u4e24\u4e2a\u6570\u5c31\u4f1a\u5dee\u4e00\u7ec4&#xff0c;\u90a3\u65f6\u5019\u5dee\u7684\u90a3\u4e00\u7ec4\u5c31\u662f\u53d6\u6574\u5403\u6389\u7684\u7a7a\u95f4\u3002<\/p>\n<p>\u7b2c\u56db\u884c\u7684 4 \u662f&#034;\u5173\u6389\u5c31\u56de\u6765&#034;\u7684\u8bc1\u636e\u3002\u8fd9\u4e00\u884c\u6bd4\u524d\u51e0\u884c\u90fd\u503c\u5f97\u6284\u8fdb\u4f60\u7684\u5de1\u68c0\u811a\u672c&#xff1a;\u5b83\u7ed9\u51fa\u7684\u662f\u8fd9\u53f0\u673a\u5668\u3001\u8fd9\u4e2a\u6846\u67b6\u4e0b\u7684\u57fa\u7ebf&#xff0c;\u4ee5\u540e\u4efb\u4f55\u65f6\u5019 fd \u6570\u660e\u663e\u9ad8\u8fc7\u5b83\u4e14\u4e0d\u56de\u843d&#xff0c;\u5c31\u662f\u6cc4\u6f0f\u3002<\/p>\n<p>\u7b2c\u4e94\u884c\u624d\u662f\u53ef\u4ee5\u5199\u8fdb\u914d\u7f6e\u7684\u6570&#xff1a;246\u3002<\/p>\n<h4>254 \u5230 246 \u5dee\u7684\u4e0d\u662f 8 \u4e2a\u8bf7\u6c42&#xff0c;\u662f\u7a81\u53d1\u7a7a\u95f4<\/h4>\n<p>\u4e24\u8005\u76f8\u5dee 8 \u7ec4&#xff0c;\u6b63\u597d\u662f\u9884\u7559\u7684 16 \u9664\u4ee5\u6bcf\u8bf7\u6c42\u7684 2\u3002\u8fd9 8 \u7ec4\u4e0d\u662f&#034;\u591a\u63a5 8 \u4e2a\u8bf7\u6c42&#034;\u7684\u4f59\u91cf&#xff0c;\u800c\u662f\u5728\u5df2\u7ecf\u8dd1\u6ee1\u7684\u65f6\u5019&#xff0c;\u8fd8\u80fd\u817e\u51fa\u624b\u6765\u5199\u4e00\u884c\u65e5\u5fd7\u3001\u63a5\u4e00\u4e2a\u5065\u5eb7\u68c0\u67e5\u3001\u91cd\u5efa\u4e00\u6761\u65ad\u6389\u7684\u4e0a\u6e38\u8fde\u63a5\u3002<\/p>\n<p>\u6ca1\u6709\u8fd9 8 \u7ec4&#xff0c;\u670d\u52a1\u4e0d\u4f1a\u5728 254 \u4e2a\u8bf7\u6c42\u65f6\u793c\u8c8c\u5730\u62d2\u7edd&#xff0c;\u800c\u662f\u5728\u7b2c 255 \u4e2a\u8bf7\u6c42\u5230\u6765\u65f6\u8fde\u9519\u8bef\u4fe1\u606f\u90fd\u53d1\u4e0d\u51fa\u53bb\u2014\u2014\u56e0\u4e3a\u53d1\u9519\u8bef\u4fe1\u606f\u4e5f\u8981 fd\u3002\u8fd9\u662f\u53e5\u67c4\u7c7b\u6545\u969c\u6700\u96be\u770b\u7684\u5730\u65b9&#xff1a;\u5b83\u4e0d\u7ed9\u4f60\u7559\u4e0b\u89e3\u91ca\u7684\u673a\u4f1a\u3002<\/p>\n<p>\u8fd9\u4efd\u8d44\u6599\u662f\u4ec0\u4e48&#xff1a;\u4e00\u5f20\u628a&#034;\u4e0a\u9650\u3001\u57fa\u7ebf\u3001\u9884\u7559\u3001\u6bcf\u8bf7\u6c42\u5360\u7528&#034;\u56db\u4ef6\u4e8b\u4e32\u8d77\u6765\u7684\u5bb9\u91cf\u4f30\u7b97\u6e05\u5355&#xff0c;\u914d\u5408\u672c\u6587\u7684\u516c\u5f0f\u586b\u4e00\u904d\u5c31\u80fd\u843d\u5230\u4f60\u81ea\u5df1\u7684\u670d\u52a1\u4e0a\u3002\u653e\u5728\u8d44\u6599\u5305\u91cc&#xff0c;\u626b\u7801\u5373\u53ef\u83b7\u53d6&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225719-6aefaccf69806.png\" alt=\"\u914d\u5957\u8d44\u6599\u83b7\u53d6\" \/><\/p>\n<h3>\u6309\u73b0\u8c61\u6392\u969c&#xff1a;\u770b\u5230\u4ec0\u4e48\u73b0\u8c61\u5c31\u6539\u54ea\u4e00\u5c42<\/h3>\n<p>\u53e5\u67c4\u7c7b\u6545\u969c\u53ea\u6709\u4e09\u79cd\u5f62\u72b6&#xff0c;\u5f62\u72b6\u51b3\u5b9a\u4e86\u4f60\u8be5\u6539\u7684\u662f\u4ee3\u7801\u3001\u662f k\u3001\u8fd8\u662f\u4e0a\u9650\u3002\u6539\u9519\u5c42\u7684\u4ee3\u4ef7\u662f\u53cd\u590d\u8fd4\u5de5&#xff0c;\u56e0\u4e3a\u6539\u5b8c\u8fd8\u4f1a\u4ee5\u540c\u6837\u7684\u5f62\u72b6\u56de\u6765\u3002<\/p>\n<h4>\u4e09\u79cd\u73b0\u8c61\u5bf9\u5e94\u4e09\u5c42<\/h4>\n<table>\n<tr>\u73b0\u8c61\u66f4\u53ef\u80fd\u7684\u539f\u56e0\u5148\u6539\u54ea\u4e00\u5c42\u5177\u4f53\u5904\u7f6e<\/tr>\n<tbody>\n<tr>\n<td>\u91cd\u542f\u540e\u80fd\u8dd1&#xff0c;\u8dd1\u4e00\u9635\u624d\u5f00\u59cb\u5931\u8d25&#xff0c;\u5931\u8d25\u524d fd \u6570\u5355\u8c03\u4e0a\u5347<\/td>\n<td>\u67d0\u6761\u8def\u5f84\u6f0f\u5173<\/td>\n<td>\u4ee3\u7801<\/td>\n<td>\u538b 1000 \u6b21\u8bf7\u6c42&#xff0c;\u5bf9\u6bd4\u7ed3\u675f\u65f6\u7684 fd \u6570\u4e0e\u57fa\u7ebf<\/td>\n<\/tr>\n<tr>\n<td>\u4e00\u4e0a\u7ebf\u5c31\u5931\u8d25&#xff0c;\u51e0\u5341\u4e2a\u5e76\u53d1\u5c31\u649e<\/td>\n<td>k \u592a\u5927&#xff0c;\u6bcf\u8bf7\u6c42\u5360 3 \u4e2a\u4ee5\u4e0a<\/td>\n<td>\u8bf7\u6c42\u8def\u5f84<\/td>\n<td>\u628a\u4e0a\u6e38\u8fde\u63a5\u6539\u6210\u6c60&#xff0c;\u8ba9 k \u91cc\u7684\u53ef\u53d8\u9879\u53d8\u6210\u5e38\u6570<\/td>\n<\/tr>\n<tr>\n<td>\u8f6f\u4e0a\u9650\u5df2\u7ecf\u8d34\u7740\u786c\u4e0a\u9650&#xff0c;\u8c03\u4e0d\u52a8<\/td>\n<td>\u4e0a\u9650\u672c\u8eab\u592a\u5c0f<\/td>\n<td>\u8fd0\u884c\u73af\u5883<\/td>\n<td>\u5148\u538b k \u4e0e\u9884\u7559&#xff0c;\u518d\u8003\u8651\u63d0\u786c\u4e0a\u9650<\/td>\n<\/tr>\n<tr>\n<td>\u53ea\u5728\u9ad8\u5cf0\u671f\u5931\u8d25&#xff0c;\u5e73\u65f6\u6b63\u5e38<\/td>\n<td>\u6ca1\u6709\u7559\u9884\u7559<\/td>\n<td>\u9884\u7b97<\/td>\n<td>\u6309\u516c\u5f0f\u91cd\u7b97&#xff0c;\u9884\u7559\u53d6 k \u7684 8 \u500d\u4ee5\u4e0a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u56db\u884c\u7684\u8bfb\u6cd5\u662f\u4e00\u6837\u7684&#xff1a;\u5148\u770b fd \u6570\u968f\u65f6\u95f4\u7684\u5f62\u72b6&#xff0c;\u518d\u770b\u5931\u8d25\u53d1\u751f\u7684\u65f6\u95f4\u70b9\u3002\u5355\u8c03\u4e0a\u5347\u662f\u6cc4\u6f0f&#xff0c;\u4e00\u4e0a\u6765\u5c31\u649e\u662f k \u592a\u5927&#xff0c;\u8c03\u4e0d\u52a8\u662f\u4e0a\u9650\u5230\u9876&#xff0c;\u53ea\u5728\u9ad8\u5cf0\u649e\u662f\u6ca1\u7559\u4f59\u91cf\u3002\u5f62\u72b6\u5bf9\u4e86&#xff0c;\u6539\u7684\u5730\u65b9\u5c31\u53ea\u6709\u4e00\u4e2a\u3002<\/p>\n<h4>\u4ec0\u4e48\u65f6\u5019\u8be5\u4e0a\u8fde\u63a5\u6c60&#xff0c;\u4ec0\u4e48\u65f6\u5019\u53ea\u6539\u6570\u5b57<\/h4>\n<p>\u8fde\u63a5\u6c60\u53ea\u505a\u4e00\u4ef6\u4e8b&#xff1a;\u628a&#034;\u6bcf\u4e2a\u8bf7\u6c42\u5411\u4e0a\u6e38\u8981\u4e00\u4e2a fd&#034;\u6539\u6210&#034;\u56fa\u5b9a\u82e5\u5e72\u6761\u8fde\u63a5\u53cd\u590d\u501f\u8fd8&#034;\u3002\u539f\u6765 k \u91cc\u90a3\u4e00\u9879\u968f\u5e76\u53d1\u7ebf\u6027\u589e\u957f&#xff0c;\u8fdb\u6c60\u4e4b\u540e\u5b83\u53d8\u6210\u4e00\u4e2a\u5e38\u6570\u9879&#xff0c;\u4ece\u516c\u5f0f\u7684\u5206\u5b50\u91cc\u88ab\u632a\u8d70\u4e86\u2014\u2014\u8fd9\u5c31\u662f\u6c60\u5b50\u80fd\u63d0\u5bb9\u91cf\u7684\u771f\u5b9e\u539f\u56e0&#xff0c;\u4e0d\u662f\u5b83\u66f4\u5feb&#xff0c;\u662f\u5b83\u628a\u4e58\u6cd5\u53d8\u6210\u4e86\u52a0\u6cd5\u3002<\/p>\n<p>\u5224\u65ad\u6761\u4ef6\u4e5f\u5c31\u4e00\u6761&#xff1a;\u6570\u4e00\u4e0b k \u91cc\u4e0a\u6e38\u8fde\u63a5\u5360\u7684\u6bd4\u4f8b\u3002\u8d85\u8fc7\u4e00\u534a&#xff0c;\u4e0a\u6c60&#xff1b;\u4e0d\u5230\u4e00\u534a&#xff0c;\u5148\u628a\u6cc4\u6f0f\u4fee\u6389\u3002\u6c60\u5b50\u6cbb\u4e0d\u4e86\u6cc4\u6f0f&#xff0c;\u53ea\u4f1a\u628a\u6cc4\u6f0f\u70b9\u4ece&#034;\u6bcf\u8bf7\u6c42\u4e00\u6b21&#034;\u53d8\u6210&#034;\u6bcf\u6761\u8fde\u63a5\u4e00\u6b21&#034;\u2014\u2014\u75c7\u72b6\u53d8\u6162&#xff0c;\u4f46\u6ca1\u6d88\u5931&#xff0c;\u800c\u4e14\u66f4\u96be\u67e5&#xff0c;\u56e0\u4e3a\u5b83\u4e0d\u518d\u968f\u8bf7\u6c42\u6570\u7ebf\u6027\u4e0a\u5347\u3002<\/p>\n<h4>\u9608\u503c\u53d6\u591a\u5c11&#xff0c;\u4ec0\u4e48\u65f6\u5019\u505c\u624b<\/h4>\n<p>\u4e09\u6761\u80fd\u76f4\u63a5\u6284\u7684&#xff1a;<\/p>\n<li>\u544a\u8b66\u7ebf\u53d6\u516c\u5f0f\u503c\u7684\u516b\u6210\u3002 \u672c\u6587\u8fd9\u7ec4\u6570\u662f 246&#xff0c;\u516b\u6210\u5c31\u662f 197 \u9644\u8fd1&#xff0c;\u843d\u5230\u76d1\u63a7\u4e0a\u53d6\u6574\u6210 200 \u89e6\u53d1&#xff0c;\u7559\u51fa\u4eba\u5de5\u4ecb\u5165\u7684\u65f6\u95f4\u3002<\/li>\n<li>\u9884\u7559\u53d6 k \u7684 8 \u500d&#xff0c;\u4e14\u4e0d\u5c0f\u4e8e 16\u3002 k&#061;2 \u65f6\u662f 16&#xff0c;k&#061;3 \u65f6\u662f 24&#xff1b;\u5c0f\u4e8e 16 \u7684\u8bdd&#xff0c;\u4e00\u6b21\u65e5\u5fd7\u8f6e\u8f6c\u52a0\u4e00\u6b21\u5065\u5eb7\u68c0\u67e5\u5c31\u80fd\u628a\u4f59\u91cf\u5403\u5e72\u51c0\u3002<\/li>\n<li>\u505c\u624b\u6761\u4ef6&#xff1a;\u538b 1000 \u6b21\u8bf7\u6c42\u540e fd \u6570\u56de\u5230\u57fa\u7ebf\u4e0a\u4e0b 2 \u4ee5\u5185&#xff0c;\u4e14\u5cf0\u503c\u4e0d\u8d85\u8fc7\u544a\u8b66\u7ebf\u3002 \u4e24\u6761\u540c\u65f6\u6ee1\u8db3\u5c31\u4e0d\u7528\u518d\u52a8\u4e0a\u9650&#xff0c;\u5bb9\u91cf\u95ee\u9898\u5df2\u7ecf\u5728\u7b97\u672f\u5c42\u9762\u89e3\u51b3\u4e86&#xff1b;\u53ea\u6ee1\u8db3\u524d\u4e00\u6761\u8bf4\u660e k \u8fd8\u662f\u504f\u5927&#xff0c;\u8be5\u53bb\u538b\u8bf7\u6c42\u8def\u5f84\u3002<\/li>\n<p>\u6700\u540e\u7ed9\u4e00\u4e2a\u5224\u65ad\u987a\u5e8f&#xff0c;\u9047\u5230&#034;\u5e76\u53d1\u4e0a\u4e0d\u53bb&#034;\u5c31\u7167\u7740\u8d70&#xff1a;\u5148\u8bfb\u8f6f\u4e0a\u9650\u548c\u57fa\u7ebf&#xff0c;\u7b97\u51fa\u516c\u5f0f\u503c&#xff1b;\u518d\u538b 1000 \u6b21&#xff0c;\u770b fd \u6570\u56de\u4e0d\u56de\u843d&#xff1b;\u56de\u843d\u5c31\u628a\u5e76\u53d1\u4e0a\u9650\u914d\u6210\u516c\u5f0f\u503c\u3001\u544a\u8b66\u7ebf\u914d\u6210\u516b\u6210&#xff1b;\u4e0d\u56de\u843d\u5c31\u5148\u4fee\u6cc4\u6f0f&#xff0c;\u4fee\u5b8c\u518d\u91cd\u7b97\u3002\u4ec0\u4e48\u65f6\u5019\u8be5\u4e0a\u8fde\u63a5\u6c60&#xff0c;\u770b\u4f60\u6570\u51fa\u6765\u7684 k \u91cc\u4e0a\u6e38\u5360\u51e0\u6210&#xff0c;\u8d85\u8fc7\u4e00\u534a\u518d\u4e0a\u2014\u2014\u4e0d\u5230\u4e00\u534a\u5c31\u4e0a\u6c60&#xff0c;\u7b49\u4e8e\u82b1\u94b1\u628a\u4e00\u4e2a\u4ee3\u7801\u95ee\u9898\u85cf\u8d77\u6765\u3002<\/p>\n<p>\u8fd9\u4efd\u8d44\u6599\u662f\u4ec0\u4e48&#xff1a;\u4e00\u4efd\u6309&#034;\u73b0\u8c61 \u2192 \u539f\u56e0 \u2192 \u5904\u7f6e&#034;\u6574\u7406\u7684\u670d\u52a1\u5bb9\u91cf\u6392\u969c\u6e05\u5355&#xff0c;\u548c\u4e0a\u9762\u8fd9\u5f20\u8868\u662f\u540c\u4e00\u5957\u53e3\u5f84&#xff0c;\u53ef\u4ee5\u76f4\u63a5\u5bf9\u7740\u52fe\u3002\u653e\u5728\u8d44\u6599\u5305\u91cc&#xff0c;\u626b\u7801\u5373\u53ef\u83b7\u53d6&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225719-6aefaccf69806.png\" alt=\"\u914d\u5957\u8d44\u6599\u83b7\u53d6\" \/><\/p>\n<h3>\u9644\u8868 A&#xff1a;\u672c\u6587\u5f15\u7528\u4e8b\u5b9e\u4e0e\u51fa\u5904\u5bf9\u7167\u8868<\/h3>\n<table>\n<tr>\u4e8b\u5b9e\u51fa\u5904\u672c\u6587\u4f4d\u7f6e<\/tr>\n<tbody>\n<tr>\n<td>\u6bcf\u79cd\u8d44\u6e90\u7531\u8f6f\u4e0a\u9650\u4e0e\u786c\u4e0a\u9650\u4e00\u5bf9\u503c\u63a7\u5236&#xff0c;\u8f6f\u4e0a\u9650\u662f\u5f53\u524d\u751f\u6548\u503c\u3001\u8fdb\u7a0b\u53ef\u8c03&#xff0c;\u4e14\u6c38\u8fdc\u4e0d\u80fd\u8d85\u8fc7\u786c\u4e0a\u9650<\/td>\n<td>Python \u6587\u6863 resource&#xff0c;Python Software Foundation&#xff0c;https:\/\/docs.python.org\/3\/library\/resource.html&#xff08;2026-11-08 \u6293\u53d6&#xff09;<\/td>\n<td>\u7b2c 1 \u7ae0\u300c\u8f6f\u4e0a\u9650\u662f\u6b64\u523b\u751f\u6548\u7684\u7ebf\u300d<\/td>\n<\/tr>\n<tr>\n<td>RLIMIT_NOFILE \u6307\u5f53\u524d\u8fdb\u7a0b\u53ef\u6253\u5f00\u7684\u6587\u4ef6\u63cf\u8ff0\u7b26\u6700\u5927\u6570\u91cf<\/td>\n<td>\u540c\u4e0a&#xff08;2026-11-08 \u6293\u53d6&#xff09;<\/td>\n<td>\u7b2c 1 \u7ae0\u300c\u53e5\u67c4\u662f\u8fdb\u7a0b\u624b\u91cc\u7684\u63d2\u5ea7\u300d<\/td>\n<\/tr>\n<tr>\n<td>\u8f6f\u4e0a\u9650 512\u3001\u57fa\u7ebf 4 \u65f6&#xff0c;\u4e0d\u91ca\u653e\u7684\u7b2c 255 \u6b21\u5206\u914d\u5931\u8d25&#xff0c;\u7406\u8bba\u88c5\u6ee1 254 \u7ec4<\/td>\n<td>\u672c\u6587\u5b9e\u8dd1 work\/exp1108\/e03_fd.py \u7684\u771f\u5b9e\u8f93\u51fa<\/td>\n<td>\u7b2c 4 \u7ae0\u5b9e\u6d4b\u5757<\/td>\n<\/tr>\n<tr>\n<td>\u6b63\u786e\u91ca\u653e\u65f6\u8fde\u8dd1 1000 \u6b21\u540e fd \u6570\u4ecd\u4e3a 4<\/td>\n<td>\u540c\u4e0a<\/td>\n<td>\u7b2c 3 \u7ae0\u300c\u60f3\u8c03\u5927\u4e0a\u9650\u4e4b\u524d\u300d\u3001\u7b2c 4 \u7ae0<\/td>\n<\/tr>\n<tr>\n<td>\u9884\u7b97\u516c\u5f0f (512 \u2212 4 \u2212 16) \u00f7 2 &#061; 246<\/td>\n<td>\u540c\u4e0a&#xff08;\u811a\u672c\u7b2c\u4e94\u884c\u8f93\u51fa&#xff09;<\/td>\n<td>\u7b2c 3 \u7ae0\u516c\u5f0f\u4e0e\u7b97\u4f8b\u8868<\/td>\n<\/tr>\n<tr>\n<td>\u8bf7\u6c42\u6570 50\/100\/200\/400 \u65f6&#xff0c;\u672a\u91ca\u653e\u7684 fd \u6570\u4e3a 104\/204\/404\/804&#xff0c;\u6b63\u786e\u91ca\u653e\u65f6\u6052\u4e3a 4<\/td>\n<td>\u672c\u6587\u5b9e\u8dd1 work\/exp1108\/e03b_curve.py \u7684\u771f\u5b9e\u8f93\u51fa<\/td>\n<td>\u7b2c 2 \u7ae0\u5b9e\u6d4b\u5757<\/td>\n<\/tr>\n<tr>\n<td>\u672c\u6587\u5b9e\u6d4b\u73af\u5883\u4e3a Python 3.13.12 \/ macOS \/ \u4ec5\u7528\u6807\u51c6\u5e93<\/td>\n<td>\u672c\u5730\u5b9e\u8dd1\u8bb0\u5f55&#xff08;2026-11-08&#xff09;<\/td>\n<td>\u4e24\u5904\u5b9e\u6d4b\u5757\u7684\u8fd0\u884c\u73af\u5883\u6807\u6ce8<\/td>\n<\/tr>\n<tr>\n<td>\u975e macOS \u7cfb\u7edf\u4e0a\u8bfb\u53d6\u8fdb\u7a0b fd \u7684\u7b49\u4ef7\u8def\u5f84<\/td>\n<td>\u672a\u5728\u672c\u6587\u6838\u9a8c&#xff0c;\u6807\u5f85\u9a8c\u8bc1<\/td>\n<td>\u7b2c 3 \u7ae0\u672b\u300c\u987a\u5e26\u8bf4\u660e\u300d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u9644\u8868 B&#xff1a;\u672f\u8bed\u901f\u67e5\u8868<\/h3>\n<table>\n<tr>\u672f\u8bed\u4e00\u53e5\u8bdd\u89e3\u91ca\u5728\u672c\u6587\u54ea\u91cc\u7528\u5230<\/tr>\n<tbody>\n<tr>\n<td>\u6587\u4ef6\u63cf\u8ff0\u7b26&#xff08;fd&#xff09;<\/td>\n<td>\u8fdb\u7a0b\u6253\u5f00\u6587\u4ef6\u3001\u5957\u63a5\u5b57\u7b49\u5bf9\u8c61\u540e\u62ff\u5230\u7684\u6574\u6570\u7f16\u53f7&#xff0c;\u8bfb\u5199\u90fd\u9760\u5b83<\/td>\n<td>\u5168\u7bc7&#xff0c;\u5c24\u5176\u662f\u7b2c 1 \u7ae0\u7684\u63d2\u5ea7\u6bd4\u55bb<\/td>\n<\/tr>\n<tr>\n<td>\u8f6f\u4e0a\u9650 \/ \u786c\u4e0a\u9650<\/td>\n<td>\u8f6f\u4e0a\u9650\u662f\u6b64\u523b\u751f\u6548\u3001\u8fdb\u7a0b\u53ef\u8c03\u7684\u90a3\u6761\u7ebf&#xff1b;\u786c\u4e0a\u9650\u662f\u5b83\u8c03\u4e0d\u8fc7\u53bb\u7684\u5929\u82b1\u677f<\/td>\n<td>\u7b2c 1 \u7ae0\u3001\u7b2c 3 \u7ae0\u516c\u5f0f\u7684\u7b2c\u4e00\u9879<\/td>\n<\/tr>\n<tr>\n<td>\u8fde\u63a5\u6c60<\/td>\n<td>\u9884\u5148\u5efa\u597d\u4e00\u6279\u4e0a\u6e38\u8fde\u63a5\u53cd\u590d\u501f\u8fd8&#xff0c;\u628a\u6bcf\u8bf7\u6c42\u7684\u8fde\u63a5\u5f00\u9500\u53d8\u6210\u56fa\u5b9a\u5f00\u9500<\/td>\n<td>\u7b2c 5 \u7ae0\u300c\u4ec0\u4e48\u65f6\u5019\u8be5\u4e0a\u8fde\u63a5\u6c60\u300d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<p>\u5199\u5728\u6700\u540e&#xff1a;\u8fd9\u7bc7\u7528\u5230\u7684\u8d44\u6599<\/p>\n<p>\u5199\u8fd9\u7bc7\u6587\u7ae0\u65f6&#xff0c;\u628a\u76f8\u5173\u7684\u5b98\u65b9\u6587\u6863\u548c\u6e90\u7801\u53c8\u7ffb\u4e86\u4e00\u904d&#xff0c;\u987a\u624b\u4e5f\u6574\u7406\u4e86\u51e0\u4efd\u914d\u5957\u7684\u4e1c\u897f&#xff1a;<\/p>\n<ul>\n<li>\u5927\u6a21\u578b\u5b66\u4e60\u8def\u7ebf\u56fe&#xff1a;\u4ece\u96f6\u57fa\u7840\u5230\u80fd\u81ea\u5df1\u52a8\u624b\u505a Agent&#xff0c;\u6309\u9636\u6bb5\u8bf4\u660e\u6bcf\u4e00\u6b65\u8be5\u5b66\u4ec0\u4e48\u3001\u54ea\u4e9b\u53ef\u4ee5\u5148\u8df3\u8fc7<\/li>\n<li>\u300aLangChain &#043; LangGraph &#043; MCP \u667a\u80fd\u4f53\u5f00\u53d1\u5b9e\u6218\u300b\u89c6\u9891\u8bfe&#xff1a;7 \u4e2a\u6a21\u5757&#xff0c;\u4ece\u79c1\u6709\u5316\u90e8\u7f72\u3001Embedding&#043;RAG \u5230 MCP&#043;Agent \u5168\u6d41\u7a0b<\/li>\n<li>AI \u5927\u6a21\u578b\u77e5\u8bc6\u5e93&#xff08;\u5728\u7ebf\u53ef\u67e5&#xff09;&#xff1a;Agent Skills \u4ece\u5165\u95e8\u5230\u843d\u5730\u3001Claude Skills \u5b8c\u5168\u6307\u5357\u7b49\u4e13\u9898&#xff0c;\u6309\u76ee\u5f55\u6d4f\u89c8\u5373\u53ef<\/li>\n<li>640 \u5957 AI \u5927\u6a21\u578b\u884c\u4e1a\u62a5\u544a &#043; \u7ecf\u5178 PDF \u4e66\u7c4d&#xff1a;\u770b\u884c\u4e1a\u843d\u5730\u6848\u4f8b\u548c\u522b\u4eba\u600e\u4e48\u505a\u7684\u65f6\u5019\u7528\u5f97\u4e0a<\/li>\n<li>\u5927\u6a21\u578b\u96f6\u57fa\u7840\u5230\u7cbe\u901a\u6559\u5b66\u89c6\u9891&#xff1a;\u8ddf\u7740\u6572\u4e00\u904d&#xff0c;\u6bd4\u53ea\u8bfb\u6587\u6863\u5feb\u5f97\u591a<\/li>\n<\/ul>\n<p>\u8d44\u6599\u662f\u6211\u81ea\u5df1\u6574\u7406\u7684&#xff0c;\u653e\u5728\u4e0b\u9762\u8fd9\u4e2a\u7801\u4e0a&#xff0c;\u626b\u7801\u5373\u53ef\u83b7\u53d6&#xff1a;<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225719-6aefaccf69806.png\" alt=\"\u914d\u5957\u8d44\u6599\u83b7\u53d6\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225720-6aefacd031642.png\" alt=\"\u8bfe\u7a0b\u76ee\u5f55\uff1a\u79c1\u6709\u5316\u90e8\u7f72\u4e0e LangChain\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225720-6aefacd0eb6d5.png\" alt=\"\u8bfe\u7a0b\u603b\u76ee\u5f55\uff1a7 \u4e2a\u6a21\u5757\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225721-6aefacd181187.png\" alt=\"\u5728\u7ebf\u77e5\u8bc6\u5e93\uff1aAgent Skills \u521b\u5efa\u5168\u6d41\u7a0b\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225722-6aefacd27ff3b.png\" alt=\"\u8bfe\u7a0b\u76ee\u5f55\uff1aLangGraph \u5f00\u53d1\u667a\u80fd\u4f53\" \/><br \/>\n<img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225723-6aefacd326196.png\" alt=\"\u5728\u7ebf\u77e5\u8bc6\u5e93\uff1aClaude Skills \u5b8c\u5168\u6307\u5357\" \/><\/p>\n<p>\u6dfb\u52a0\u65f6\u5907\u6ce8\u300cAI\u300d&#xff0c;\u4f18\u5148\u901a\u8fc7\u3002<\/p>\n<p>\u8d44\u6599\u6309\u300c\u5148\u8def\u7ebf\u3001\u518d\u52a8\u624b\u3001\u6700\u540e\u67e5\u6f0f\u300d\u7684\u987a\u5e8f\u6574\u7406\u597d\u4e86&#xff0c;\u5efa\u8bae\u5148\u770b\u5b66\u4e60\u8def\u7ebf\u90a3\u4e00\u4efd&#xff0c;\u7167\u7740\u5b83\u6311\u4e00\u6761\u9002\u5408\u81ea\u5df1\u5f53\u524d\u57fa\u7840\u7684\u8def\u5f84\u518d\u5f80\u4e0b\u770b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content<\/p>\n","protected":false},"author":2,"featured_media":123813,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6928,14202,14204,14203,10907],"topic":[],"class_list":["post-123819","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-6928","tag-14202","tag-14204","tag-14203","tag-10907"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \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\/123819.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/123819.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-11-07T22:57:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225719-6aefaccf69806.png\" \/>\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=\"6 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123819.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/123819.html\",\"name\":\"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-11-07T22:57:25+00:00\",\"dateModified\":\"2026-11-07T22:57:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/123819.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/123819.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/123819.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97\"}]},{\"@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":"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \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\/123819.html","og_locale":"zh_CN","og_type":"article","og_title":"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\/* MD \/ \u5bcc\u6587\u672c\u4e2d\u7684 .toc\uff08\u542b\u535a\u5ba2\u56ed\u642c\u5bb6\u7b49\u5d4c\u5957\u7ed3\u6784\uff09\uff1b.toc-box \u5728\u4fa7\u680f\uff0c\u4e0d\u53d7\u5f71\u54cd *\/#content_views .toc,\/* \u7f16\u8f91\u5668\u5e38\u5728\u76ee\u5f55\u524d\u540e\u63d2\u5165\u7a7a p\uff08:empty \u4ecd\u5360 20px\uff09\uff0c\u4e00\u5e76\u53bb\u6389\u907f\u514d\u9876\u7a7a\u9699 *\/#content_views.markdown_views &gt; p:empty:has(+ .toc),#content_views.markdown_views &gt; .toc + p:empty,\/* \u5bcc\u6587\u672c\u65e7\u7248\u76ee\u5f55\u6807\u8bb0 *\/#content","og_url":"https:\/\/www.wsisp.com\/helps\/123819.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-11-07T22:57:25+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/11\/20261107225719-6aefaccf69806.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"6 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/123819.html","url":"https:\/\/www.wsisp.com\/helps\/123819.html","name":"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-11-07T22:57:25+00:00","dateModified":"2026-11-07T22:57:25+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/123819.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/123819.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/123819.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u53e5\u67c4\u4e0a\u9650 512\uff0c\u5e76\u53d1 254 \u5c31\u649e\u5899\uff1a\u9884\u7b97\u600e\u4e48\u7b97"}]},{"@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\/123819","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=123819"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/123819\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/123813"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=123819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=123819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=123819"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=123819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}