{"id":110557,"date":"2026-09-28T23:56:43","date_gmt":"2026-09-28T15:56:43","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/110557.html"},"modified":"2026-09-28T23:56:43","modified_gmt":"2026-09-28T15:56:43","slug":"%e7%99%be%e4%b8%87-qps-%e7%94%9f%e4%ba%a7%e6%9c%8d%e5%8a%a1%e5%99%a8-linux-%e5%86%85%e6%a0%b8%e7%bd%91%e7%bb%9c%e6%a0%88%e8%b0%83%e4%bc%98%e6%b8%85%e5%8d%95%ef%bc%9a%e4%bb%8e%e7%bd%91%e5%8d%a1","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/110557.html","title":{"rendered":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808"},"content":{"rendered":"<h2>\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355&#xff1a;\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928155642-6aba8e3a8d55f.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<p>\u5728\u6784\u5efa\u627f\u8f7d\u767e\u4e07\u7ea7 QPS&#xff08;\u6bcf\u79d2\u67e5\u8be2\u6570&#xff09;\u7684\u9ad8\u6027\u80fd\u63a5\u5165\u7f51\u5173\u3001RPC \u6846\u67b6\u6216\u5927\u6a21\u578b\u6d41\u5f0f\u63a8\u7406\u8c03\u5ea6\u670d\u52a1\u65f6&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u5f80\u5f80\u4e0d\u518d\u53d7\u9650\u4e8e\u5e94\u7528\u5c42\u4e1a\u52a1\u4ee3\u7801\u672c\u8eab&#xff0c;\u800c\u662f\u76f4\u63a5\u649e\u4e0a Linux \u5185\u6838\u7f51\u7edc\u6808\u7684\u7269\u7406\u5929\u82b1\u677f\u3002<\/p>\n<p>\u9ed8\u8ba4\u7684 Linux \u5185\u6838\u7f51\u7edc\u53c2\u6570\u901a\u5e38\u662f\u4e3a\u901a\u7528\u7684\u4f4e\u5e76\u53d1\u684c\u9762\u6216\u666e\u901a\u670d\u52a1\u5668\u73af\u5883\u8bbe\u8ba1\u7684&#xff0c;\u5728\u9762\u5bf9\u9ad8\u541e\u5410\u3001\u7a81\u53d1\u6d77\u91cf\u77ed\u8fde\u63a5\u6216\u5fae\u79d2\u7ea7\u6d41\u5f0f\u6570\u636e\u4f20\u8f93\u65f6&#xff0c;\u5bb9\u6613\u51fa\u73b0\u7f51\u5361\u4e22\u5305\u3001\u8f6f\u4e2d\u65ad&#xff08;SoftIRQ&#xff09;\u5355\u6838\u8dd1\u6ee1\u3001TCP \u961f\u5217\u6ea2\u51fa\u4ee5\u53ca\u7aef\u53e3\u8017\u5c3d\u7b49\u4e00\u7cfb\u5217\u4e25\u91cd\u74f6\u9888\u3002<\/p>\n<p>\u672c\u6587\u603b\u7ed3\u4e86\u6211\u4eec\u5728\u751f\u4ea7\u96c6\u7fa4\u4e2d\u53cd\u590d\u9a8c\u8bc1\u6c89\u6dc0\u7684 Linux \u5185\u6838\u7f51\u7edc\u6808\u9ec4\u91d1\u8c03\u4f18\u6e05\u5355&#xff0c;\u4ece\u7269\u7406\u7f51\u5361\u9a71\u52a8\u5c42\u3001IP\/TCP \u534f\u8bae\u6808\u5230 Socket \u5c42\u8fdb\u884c\u9010\u5c42\u6df1\u5ea6\u8c03\u4f18\u3002<\/p>\n<h4>Linux \u7f51\u7edc\u6570\u636e\u5305\u63a5\u6536\u4e0e\u5904\u7406\u5fae\u67b6\u6784\u5168\u666f<\/h4>\n<p>Linux \u5185\u6838\u7f51\u7edc\u6570\u636e\u5305\u6d41\u8f6c\u4e0e\u5173\u952e\u53c2\u6570\u63a7\u5236\u70b9:<br \/>\n\u250c\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\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\u2510<br \/>\n\u2502 \u7269\u7406\u7f51\u5361 (NIC) \u2500\u2500&gt; Ring Buffer (ethtool -G rx 4096)         \u2502<br \/>\n\u2502     \u2502 (\u786c\u4ef6\u4e2d\u65ad Hard IRQ)                                    \u2502<br \/>\n\u2502 \u251c\u2500\u2500&gt; \u4e2d\u65ad\u4eb2\u548c\u6027\u7ed1\u5b9a (smp_affinity \u7ed1\u5b9a\u81f3\u56fa\u5b9a CPU NUMA \u8282\u70b9) \u2502<br \/>\n\u2502 \u251c\u2500\u2500&gt; NAPI \u673a\u5236 \/ \u8f6f\u4e2d\u65ad (net.core.netdev_budget)            \u2502<br \/>\n\u2502 \u2514\u2500\u2500&gt; \u5185\u6838\u63a5\u6536\u961f\u5217 (net.core.netdev_max_backlog)              \u2502<br \/>\n\u251c\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\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 TCP \u534f\u8bae\u6808\u5904\u7406\u5c42:                                           \u2502<br \/>\n\u2502 \u251c\u2500\u2500&gt; \u5168\u8fde\u63a5\u4e0e\u534a\u8fde\u63a5\u961f\u5217 (net.ipv4.tcp_max_syn_backlog, somaxconn) \u2502<br \/>\n\u2502 \u251c\u2500\u2500&gt; \u52a8\u6001\u7f13\u51b2\u533a (net.ipv4.tcp_rmem, net.ipv4.tcp_wmem)       \u2502<br \/>\n\u2502 \u2514\u2500\u2500&gt; \u62e5\u585e\u63a7\u5236\u4e0e\u5feb\u901f\u56de\u6536 (BBR, tcp_tw_reuse)                \u2502<br \/>\n\u251c\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\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 \u7528\u6237\u7a7a\u95f4 Socket \u7f13\u51b2\u533a (epoll \/ io_uring \/ Application)     \u2502<br \/>\n\u2514\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\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\u2518<\/p>\n<h4>\u4e00\u3001\u7f51\u5361\u9a71\u52a8\u4e0e\u786c\u4ef6\u4e2d\u65ad\u5c42\u8c03\u4f18<\/h4>\n<p>\u6570\u636e\u5305\u5230\u8fbe\u7269\u7406\u7f51\u5361\u540e&#xff0c;\u9996\u5148\u5b58\u653e\u5728\u7f51\u5361\u7684\u73af\u5f62\u7f13\u51b2\u533a&#xff08;Ring Buffer&#xff09;\u4e2d&#xff0c;\u5e76\u89e6\u53d1\u786c\u4ef6\u4e2d\u65ad\u3002<\/p>\n<h5>1. \u6269\u5bb9\u7f51\u5361 Ring Buffer<\/h5>\n<p>\u5982\u679c\u7f51\u5361\u9a71\u52a8\u7684 Ring Buffer \u8fc7\u5c0f&#xff0c;\u5f53\u6d41\u91cf\u77ac\u95f4\u7a81\u53d1\u65f6&#xff0c;\u7f51\u5361\u5728\u6765\u4e0d\u53ca\u89e6\u53d1\u8f6f\u4e2d\u65ad\u8bfb\u53d6\u524d\u5c31\u4f1a\u76f4\u63a5\u5c06\u6570\u636e\u5305\u4e22\u5f03&#xff08;\u901a\u8fc7 ethtool -S eth0 | grep rx_dropped \u89c2\u6d4b&#xff09;\u3002<\/p>\n<p># \u67e5\u770b\u5f53\u524d\u7f51\u5361 Ring Buffer \u4e0a\u9650\u4e0e\u8bbe\u5b9a\u503c<br \/>\nethtool -g eth0<\/p>\n<p># \u5c06 RX\/TX \u961f\u5217\u7f13\u51b2\u533a\u6269\u5927\u81f3\u786c\u4ef6\u6700\u5927\u503c&#xff08;\u901a\u5e38\u4e3a 4096&#xff09;<br \/>\nethtool -G eth0 rx 4096 tx 4096<\/p>\n<h5>2. \u7f51\u5361\u591a\u961f\u5217\u4e0e CPU \u8f6f\u4e2d\u65ad\u4eb2\u548c\u6027\u7ed1\u5b9a<\/h5>\n<p>\u73b0\u4ee3\u9ad8\u6027\u80fd\u4e07\u5146\/\u5341\u4e07\u5146\u7f51\u5361\u652f\u6301\u591a\u961f\u5217&#xff08;RSS, Receive Side Scaling&#xff09;\u3002\u5982\u679c\u6240\u6709\u7f51\u5361\u4e2d\u65ad\u90fd\u9ed8\u8ba4\u6253\u5728 CPU0 \u4e0a&#xff0c;\u4f1a\u5bfc\u81f4 CPU0 \u8f6f\u4e2d\u65ad\u5229\u7528\u7387\u6253\u6ee1\u81f3 100%&#xff08;ksoftirqd\/0 \u5486\u54ee&#xff09;&#xff0c;\u800c\u5176\u4ed6\u6838\u5fc3\u7a7a\u95f2\u3002<\/p>\n<ul>\n<li>\u5173\u95ed\u7cfb\u7edf\u9ed8\u8ba4\u7684 irqbalance \u670d\u52a1&#xff1b;<\/li>\n<li>\u901a\u8fc7\u811a\u672c\u5c06\u7f51\u5361\u5404\u4e2a RX\/TX \u961f\u5217\u7684\u4e2d\u65ad\u53f7&#xff08;IRQ&#xff09;\u4e0e\u7279\u5b9a NUMA \u8282\u70b9\u7684 CPU \u6838\u5fc3\u8fdb\u884c\u4e00\u5bf9\u4e00\u7ed1\u5b9a&#xff1a;<\/li>\n<\/ul>\n<p># \u7ed1\u5b9a IRQ 128 \u5230 CPU \u6838\u5fc3 4 (\u63a9\u7801 0x10)<br \/>\necho 10 &gt; \/proc\/irq\/128\/smp_affinity<\/p>\n<h4>\u4e8c\u3001\u5185\u6838\u534f\u8bae\u6808\u901a\u7528\u961f\u5217\u4e0e\u5185\u5b58\u9884\u7b97\u8c03\u4f18<\/h4>\n<h5>1. \u8f6f\u4e2d\u65ad\u8f6e\u8be2\u9884\u7b97\u4e0e\u5185\u6838\u8f93\u5165\u961f\u5217<\/h5>\n<p>\u5f53\u7f51\u5361\u63a5\u6536\u901f\u7387\u6781\u9ad8\u65f6&#xff0c;\u9700\u8981\u63d0\u5347\u5185\u6838\u5355\u6b21\u8f6f\u4e2d\u65ad\u8f6e\u8be2\u6240\u80fd\u5904\u7406\u7684\u6570\u636e\u5305\u4e0a\u9650&#xff0c;\u9632\u6b62\u6570\u636e\u5728\u8fdb\u5165\u534f\u8bae\u6808\u524d\u88ab\u4e22\u5f03\u3002<\/p>\n<p># \u5355\u6b21\u8f6f\u4e2d\u65ad\u5141\u8bb8\u8f6e\u8be2\u5904\u7406\u7684\u6700\u5927\u6570\u636e\u5305\u6570\u91cf&#xff08;\u9ed8\u8ba4 300&#xff09;<br \/>\nnet.core.netdev_budget &#061; 600<\/p>\n<p># \u5185\u6838\u63a5\u6536\u961f\u5217\u7684\u6700\u5927\u957f\u5ea6&#xff08;\u5f53\u8bbe\u5907\u63a5\u6536\u5305\u5feb\u4e8e\u5185\u6838\u5904\u7406\u65f6\u4f7f\u7528&#xff09;<br \/>\nnet.core.netdev_max_backlog &#061; 16384<\/p>\n<h5>2. Socket \u76d1\u542c\u961f\u5217&#xff08;Backlog&#xff09;<\/h5>\n<p>\u9ad8\u5e76\u53d1\u8fde\u63a5\u5efa\u7acb\u65f6&#xff0c;\u5982\u679c\u5e94\u7528\u5c42 listen() \u79ef\u538b\u961f\u5217\u8fc7\u5c0f&#xff0c;\u4f1a\u5bfc\u81f4\u5ba2\u6237\u7aef\u6536\u5230 Connection Refused \u6216 SYN \u91cd\u4f20\u3002<\/p>\n<p># \u7cfb\u7edf\u6240\u6709\u7aef\u53e3\u7684\u6700\u5927\u76d1\u542c\u961f\u5217\u957f\u5ea6&#xff08;\u5fc5\u987b\u914d\u5408\u5e94\u7528\u4ee3\u7801 listen(fd, backlog) \u4e00\u540c\u8c03\u5927&#xff09;<br \/>\nnet.core.somaxconn &#061; 65535<\/p>\n<p># TCP \u534a\u8fde\u63a5\u961f\u5217&#xff08;SYN \u961f\u5217&#xff09;\u6700\u5927\u957f\u5ea6<br \/>\nnet.ipv4.tcp_max_syn_backlog &#061; 65535<\/p>\n<h4>\u4e09\u3001TCP \u534f\u8bae\u6808\u5185\u5b58\u4e0e\u62e5\u585e\u63a7\u5236\u8c03\u4f18<\/h4>\n<h5>1. TCP \u8bfb\u5199\u7f13\u51b2\u533a\u52a8\u6001\u81ea\u52a8\u8c03\u8282&#xff08;Auto-tuning&#xff09;<\/h5>\n<p>Linux \u652f\u6301\u6839\u636e\u5e26\u5bbd\u5ef6\u8fdf\u79ef&#xff08;BDP&#xff09;\u81ea\u52a8\u8c03\u8282\u6bcf\u4e2a TCP \u8fde\u63a5\u7684\u7f13\u51b2\u533a\u5927\u5c0f\u3002\u5408\u7406\u914d\u7f6e\u4e09\u5143\u7ec4&#xff08;\u6700\u5c0f\u503c\u3001\u9ed8\u8ba4\u503c\u3001\u6700\u5927\u503c&#xff09;\u81f3\u5173\u91cd\u8981&#xff1a;<\/p>\n<p># TCP \u8bfb\u7f13\u51b2\u533a (min, default, max) \u5355\u4f4d\u5b57\u8282: 4KB, 87KB, 16MB<br \/>\nnet.ipv4.tcp_rmem &#061; 4096 87380 16777216<\/p>\n<p># TCP \u5199\u7f13\u51b2\u533a (min, default, max) \u5355\u4f4d\u5b57\u8282: 4KB, 65KB, 16MB<br \/>\nnet.ipv4.tcp_wmem &#061; 4096 65536 16777216<\/p>\n<p># \u7cfb\u7edf\u5206\u914d\u7ed9 TCP \u7684\u5168\u5c40\u5185\u5b58\u9875\u9884\u7b97 (min, pressure, max) \u5355\u4f4d\u4e3a 4KB \u5185\u5b58\u9875<br \/>\nnet.ipv4.tcp_mem &#061; 786432 1048576 1572864<\/p>\n<h5>2. \u62e5\u585e\u63a7\u5236\u7b97\u6cd5\u5207\u6362\u4e3a BBR<\/h5>\n<p>\u4f20\u7edf\u7684 CUBIC \u7b97\u6cd5\u57fa\u4e8e\u4e22\u5305\u6765\u5224\u5b9a\u62e5\u585e&#xff0c;\u5728\u8de8\u673a\u623f\u4e13\u7ebf\u6216\u8f7b\u5fae\u968f\u673a\u4e22\u5305\u7684\u9ad8\u901f\u7f51\u7edc\u4e2d\u541e\u5410\u4f1a\u53d1\u751f\u65ad\u5d16\u5f0f\u4e0b\u8dcc\u3002Google BBR \u57fa\u4e8e\u5b9e\u65f6\u6d4b\u91cf\u771f\u5b9e\u5e26\u5bbd\u4e0e\u6700\u5c0f RTT&#xff08;\u5f80\u8fd4\u65f6\u5ef6&#xff09;&#xff0c;\u80fd\u591f\u663e\u8457\u63d0\u5347\u957f\u80a5\u7ba1\u9053&#xff08;LFN&#xff09;\u4e0a\u7684\u4f20\u8f93\u541e\u5410\u5e76\u538b\u4f4e\u6392\u961f\u5ef6\u8fdf\u3002<\/p>\n<p># \u542f\u7528 BBR \u62e5\u585e\u63a7\u5236<br \/>\nnet.core.default_qdisc &#061; fq<br \/>\nnet.ipv4.tcp_congestion_control &#061; bbr<\/p>\n<h5>3. \u77ed\u8fde\u63a5 TIME_WAIT \u6cbb\u7406\u4e0e\u7aef\u53e3\u590d\u7528<\/h5>\n<p>\u9ad8\u9891\u77ed\u8fde\u63a5\u670d\u52a1&#xff08;\u5982\u672a\u5f00\u542f Keep-Alive \u7684\u53cd\u5411\u4ee3\u7406&#xff09;\u4f1a\u5728\u51e0\u5206\u949f\u5185\u4ea7\u751f\u6570\u5341\u4e07\u4e2a TIME_WAIT \u72b6\u6001\u7684 Socket&#xff0c;\u8017\u5c3d\u672c\u5730\u53ef\u7528\u7aef\u53e3&#xff08;Local Port Exhaustion&#xff09;\u3002<\/p>\n<p># \u5141\u8bb8\u5c06\u5904\u4e8e TIME_WAIT \u72b6\u6001\u7684 Socket \u5b89\u5168\u590d\u7528\u4e8e\u65b0\u7684 TCP \u8fde\u63a5<br \/>\nnet.ipv4.tcp_tw_reuse &#061; 1<\/p>\n<p># \u6269\u5927\u672c\u5730\u53ef\u7528\u7aef\u53e3\u8303\u56f4<br \/>\nnet.ipv4.ip_local_port_range &#061; 1024 65535<\/p>\n<p># \u7f29\u77ed FIN-WAIT-2 \u72b6\u6001\u8d85\u65f6\u65f6\u95f4&#xff08;\u9ed8\u8ba4 60s&#xff09;<br \/>\nnet.ipv4.tcp_fin_timeout &#061; 15<\/p>\n<h4>\u751f\u4ea7\u73af\u5883\u4e00\u952e\u751f\u6548 sysctl \u5b8c\u6574\u914d\u7f6e\u6e05\u5355<\/h4>\n<p>\u5c06\u4ee5\u4e0b\u914d\u7f6e\u6301\u4e45\u5316\u5199\u5165 \/etc\/sysctl.d\/99-high-performance-network.conf&#xff0c;\u5e76\u6267\u884c sysctl -p \/etc\/sysctl.d\/99-high-performance-network.conf \u751f\u6548&#xff1a;<\/p>\n<p># &#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# \u751f\u4ea7\u7ea7\u767e\u4e07 QPS Linux \u7f51\u7edc\u6808\u8c03\u4f18\u9ec4\u91d1\u914d\u7f6e<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;<\/p>\n<p># 1. \u6838\u5fc3\u4e0e\u8bbe\u5907\u961f\u5217<br \/>\nnet.core.somaxconn &#061; 65535<br \/>\nnet.core.netdev_max_backlog &#061; 16384<br \/>\nnet.core.netdev_budget &#061; 600<br \/>\nnet.core.rmem_max &#061; 16777216<br \/>\nnet.core.wmem_max &#061; 16777216<\/p>\n<p># 2. TCP \u8fde\u63a5\u4e0e\u961f\u5217<br \/>\nnet.ipv4.tcp_max_syn_backlog &#061; 65535<br \/>\nnet.ipv4.tcp_synack_retries &#061; 2<br \/>\nnet.ipv4.tcp_syn_retries &#061; 2<br \/>\nnet.ipv4.tcp_abort_on_overflow &#061; 0<\/p>\n<p># 3. TCP \u5185\u5b58\u4e0e\u7f13\u51b2\u533a<br \/>\nnet.ipv4.tcp_rmem &#061; 4096 87380 16777216<br \/>\nnet.ipv4.tcp_wmem &#061; 4096 65536 16777216<br \/>\nnet.ipv4.tcp_mem &#061; 786432 1048576 1572864<\/p>\n<p># 4. TIME_WAIT \u4e0e\u7aef\u53e3\u7ba1\u7406<br \/>\nnet.ipv4.tcp_tw_reuse &#061; 1<br \/>\nnet.ipv4.tcp_fin_timeout &#061; 15<br \/>\nnet.ipv4.ip_local_port_range &#061; 1024 65535<br \/>\nnet.ipv4.tcp_max_tw_buckets &#061; 262144<\/p>\n<p># 5. \u62e5\u585e\u63a7\u5236\u4e0e\u6392\u961f\u89c4\u5219<br \/>\nnet.core.default_qdisc &#061; fq<br \/>\nnet.ipv4.tcp_congestion_control &#061; bbr<br \/>\nnet.ipv4.tcp_slow_start_after_idle &#061; 0<\/p>\n<h4>\u751f\u4ea7\u8c03\u4f18\u5b9e\u6d4b\u6536\u76ca\u603b\u7ed3<\/h4>\n<p>\u5728 100Gbps Mellanox \u7f51\u5361\u96c6\u7fa4\u4e0e\u9ad8\u5e76\u53d1 HTTP \u538b\u6d4b\u57fa\u51c6\u4e0b&#xff0c;\u5e94\u7528\u6b64\u5957\u8c03\u4f18\u6e05\u5355\u524d\u540e\u7684\u6838\u5fc3\u6307\u6807\u5bf9\u8d26&#xff1a;<\/p>\n<ul>\n<li>\u7f51\u5361\u4e22\u5305\u7387&#xff1a;\u4ece\u77ac\u65f6\u7a81\u53d1\u7684 1.8% \u5f7b\u5e95\u964d\u4e3a 0.0%&#xff1b;<\/li>\n<li>\u5355\u8282\u70b9\u6700\u5927\u5efa\u7acb\u8fde\u63a5 QPS&#xff1a;\u4ece 42,000 \u8dc3\u5347\u81f3 380,000&#043;&#xff1b;<\/li>\n<li>\u7f51\u7edc\u6d41\u5f0f\u4f20\u8f93\u5e73\u5747\u5ef6\u8fdf&#xff1a;\u5728\u8de8\u673a\u623f BBR \u52a0\u6301\u4e0b&#xff0c;P99 \u4f20\u8f93\u5ef6\u8fdf\u964d\u4f4e 42%\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355&#xff1a;\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808\u5728\u6784\u5efa\u627f\u8f7d\u767e\u4e07\u7ea7 QPS&#xff08;\u6bcf\u79d2\u67e5\u8be2\u6570&#xff09;\u7684\u9ad8\u6027\u80fd\u63a5\u5165\u7f51\u5173\u3001RPC \u6846\u67b6\u6216\u5927\u6a21\u578b\u6d41\u5f0f\u63a8\u7406\u8c03\u5ea6\u670d\u52a1\u65f6&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u5f80\u5f80\u4e0d\u518d\u53d7\u9650\u4e8e\u5e94\u7528\u5c42\u4e1a\u52a1\u4ee3\u7801\u672c\u8eab&#xff0c;\u800c\u662f\u76f4\u63a5\u649e\u4e0a Linux \u5185\u6838\u7f51\u7edc\u6808\u7684\u7269\u7406\u5929\u82b1\u677f\u3002<br \/>\n\u9ed8\u8ba4\u7684 Linux \u5185\u6838\u7f51\u7edc\u53c2\u6570\u901a\u5e38\u662f\u4e3a\u901a\u7528\u7684\u4f4e\u5e76\u53d1\u684c\u9762\u6216\u666e\u901a\u670d\u52a1\u5668\u73af\u5883\u8bbe\u8ba1\u7684&#xff0c;\u5728\u9762\u5bf9\u9ad8\u541e\u5410\u3001\u7a81\u53d1\u6d77\u91cf\u77ed\u8fde\u63a5\u6216\u5fae\u79d2<\/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-110557","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>\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \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\/110557.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355&#xff1a;\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808\u5728\u6784\u5efa\u627f\u8f7d\u767e\u4e07\u7ea7 QPS&#xff08;\u6bcf\u79d2\u67e5\u8be2\u6570&#xff09;\u7684\u9ad8\u6027\u80fd\u63a5\u5165\u7f51\u5173\u3001RPC \u6846\u67b6\u6216\u5927\u6a21\u578b\u6d41\u5f0f\u63a8\u7406\u8c03\u5ea6\u670d\u52a1\u65f6&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u5f80\u5f80\u4e0d\u518d\u53d7\u9650\u4e8e\u5e94\u7528\u5c42\u4e1a\u52a1\u4ee3\u7801\u672c\u8eab&#xff0c;\u800c\u662f\u76f4\u63a5\u649e\u4e0a Linux \u5185\u6838\u7f51\u7edc\u6808\u7684\u7269\u7406\u5929\u82b1\u677f\u3002 \u9ed8\u8ba4\u7684 Linux \u5185\u6838\u7f51\u7edc\u53c2\u6570\u901a\u5e38\u662f\u4e3a\u901a\u7528\u7684\u4f4e\u5e76\u53d1\u684c\u9762\u6216\u666e\u901a\u670d\u52a1\u5668\u73af\u5883\u8bbe\u8ba1\u7684&#xff0c;\u5728\u9762\u5bf9\u9ad8\u541e\u5410\u3001\u7a81\u53d1\u6d77\u91cf\u77ed\u8fde\u63a5\u6216\u5fae\u79d2\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/110557.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-28T15:56:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928155642-6aba8e3a8d55f.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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110557.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/110557.html\",\"name\":\"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-28T15:56:43+00:00\",\"dateModified\":\"2026-09-28T15:56:43+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/110557.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/110557.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/110557.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808\"}]},{\"@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":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \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\/110557.html","og_locale":"zh_CN","og_type":"article","og_title":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355&#xff1a;\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808\u5728\u6784\u5efa\u627f\u8f7d\u767e\u4e07\u7ea7 QPS&#xff08;\u6bcf\u79d2\u67e5\u8be2\u6570&#xff09;\u7684\u9ad8\u6027\u80fd\u63a5\u5165\u7f51\u5173\u3001RPC \u6846\u67b6\u6216\u5927\u6a21\u578b\u6d41\u5f0f\u63a8\u7406\u8c03\u5ea6\u670d\u52a1\u65f6&#xff0c;\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u5f80\u5f80\u4e0d\u518d\u53d7\u9650\u4e8e\u5e94\u7528\u5c42\u4e1a\u52a1\u4ee3\u7801\u672c\u8eab&#xff0c;\u800c\u662f\u76f4\u63a5\u649e\u4e0a Linux \u5185\u6838\u7f51\u7edc\u6808\u7684\u7269\u7406\u5929\u82b1\u677f\u3002 \u9ed8\u8ba4\u7684 Linux \u5185\u6838\u7f51\u7edc\u53c2\u6570\u901a\u5e38\u662f\u4e3a\u901a\u7528\u7684\u4f4e\u5e76\u53d1\u684c\u9762\u6216\u666e\u901a\u670d\u52a1\u5668\u73af\u5883\u8bbe\u8ba1\u7684&#xff0c;\u5728\u9762\u5bf9\u9ad8\u541e\u5410\u3001\u7a81\u53d1\u6d77\u91cf\u77ed\u8fde\u63a5\u6216\u5fae\u79d2","og_url":"https:\/\/www.wsisp.com\/helps\/110557.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-28T15:56:43+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260928155642-6aba8e3a8d55f.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/110557.html","url":"https:\/\/www.wsisp.com\/helps\/110557.html","name":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-28T15:56:43+00:00","dateModified":"2026-09-28T15:56:43+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/110557.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/110557.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/110557.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u767e\u4e07 QPS \u751f\u4ea7\u670d\u52a1\u5668 Linux \u5185\u6838\u7f51\u7edc\u6808\u8c03\u4f18\u6e05\u5355\uff1a\u4ece\u7f51\u5361\u9a71\u52a8\u5230 TCP \u534f\u8bae\u6808"}]},{"@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\/110557","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=110557"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/110557\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=110557"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=110557"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=110557"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=110557"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}