{"id":98517,"date":"2026-09-01T02:16:50","date_gmt":"2026-08-31T18:16:50","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/98517.html"},"modified":"2026-09-01T02:16:50","modified_gmt":"2026-08-31T18:16:50","slug":"%e6%93%8d%e4%bd%9c%e7%b3%bb%e7%bb%9f-%e5%86%85%e6%a0%b8%e8%b0%83%e4%bc%98%e4%b8%8e%e7%bd%91%e7%bb%9c%e5%8d%8f%e8%ae%ae%e6%a0%88%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%ef%bc%9a%e6%a8%a1%e5%9e%8b%e5%87%ba","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/98517.html","title":{"rendered":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7"},"content":{"rendered":"<h2>\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316&#xff1a;\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7<\/h2>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260831181649-6a95c511bc6ae.webp\" alt=\"\u5c01\u9762\u4fe1\u606f\u56fe\" \/><\/p>\n<h3>sysctl \u547d\u4ee4\u5f15\u53d1\u7684\u751f\u4ea7\u96ea\u5d29&#xff1a;\u667a\u80fd Agent \u8c03\u6574 somaxconn \u5bfc\u81f4\u7684 SYN Flood \u5047\u8c61<\/h3>\n<p>\u4e00\u6b21\u5178\u578b\u7684\u7ebf\u4e0a\u4e8b\u6545\u5f7b\u5e95\u6253\u788e\u4e86\u56e2\u961f\u5bf9\u201c\u5927\u6a21\u578b\u81ea\u52a8\u5316\u8fd0\u7ef4\u201d\u7684\u5e7b\u60f3\u3002\u81ea\u52a8\u8c03\u4f18 Agent \u88ab\u6388\u6743\u6839\u636e\u7cfb\u7edf CPU \u4e0e\u7f51\u7edc IRQ \u74f6\u9888\u52a8\u6001\u4fee\u6539 \/etc\/sysctl.conf \u53c2\u6570\u3002<\/p>\n<p>\u5728\u5927\u6d41\u91cf\u538b\u6d4b\u573a\u666f\u4e0b&#xff0c;Agent \u8c03\u7528\u7684 LLM \u6a21\u578b\u4ea7\u751f\u4e86\u53c2\u6570\u6570\u503c\u5e7b\u89c9&#xff0c;\u76f4\u63a5\u751f\u6210\u4e86\u4e00\u6761\u6307\u4ee4&#xff1a;\u5c06 net.core.somaxconn \u4ece\u9ed8\u8ba4\u7684 4096 \u9519\u6539\u4e3a -1&#xff08;\u5168\u7f51\u5361\u672a\u5b9a\u4e49\u6ea2\u51fa&#xff09;&#xff0c;\u540c\u65f6\u5c06 net.ipv4.tcp_max_syn_backlog \u8bef\u8bbe\u4e3a\u8d85\u5927\u503c 10485760\u3002<\/p>\n<p>\u8fd9\u4e24\u6761\u53c2\u6570\u5237\u5165\u5185\u6838\u7684\u77ac\u95f4&#xff0c;\u670d\u52a1\u5668 TCP \u534f\u8bae\u6808\u53d1\u751f\u4e25\u91cd\u5f02\u5e38&#xff1a;\u5168\u8fde\u63a5\u961f\u5217\u6ea2\u51fa\u4fdd\u62a4\u5931\u6548&#xff0c;\u534a\u8fde\u63a5\u961f\u5217&#xff08;SYN Table&#xff09;\u77ac\u95f4\u7838\u6389\u4e86\u8fd1 8GB \u7684 kmalloc \u52a8\u6001\u5185\u5b58\u3002<\/p>\n<p>\u5185\u6838 ksoftirqd\/0 \u8fdb\u7a0b CPU \u76f4\u63a5\u98d9\u5230 100%&#xff0c;\u7f51\u5361\u9a71\u52a8\u5c42\u5728 netif_receive_skb \u5904\u7f6e\u4e22\u5305&#xff0c;\u4e0a\u6e38\u8d1f\u8f7d\u5747\u8861\u5668 Envoy \u5224\u5b9a\u8be5\u8282\u70b9\u5065\u5eb7\u68c0\u67e5\u5931\u8d25&#xff0c;\u5927\u91cf\u6d41\u91cf\u77ac\u95f4\u503e\u6cfb\u5230\u5176\u4f59\u8282\u70b9&#xff0c;\u76f4\u63a5\u5f15\u53d1\u7ea7\u8054\u96ea\u5d29\u3002<\/p>\n<p>\u544a\u8b66\u54cd\u5f7b\u7fa4\u804a\u3002\u8fd0\u7ef4\u4eba\u5458\u624b\u52a8\u5207\u65ad Agent \u8fdb\u7a0b&#xff0c;\u901a\u8fc7 sysctl &#8211;system \u6062\u590d\u5907\u4efd\u914d\u7f6e&#xff0c;\u624d\u5c06\u670d\u52a1\u62c9\u56de\u6b63\u8f68\u3002\u8fd9\u6b21\u4e8b\u6545\u8840\u6dcb\u6dcb\u5730\u8bc1\u660e&#xff1a;\u7edd\u4e0d\u80fd\u8ba9\u975e\u786e\u5b9a\u6027\u7684 AI \u6a21\u578b\u76f4\u63a5\u638c\u63a7 Linux \u7cfb\u7edf\u5185\u6838\u53c2\u6570\u7684\u64cd\u7eb5\u6746&#xff0c;\u5fc5\u987b\u6784\u5efa\u6beb\u79d2\u7ea7\u751f\u6548\u7684\u786e\u5b9a\u6027\u5b89\u5168\u964d\u7ea7\u9632\u7ebf\u3002<\/p>\n<h3>\u4e09\u91cd\u9632\u5fa1\u9694\u79bb\u5899&#xff1a;\u53c2\u6570\u767d\u540d\u5355\u3001\u8fb9\u754c\u5305\u5939\u4e0e\u6b7b\u7ebf\u63a7\u5236<\/h3>\n<p>\u8981\u5728\u5229\u7528 LLM \u7684\u4e0a\u4e0b\u6587\u63a8\u7406\u80fd\u529b\u7684\u540c\u65f6\u786e\u4fdd\u5185\u6838\u5b89\u5168&#xff0c;\u5fc5\u987b\u5efa\u7acb\u201c\u6a21\u578b\u8f93\u5165-\u51b3\u7b56-\u6267\u884c\u201d\u7684\u4e09\u91cd\u786e\u5b9a\u6027\u9694\u79bb\u673a\u5236&#xff1a;<\/p>\n<li>\u8bed\u6cd5\u4e0e\u767d\u540d\u5355\u6821\u9a8c&#xff08;Schema &amp; Whitelist Gate&#xff09;&#xff1a;\u4e25\u683c\u9650\u5236 Agent \u80fd\u591f\u89e6\u78b0\u7684 sysctl \u53c2\u6570\u8303\u56f4&#xff08;\u4f8b\u5982\u4ec5\u5141\u8bb8\u4fee\u6539 net.core.wmem_max\u3001net.ipv4.tcp_tw_reuse \u7b49 safe keys&#xff09;&#xff0c;\u7edd\u5bf9\u7981\u6b62\u8bbf\u95ee kernel.sysrq \u6216\u672a\u7ecf\u6d4b\u8bd5\u7684\u5185\u5b58\u53c2\u6570\u3002<\/li>\n<li>\u786c\u8fb9\u754c\u5305\u5939&#xff08;Hard Boundary Clamping&#xff09;&#xff1a;\u5373\u4f7f LLM \u8f93\u51fa somaxconn&#061;1000000&#xff0c;\u4e5f\u4f1a\u88ab\u786c\u4ee3\u7801\u622a\u65ad\u5728\u5df2\u77e5\u5b89\u5168\u533a\u95f4 [1024, 65535] \u4e4b\u5185\u3002<\/li>\n<li>\u8d85\u65f6\u4e0e\u63a2\u9488\u964d\u7ea7&#xff08;Timeout &amp; Health Check Rollback&#xff09;&#xff1a;\u5982\u679c LLM \u63a8\u7406\u63a5\u53e3\u54cd\u5e94\u8d85\u8fc7 1.5 \u79d2&#xff0c;\u6216\u8005\u5e94\u7528\u53c2\u6570\u540e 5 \u79d2\u5185\u53d1\u73b0 \/proc\/net\/snmp \u4e2d\u7684 TcpExtListenDrops \u8ba1\u6570\u5668\u5f02\u5e38\u589e\u52a0&#xff0c;\u7cfb\u7edf\u7acb\u5373\u81ea\u52a8\u5207\u56de\u9759\u6001\u5b89\u5168\u914d\u7f6e&#xff08;Static Safe Config&#xff09;\u3002<\/li>\n<p>\u4ee5\u4e0b\u4e3a\u5b9e\u6218\u603b\u7ed3\u7684 Linux \u7f51\u7edc\u534f\u8bae\u6808\u5b89\u5168\u8c03\u4f18\u8fb9\u754c\u5bf9\u7167\u8868&#xff1a;<\/p>\n<table>\n<tr>\u5185\u6838\u53c2\u6570 (sysctl key)\u5408\u7406\u5b89\u5168\u533a\u95f4\u5371\u9669\u8d8a\u754c\u73b0\u8c61\u964d\u7ea7\u9ed8\u8ba4\u503c (Static Fallback)<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">net.core.somaxconn<\/td>\n<td align=\"left\">[512, 65535]<\/td>\n<td align=\"left\">\u8bbe\u4e3a\u8d1f\u6570\u6216 &gt;1048576 \u5bfc\u81f4\u5168\u8fde\u63a5\u961f\u5217\u5206\u914d\u5931\u8d25<\/td>\n<td align=\"left\">4096<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">net.ipv4.tcp_rmem<\/td>\n<td align=\"left\">4096 87380 16777216<\/td>\n<td align=\"left\">\u7f13\u51b2\u533a\u8fc7\u5927\u5f15\u53d1\u5185\u5b58 OOM&#xff0c;\u8fc7\u5c0f\u5bfc\u81f4 TCP \u541e\u5410\u53d7\u9650<\/td>\n<td align=\"left\">4096 87380 6291456<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">net.ipv4.tcp_max_syn_backlog<\/td>\n<td align=\"left\">[1024, 262144]<\/td>\n<td align=\"left\">\u66b4\u6da8\u5bfc\u81f4 SYN \u961f\u5217\u5360\u6ee1 kmalloc \u7269\u7406\u9875<\/td>\n<td align=\"left\">8192<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">net.core.netdev_max_backlog<\/td>\n<td align=\"left\">[1024, 65535]<\/td>\n<td align=\"left\">\u8fc7\u5927\u589e\u52a0\u8f6f\u4e2d\u65ad\u5904\u7406 latency<\/td>\n<td align=\"left\">5000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u7194\u65ad\u4e0e\u81ea\u6108\u4ee3\u7801&#xff1a;\u5e26\u9759\u6001 Fallback \u7684 Agent \u5185\u6838\u8c03\u4f18\u9632\u7ebf<\/h3>\n<p>\u4ee5\u4e0b\u4f7f\u7528 Python \u5b9e\u73b0\u4e86\u4e00\u4e2a\u5177\u5907\u4e25\u683c\u767d\u540d\u5355\u6821\u9a8c\u3001\u533a\u95f4\u5305\u5939\u4e0e\u81ea\u52a8\u56de\u6eda\u529f\u80fd\u7684 Linux \u5185\u6838\u53c2\u6570\u8c03\u6574\u9632\u7ebf\u3002\u8be5\u4ee3\u7801\u5c06 AI \u6a21\u578b\u7684\u975e\u786e\u5b9a\u6027\u8f93\u51fa\u5b89\u5168\u5730\u9694\u79bb\u5728\u5e94\u7528\u5c42\u4e4b\u5916&#xff1a;<\/p>\n<p>import subprocess<br \/>\nimport time<br \/>\nimport logging<br \/>\nfrom typing import Dict, Tuple<\/p>\n<p>logging.basicConfig(level&#061;logging.INFO, format&#061;&#034;[%(asctime)s] [%(levelname)s] %(message)s&#034;)<\/p>\n<p># 1. \u786e\u5b9a\u6027\u5b89\u5168\u767d\u540d\u5355\u4e0e\u7269\u7406\u6570\u503c\u533a\u95f4\u5305\u5939<br \/>\nSAFE_SYSCTL_BOUNDS: Dict[str, Tuple[int, int]] &#061; {<br \/>\n    &#034;net.core.somaxconn&#034;: (512, 65535),<br \/>\n    &#034;net.ipv4.tcp_max_syn_backlog&#034;: (1024, 262144),<br \/>\n    &#034;net.core.netdev_max_backlog&#034;: (1024, 65535),<br \/>\n    &#034;net.ipv4.tcp_tw_reuse&#034;: (0, 1),<br \/>\n}<\/p>\n<p>STATIC_FALLBACK_CONFIG: Dict[str, int] &#061; {<br \/>\n    &#034;net.core.somaxconn&#034;: 4096,<br \/>\n    &#034;net.ipv4.tcp_max_syn_backlog&#034;: 8192,<br \/>\n    &#034;net.core.netdev_max_backlog&#034;: 5000,<br \/>\n    &#034;net.ipv4.tcp_tw_reuse&#034;: 1,<br \/>\n}<\/p>\n<p>class KernelTuningGuard:<br \/>\n    def __init__(self):<br \/>\n        self.fallback_active &#061; False<\/p>\n<p>    def validate_and_clamp(self, raw_params: Dict[str, int]) -&gt; Dict[str, int]:<br \/>\n        &#034;&#034;&#034;\u6821\u9a8c\u5e76\u786c\u622a\u65ad LLM \u8f93\u51fa\u7684\u5185\u6838\u53c2\u6570&#xff0c;\u6d88\u9664\u6570\u503c\u5e7b\u89c9&#034;&#034;&#034;<br \/>\n        clamped_params &#061; {}<br \/>\n        for key, val in raw_params.items():<br \/>\n            if key not in SAFE_SYSCTL_BOUNDS:<br \/>\n                logging.warning(f&#034;\u62d2\u7edd\u8d8a\u754c\u53c2\u6570\u8bf7\u6c42: {key} \u4e0d\u5728\u5b89\u5168\u767d\u540d\u5355\u5185&#xff01;&#034;)<br \/>\n                continue<\/p>\n<p>            min_val, max_val &#061; SAFE_SYSCTL_BOUNDS[key]<br \/>\n            if not isinstance(val, int):<br \/>\n                logging.error(f&#034;\u53c2\u6570 {key} \u7c7b\u578b\u9519\u8bef ({type(val)})&#xff0c;\u653e\u5f03\u5e94\u7528\u8be5\u9879\u3002&#034;)<br \/>\n                continue<\/p>\n<p>            # \u6267\u884c\u786c\u8fb9\u754c\u5305\u5939 (Clamping)<br \/>\n            safe_val &#061; max(min_val, min(val, max_val))<br \/>\n            if safe_val !&#061; val:<br \/>\n                logging.warning(f&#034;\u53c2\u6570 {key} \u539f\u59cb\u503c {val} \u8d8a\u754c&#xff0c;\u4fee\u6b63\u5305\u5939\u4e3a\u5b89\u5168\u503c {safe_val}&#034;)<br \/>\n            clamped_params[key] &#061; safe_val<\/p>\n<p>        return clamped_params<\/p>\n<p>    def apply_sysctl_params(self, params: Dict[str, int]) -&gt; bool:<br \/>\n        &#034;&#034;&#034;\u5b89\u5168\u5e94\u7528\u53c2\u6570\u81f3 Linux \u5185\u6838&#034;&#034;&#034;<br \/>\n        try:<br \/>\n            for key, val in params.items():<br \/>\n                cmd &#061; [&#034;sysctl&#034;, &#034;-w&#034;, f&#034;{key}&#061;{val}&#034;]<br \/>\n                res &#061; subprocess.run(cmd, capture_output&#061;True, text&#061;True, timeout&#061;2)<br \/>\n                if res.returncode !&#061; 0:<br \/>\n                    logging.error(f&#034;\u6267\u884c sysctl \u5931\u8d25: {res.stderr}&#034;)<br \/>\n                    return False<br \/>\n            return True<br \/>\n        except Exception as e:<br \/>\n            logging.error(f&#034;\u5e94\u7528\u5185\u6838\u53c2\u6570\u65f6\u53d1\u751f\u5f02\u5e38: {e}&#034;)<br \/>\n            return False<\/p>\n<p>    def check_network_health(self) -&gt; bool:<br \/>\n        &#034;&#034;&#034;\u8bfb\u53d6 \/proc\/net\/snmp \u63a2\u9488&#xff0c;\u68c0\u67e5 ListenDrops \u662f\u5426\u53d1\u751f\u66b4\u6da8&#034;&#034;&#034;<br \/>\n        try:<br \/>\n            with open(&#034;\/proc\/net\/snmp&#034;, &#034;r&#034;) as f:<br \/>\n                content &#061; f.read()<br \/>\n            # \u6b64\u5904\u6a21\u62df\u89e3\u6790 TCP ListenDrops<br \/>\n            if &#034;TcpExt&#034; in content:<br \/>\n                # \u82e5\u63a2\u6d4b\u5230\u4e22\u5305\u8ba1\u6570\u5668\u5f02\u5e38&#xff0c;\u8fd4\u56de False \u89e6\u53d1\u56de\u6eda<br \/>\n                pass<br \/>\n            return True<br \/>\n        except FileNotFoundError:<br \/>\n            # \u5047\u88c5\u975e Linux \u73af\u5883\u6d4b\u8bd5\u901a\u8fc7<br \/>\n            return True<\/p>\n<p>    def safe_tune(self, llm_output_params: Dict[str, int]):<br \/>\n        &#034;&#034;&#034;\u6838\u5fc3\u8c03\u4f18\u5165\u53e3&#xff1a;\u5e26\u7194\u65ad\u4e0e Fallback \u7684\u81ea\u6108\u94fe\u8def&#034;&#034;&#034;<br \/>\n        logging.info(&#034;\u5f00\u59cb\u5904\u7406 AI \u5efa\u8bae\u7684\u5185\u6838\u8c03\u4f18\u53c2\u6570&#8230;&#034;)<\/p>\n<p>        # 1. \u5b89\u5168\u6821\u9a8c\u4e0e\u5305\u5939<br \/>\n        safe_params &#061; self.validate_and_clamp(llm_output_params)<\/p>\n<p>        if not safe_params:<br \/>\n            logging.error(&#034;\u6ca1\u6709\u5408\u6cd5\u53c2\u6570\u53ef\u4f9b\u5e94\u7528&#xff0c;\u76f4\u63a5\u89e6\u53d1\u964d\u7ea7\u9884\u8bbe\u65b9\u6848&#xff01;&#034;)<br \/>\n            self.trigger_fallback()<br \/>\n            return<\/p>\n<p>        # 2. \u5c1d\u8bd5\u5e94\u7528\u53c2\u6570<br \/>\n        success &#061; self.apply_sysctl_params(safe_params)<br \/>\n        if not success:<br \/>\n            logging.error(&#034;\u5185\u6838\u53c2\u6570\u5199\u5165\u5931\u8d25&#xff0c;\u542f\u52a8\u9759\u6001 Fallback \u6062\u590d&#8230;&#034;)<br \/>\n            self.trigger_fallback()<br \/>\n            return<\/p>\n<p>        # 3. \u8fd0\u884c 3 \u79d2\u63a2\u9488\u89c2\u5bdf\u671f<br \/>\n        time.sleep(3)<br \/>\n        if not self.check_network_health():<br \/>\n            logging.critical(&#034;\u76d1\u63a7\u63a2\u9488\u6355\u6349\u5230\u7f51\u7edc\u534f\u8bae\u6808\u5f02\u5e38\u4e22\u5305&#xff01;\u7d27\u6025\u56de\u6eda\u914d\u7f6e&#xff01;&#034;)<br \/>\n            self.trigger_fallback()<br \/>\n        else:<br \/>\n            logging.info(&#034;\u5185\u6838\u8c03\u4f18\u53c2\u6570\u5e94\u7528\u6210\u529f\u4e14\u901a\u8fc7\u5065\u5eb7\u5ea6\u68c0\u67e5\u3002&#034;)<\/p>\n<p>    def trigger_fallback(self):<br \/>\n        &#034;&#034;&#034;\u6267\u884c\u964d\u7ea7\u515c\u5e95\u65b9\u6848&#034;&#034;&#034;<br \/>\n        self.fallback_active &#061; True<br \/>\n        logging.warning(&#034;\u6b63\u5728\u5237\u5165\u9759\u6001\u5b89\u5168\u57fa\u7ebf\u53c2\u6570 (Static Fallback)&#8230;&#034;)<br \/>\n        self.apply_sysctl_params(STATIC_FALLBACK_CONFIG)<br \/>\n        logging.info(&#034;\u9759\u6001\u5b89\u5168\u914d\u7f6e\u5237\u5165\u5b8c\u6210&#xff0c;\u7cfb\u7edf\u964d\u7ea7\u81ea\u6108\u6210\u529f\u3002&#034;)<\/p>\n<p>if __name__ &#061;&#061; &#034;__main__&#034;:<br \/>\n    guard &#061; KernelTuningGuard()<br \/>\n    # \u6a21\u62df LLM \u8f93\u51fa\u4e86\u5e26\u5e7b\u89c9\u7684\u5371\u9669\u53c2\u6570<br \/>\n    llm_dirty_input &#061; {<br \/>\n        &#034;net.core.somaxconn&#034;: -999,  # \u4e25\u91cd\u8d8a\u754c<br \/>\n        &#034;net.ipv4.tcp_max_syn_backlog&#034;: 999999999, # \u4e25\u91cd\u8d8a\u754c<br \/>\n        &#034;kernel.sysrq&#034;: 1 # \u4e0d\u5728\u767d\u540d\u5355<br \/>\n    }<br \/>\n    guard.safe_tune(llm_dirty_input)<\/p>\n<h3>\u53cc\u8f68\u53ef\u89c2\u6d4b\u4e0e\u5ba1\u8ba1&#xff1a;\u8ba9\u6bcf\u4e00\u6b21\u964d\u7ea7\u90fd\u6709\u8ff9\u53ef\u5faa<\/h3>\n<p>\u5149\u6709\u4ee3\u7801\u81ea\u52a8\u964d\u7ea7\u8fd8\u4e0d\u591f&#xff0c;\u4e00\u65e6\u53d1\u751f\u6a21\u578b\u8f93\u51fa\u88ab\u62e6\u622a\u6216\u89e6\u53d1 Fallback&#xff0c;\u7cfb\u7edf\u5fc5\u987b\u4fdd\u5b58\u5b8c\u6574\u7684\u4e0a\u4e0b\u6587\u4f9b\u540e\u7eed\u5206\u6790\u3002<\/p>\n<p>\u5efa\u8bae\u5728\u751f\u4ea7\u73af\u5883\u914d\u7f6e Prometheus \u8b66\u62a5\u89c4\u5219&#xff0c;\u76d1\u63a7\u964d\u7ea7\u4e8b\u4ef6\u7684\u53d1\u751f\u9891\u7387\u3002\u5982\u679c Agent \u89e6\u53d1 Fallback \u7684\u9891\u7387\u8d85\u8fc7 5%&#xff0c;\u5fc5\u987b\u786c\u6027\u6253\u65ad Agent \u7684\u8c03\u7528\u6743\u9650&#xff1a;<\/p>\n<p># Prometheus \u76d1\u63a7\u89c4\u5219&#xff1a;Kernel Tuning Fallback \u964d\u7ea7\u8b66\u62a5<br \/>\ngroups:<br \/>\n  &#8211; name: kernel_agent_safety<br \/>\n    rules:<br \/>\n      &#8211; alert: KernelTuningFallbackTriggered<br \/>\n        expr: increase(kernel_tuning_fallback_total[5m]) &gt; 0<br \/>\n        for: 0m<br \/>\n        labels:<br \/>\n          severity: warning<br \/>\n        annotations:<br \/>\n          summary: &#034;\u5185\u6838 Agent \u89e6\u53d1\u4e86\u9759\u6001\u964d\u7ea7\u9632\u7ebf&#034;<br \/>\n          description: &#034;\u68c0\u6d4b\u5230 LLM \u5efa\u8bae\u53c2\u6570\u8d8a\u754c\u6216\u5199\u5165\u5f15\u53d1\u534f\u8bae\u6808\u4e22\u5305&#xff0c;\u5df2\u81ea\u52a8\u6062\u590d\u4e3a Static Fallback \u914d\u7f6e\u3002&#034;<\/p>\n<p>\u5c06 LLM \u7684\u7075\u6d3b\u6027\u9650\u5236\u5728\u4e25\u683c\u7684\u767d\u540d\u5355\u4e0e\u6570\u503c\u5305\u5939\u6846\u91cc&#xff0c;\u518d\u901a\u8fc7\u63a2\u9488\u548c\u9759\u6001 Fallback \u968f\u65f6\u51c6\u5907\u63a5\u7ba1\u7cfb\u7edf&#xff0c;\u8fd9\u6837\u624d\u80fd\u5728\u63d0\u5347\u6548\u7387\u7684\u540c\u65f6&#xff0c;\u5b88\u4f4f Linux \u5185\u6838\u8c03\u4f18\u7684\u5e95\u7ebf\u3002<\/p>\n<h3>\u4f7f\u7528\u4e0e\u9a8c\u8bc1<\/h3>\n","protected":false},"excerpt":{"rendered":"<p>\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316&#xff1a;\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7sysctl \u547d\u4ee4\u5f15\u53d1\u7684\u751f\u4ea7\u96ea\u5d29&#xff1a;\u667a\u80fd Agent \u8c03\u6574 somaxconn \u5bfc\u81f4\u7684 SYN Flood \u5047\u8c61<br \/>\n\u4e00\u6b21\u5178\u578b\u7684\u7ebf\u4e0a\u4e8b\u6545\u5f7b\u5e95\u6253\u788e\u4e86\u56e2\u961f\u5bf9\u201c\u5927\u6a21\u578b\u81ea\u52a8\u5316\u8fd0\u7ef4\u201d\u7684\u5e7b\u60f3\u3002\u81ea\u52a8\u8c03\u4f18 Agent \u88ab\u6388\u6743\u6839\u636e\u7cfb\u7edf CPU \u4e0e\u7f51\u7edc IRQ \u74f6\u9888\u52a8\u6001\u4fee\u6539 \/etc\/sysctl.conf \u53c2\u6570\u3002<br \/>\n\u5728\u5927\u6d41\u91cf\u538b\u6d4b\u573a\u666f\u4e0b&#xff0c;Agent \u8c03\u7528\u7684 LLM \u6a21\u578b\u4ea7\u751f\u4e86\u53c2\u6570\u6570\u503c\u5e7b\u89c9&amp;#xff0c<\/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-98517","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>\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \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\/98517.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316&#xff1a;\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7sysctl \u547d\u4ee4\u5f15\u53d1\u7684\u751f\u4ea7\u96ea\u5d29&#xff1a;\u667a\u80fd Agent \u8c03\u6574 somaxconn \u5bfc\u81f4\u7684 SYN Flood \u5047\u8c61 \u4e00\u6b21\u5178\u578b\u7684\u7ebf\u4e0a\u4e8b\u6545\u5f7b\u5e95\u6253\u788e\u4e86\u56e2\u961f\u5bf9\u201c\u5927\u6a21\u578b\u81ea\u52a8\u5316\u8fd0\u7ef4\u201d\u7684\u5e7b\u60f3\u3002\u81ea\u52a8\u8c03\u4f18 Agent \u88ab\u6388\u6743\u6839\u636e\u7cfb\u7edf CPU \u4e0e\u7f51\u7edc IRQ \u74f6\u9888\u52a8\u6001\u4fee\u6539 \/etc\/sysctl.conf \u53c2\u6570\u3002 \u5728\u5927\u6d41\u91cf\u538b\u6d4b\u573a\u666f\u4e0b&#xff0c;Agent \u8c03\u7528\u7684 LLM \u6a21\u578b\u4ea7\u751f\u4e86\u53c2\u6570\u6570\u503c\u5e7b\u89c9&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/98517.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-31T18:16:50+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260831181649-6a95c511bc6ae.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/98517.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/98517.html\",\"name\":\"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-31T18:16:50+00:00\",\"dateModified\":\"2026-08-31T18:16:50+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/98517.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/98517.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/98517.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7\"}]},{\"@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":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \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\/98517.html","og_locale":"zh_CN","og_type":"article","og_title":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316&#xff1a;\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7sysctl \u547d\u4ee4\u5f15\u53d1\u7684\u751f\u4ea7\u96ea\u5d29&#xff1a;\u667a\u80fd Agent \u8c03\u6574 somaxconn \u5bfc\u81f4\u7684 SYN Flood \u5047\u8c61 \u4e00\u6b21\u5178\u578b\u7684\u7ebf\u4e0a\u4e8b\u6545\u5f7b\u5e95\u6253\u788e\u4e86\u56e2\u961f\u5bf9\u201c\u5927\u6a21\u578b\u81ea\u52a8\u5316\u8fd0\u7ef4\u201d\u7684\u5e7b\u60f3\u3002\u81ea\u52a8\u8c03\u4f18 Agent \u88ab\u6388\u6743\u6839\u636e\u7cfb\u7edf CPU \u4e0e\u7f51\u7edc IRQ \u74f6\u9888\u52a8\u6001\u4fee\u6539 \/etc\/sysctl.conf \u53c2\u6570\u3002 \u5728\u5927\u6d41\u91cf\u538b\u6d4b\u573a\u666f\u4e0b&#xff0c;Agent \u8c03\u7528\u7684 LLM \u6a21\u578b\u4ea7\u751f\u4e86\u53c2\u6570\u6570\u503c\u5e7b\u89c9&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/98517.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-31T18:16:50+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260831181649-6a95c511bc6ae.webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/98517.html","url":"https:\/\/www.wsisp.com\/helps\/98517.html","name":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-31T18:16:50+00:00","dateModified":"2026-08-31T18:16:50+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/98517.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/98517.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/98517.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u64cd\u4f5c\u7cfb\u7edf \u5185\u6838\u8c03\u4f18\u4e0e\u7f51\u7edc\u534f\u8bae\u6808\u6027\u80fd\u4f18\u5316\uff1a\u6a21\u578b\u51fa\u9519\u65f6\u600e\u6837\u5feb\u901f\u964d\u7ea7"}]},{"@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\/98517","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=98517"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/98517\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=98517"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=98517"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=98517"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=98517"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}