{"id":89784,"date":"2026-08-03T18:40:41","date_gmt":"2026-08-03T10:40:41","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/89784.html"},"modified":"2026-08-03T18:40:41","modified_gmt":"2026-08-03T10:40:41","slug":"%e7%ba%bf%e4%b8%8a-go-%e9%9b%86%e7%be%a4%e6%af%8f%e9%9a%94-1-%e5%b0%8f%e6%97%b6%e6%8a%96%e5%8a%a8%e5%8d%a1%e9%a1%bf%ef%bc%9f%e7%ab%9f%e6%98%af-cgroup-cpu-quota-%e8%b8%a9%e9%99%90%e4%ba%86","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/89784.html","title":{"rendered":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86"},"content":{"rendered":"<h2>\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f&#xff1f;\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86<\/h2>\n<h3>1. \u5b9a\u65f6\u5361\u987f\u73b0\u8c61&#xff1a;\u76d1\u63a7\u5927\u76d8\u4e0a&#xff0c;P99 \u5ef6\u8fdf\u6bcf\u9694 1 \u5c0f\u65f6\u56fa\u5b9a\u51fa\u73b0\u5cf0\u503c<\/h3>\n<p>\u7ebf\u4e0a\u6392\u969c\u9047\u5230\u7684\u5947\u8469\u73b0\u8c61&#xff1a;<\/p>\n<p>\u67d0\u4e2a\u6838\u5fc3 Go \u670d\u52a1\u5728 Docker \u5bb9\u5668\u5316\u90e8\u7f72\u540e&#xff0c;\u76d1\u63a7\u5927\u76d8\u4e0a\u7684 P99 \u5ef6\u8fdf\u5448\u73b0\u51fa\u60ca\u4eba\u7684\u5468\u671f\u6027\u952f\u9f7f&#xff1a;\u6bcf\u9694\u6574\u70b9\u4e00\u5230&#xff0c;P99 \u5ef6\u8fdf\u5c31\u7a81\u7136\u4ece 10ms \u98d9\u5347\u5230 800ms&#xff0c;\u6301\u7eed\u7ea6 2 \u5206\u949f\u540e\u53c8\u81ea\u52a8\u6062\u590d\u6b63\u5e38\u3002\u67e5\u770b\u5bb9\u5668\u7684 CPU \u4f7f\u7528\u7387\u548c\u5185\u5b58\u5360\u7528&#xff0c;\u5747\u8fdc\u8fdc\u4f4e\u4e8e\u7533\u8bf7\u7684 Limits \u9650\u5236\u3002<\/p>\n<p>\u6ca1\u6709\u53d1\u751f Full GC&#xff0c;\u4e5f\u6ca1\u6709\u6162 SQL Log&#xff0c;\u4e3a\u4ec0\u4e48 Go \u8fdb\u7a0b\u4f1a\u50cf\u5b9a\u95f9\u949f\u4e00\u6837\u5b9a\u65f6\u201c\u50f5\u6b7b\u201d&#xff1f;\u503c\u73ed\u8fd0\u7ef4\u591a\u6b21\u91cd\u542f\u5bb9\u5668\u4f9d\u7136\u65e0\u6cd5\u6839\u6cbb\u3002\u5f00\u53d1\u56e2\u961f\u4e00\u5ea6\u6000\u7591\u662f\u5e95\u5c42\u7684\u7269\u7406\u786c\u4ef6\u6545\u969c&#xff0c;\u4f46\u6362\u4e86\u8282\u70b9\u90e8\u7f72\u540e\u6296\u52a8\u4f9d\u7136\u5982\u671f\u800c\u81f3\u3002<\/p>\n<p>flowchart TD<br \/>\n    Pod[Go \u5e94\u7528\u8fd0\u884c\u5728 2 \u6838 K8s Pod] &#8211;&gt; Default[\u672a\u914d\u7f6e automaxprocs]<br \/>\n    Default &#8211;&gt; Host[Go Runtime \u8bc6\u522b\u5bbf\u4e3b\u673a 64 \u6838 CPU]<br \/>\n    Host &#8211;&gt; Threads[\u521b\u5efa 64 \u4e2a P \u4e0e\u5927\u91cf\u8c03\u5ea6\u7ebf\u7a0b]<br \/>\n    Threads &#8211;&gt; Quota[\u89e6\u53d1 Linux cgroup CFS CPU Quota \u989d\u5ea6\u6253\u6ee1]<br \/>\n    Quota &#8211;&gt; Throttle[\u5185\u6838\u5f3a\u884c Throttle \u6682\u505c\u7ebf\u7a0b\u6267\u884c 100ms]<br \/>\n    Throttle &#8211;&gt; Spike[P99 \u5ef6\u8fdf\u5468\u671f\u6027\u98d9\u5230 800ms]<\/p>\n<h3>2. cgroup \u6392\u67e5&#xff1a;cat \/sys\/fs\/cgroup\/cpu\/cpu.stat \u53d1\u73b0 nr_throttled \u7206\u8868<\/h3>\n<p>\u4e3a\u4e86\u5b9a\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u5c42\u9762\u7684\u6291\u5236\u73b0\u8c61&#xff0c;\u6211\u767b\u5f55 Pod \u5bb9\u5668\u67e5\u770b cgroup CFS (Completely Fair Scheduler) \u7684\u8c03\u5ea6\u7edf\u8ba1&#xff1a;<\/p>\n<p>cat \/sys\/fs\/cgroup\/cpu\/cpu.stat<\/p>\n<p>\u8f93\u51fa\u7684\u6307\u6807\u4ee4\u4eba\u9707\u60ca&#xff1a;<\/p>\n<p>nr_periods 120400<br \/>\nnr_throttled 45200<br \/>\nthrottled_time 89204012019<\/p>\n<p>nr_throttled&#xff08;CPU \u88ab\u6291\u5236\u7684\u5468\u671f\u6570&#xff09;\u5360\u6bd4\u5c45\u7136\u9ad8\u8fbe 37%&#xff01;\u8fd9\u610f\u5473\u7740\u8be5\u5bb9\u5668\u5728\u8d85\u8fc7\u4e09\u5206\u4e4b\u4e00\u7684\u65f6\u95f4\u91cc&#xff0c;\u88ab Linux \u5185\u6838\u5f3a\u884c\u5265\u593a\u4e86 CPU \u8c03\u5ea6\u7684\u6743\u5229\u3002\u67e5\u770b Go \u8fd0\u884c\u65f6 runtime.GOMAXPROCS(0) \u7684\u8f93\u51fa&#xff0c;\u53d1\u73b0\u5b83\u6253\u5370\u51fa\u4e86 64\u3002\u539f\u6765\u5bbf\u4e3b\u673a\u7269\u7406\u673a\u6709 64 \u4e2a CPU \u6838\u5fc3&#xff0c;\u4f46 K8s \u5bb9\u5668\u53ea\u5206\u914d\u4e86 2 \u4e2a CPU Limits\u3002Go Runtime \u9ed8\u8ba4\u8bfb\u53d6 \/proc\/cpuinfo \u8bef\u4ee5\u4e3a\u6709 64 \u4e2a\u903b\u8f91\u6838&#xff0c;\u4e8e\u662f\u521b\u5efa\u4e86 64 \u4e2a P \u548c\u6570\u5341\u4e2a\u7ebf\u7a0b\u3002<\/p>\n<p>\u5927\u91cf\u7ebf\u7a0b\u5728 2 \u6838\u7684\u5bb9\u5668\u4e0a\u9650\u91cc\u62a2\u5360 CPU&#xff0c;\u6781\u5feb\u5730\u5728 100ms CFS \u5468\u671f\u5185\u628a\u914d\u989d\u8017\u5c3d&#xff0c;\u5bfc\u81f4\u540e\u7eed\u65f6\u95f4\u91cc\u6574\u4e2a Go \u8fdb\u7a0b\u88ab\u5185\u6838\u5f3a\u5236\u6302\u8d77&#xff08;Throttled&#xff09;&#xff01;\u7cfb\u7edf\u5728\u9ad8\u5e76\u53d1\u51b2\u51fb\u4e0b\u51fa\u73b0\u4e86\u4e25\u91cd\u7684\u7ebf\u7a0b\u5207\u6362\u635f\u8017\u3002<\/p>\n<h3>3. \u6839\u56e0\u4e0e\u4fee\u590d&#xff1a;Go Runtime GOMAXPROCS \u4e0e\u5bb9\u5668\u914d\u989d\u51b2\u7a81&#xff0c;\u5f15\u5165 automaxprocs<\/h3>\n<p>\u89e3\u51b3\u6839\u56e0\u7684\u5173\u952e\u5728\u4e8e&#xff1a;\u8ba9 Go Runtime \u6b63\u786e\u611f\u77e5\u5bb9\u5668\u7684 cgroup CPU \u9650\u5236&#xff0c;\u800c\u4e0d\u662f\u5bbf\u4e3b\u673a\u7684\u7269\u7406\u6838\u6570\u3002<\/p>\n<p>Uber \u5f00\u6e90\u7684 uber-go\/automaxprocs \u5e93\u53ef\u4ee5\u81ea\u52a8\u8bc6\u522b cgroup \u9650\u5236\u5e76\u6b63\u786e\u8c03\u6574 GOMAXPROCS\u3002<\/p>\n<p>\u6211\u4eec\u5728 main.go \u4e2d\u5f15\u5165&#xff1a;<\/p>\n<p>package main<\/p>\n<p>import (<br \/>\n&#034;fmt&#034;<br \/>\n&#034;net\/http&#034;<br \/>\n&#034;runtime&#034;<\/p>\n<p>_ &#034;go.uber.org\/automaxprocs&#034; \/\/ \u81ea\u52a8\u6839\u636e\u5bb9\u5668 cgroup Quota \u8c03\u6574 GOMAXPROCS<br \/>\n)<\/p>\n<p>func main() {<br \/>\n\/\/ \u9a8c\u8bc1\u5b9e\u9645\u751f\u6548\u7684 GOMAXPROCS \u6570\u91cf<br \/>\nfmt.Printf(&#034;[INIT] \u5f53\u524d\u5bb9\u5668\u611f\u77e5\u5230\u7684 GOMAXPROCS: %d<br \/>\n&#034;, runtime.GOMAXPROCS(0))<\/p>\n<p>http.HandleFunc(&#034;\/health&#034;, func(w http.ResponseWriter, r *http.Request) {<br \/>\nw.Write([]byte(&#034;OK&#034;))<br \/>\n})<\/p>\n<p>http.ListenAndServe(&#034;:8080&#034;, nil)<br \/>\n}<\/p>\n<p>\u540c\u65f6\u5728 Dockerfile \u90e8\u7f72\u73af\u5883\u53d8\u91cf\u4e2d\u52a0\u5165\u663e\u793a\u7684\u63a7\u5236&#xff1a;<\/p>\n<p>ENV GOMAXPROCS&#061;2<\/p>\n<h3>4. \u6548\u679c\u6821\u9a8c&#xff1a;\u5f7b\u5e95\u6d88\u9664\u5468\u671f\u6027 CPU \u6291\u6b62\u5361\u987f<\/h3>\n<p>\u91cd\u6784\u4fee\u590d\u53d1\u5e03\u5230 K8s \u96c6\u7fa4\u540e&#xff0c;\u6211\u4eec\u518d\u6b21\u89c2\u5bdf cgroup\/cpu.stat&#xff1a;nr_throttled \u7684\u589e\u957f\u5f7b\u5e95\u505c\u6b62&#xff01;<\/p>\n<p>\u76d1\u63a7\u5927\u76d8\u4e0a\u7684 P99 \u5ef6\u8fdf\u5468\u671f\u6027\u952f\u9f7f\u5cf0\u503c\u77ac\u95f4\u5e73\u590d&#xff0c;\u4e00\u76f4\u7a33\u7a33\u4fdd\u6301\u5728 8ms~12ms \u7684\u8d85\u4f4e\u5ef6\u8fdf\u6c34\u5e73\u3002\u5b9a\u65f6\u201c\u5047\u6b7b\u201d\u5361\u987f\u5f7b\u5e95\u6210\u4e3a\u4e86\u5386\u53f2\u3002<\/p>\n<p>\u7cfb\u7edf\u541e\u5410\u91cf\u4e0a\u5347\u4e86\u8fd1 30%&#xff0c;\u7ebf\u7a0b\u5207\u6362\u4e0a\u4e0b\u6587&#xff08;Context Switch&#xff09;\u964d\u4f4e\u4e86 80%\u3002\u5728\u957f\u65f6\u95f4\u9ad8\u8d1f\u8377\u6d4b\u8bd5\u4e0b&#xff0c;\u5bb9\u5668\u8fd0\u884c\u5e73\u7a33&#xff0c;\u8d44\u6e90\u6d88\u8017\u5b8c\u5168\u5904\u4e8e\u53ef\u63a7\u8303\u56f4\u5185\u3002<\/p>\n<h3>5. \u603b\u7ed3&#xff1a;\u5bb9\u5668\u5316 Go \u5e94\u7528\u7684\u6700\u4f73\u914d\u989d\u5b9e\u8df5<\/h3>\n<li>\u5fc5\u987b\u5f15\u5165 automaxprocs&#xff1a;\u6240\u6709\u5bb9\u5668\u5316 Go \u9879\u76ee\u5fc5\u987b\u5728 main.go \u4e2d\u533f\u540d\u5bfc\u5165 _ &#034;go.uber.org\/automaxprocs&#034;\u3002<\/li>\n<li>\u8b66\u60d5 cgroup CFS Quota&#xff1a;\u5bb9\u5668\u4f7f\u7528\u7387\u770b\u8d77\u6765\u4e0d\u9ad8&#xff0c;\u4f46\u5e76\u53d1\u7ebf\u7a0b\u8fc7\u591a\u4f1a\u8fc5\u901f\u6253\u6ee1 100ms \u7a97\u53e3\u914d\u989d\u5f15\u53d1 Throttle\u3002<\/li>\n<li>\u76d1\u63a7 nr_throttled \u6307\u6807&#xff1a;\u5c06\u5bb9\u5668 CPU Throttle \u6bd4\u4f8b\u66b4\u9732\u7ed9 Prometheus&#xff0c;\u5927\u4e8e 5% \u5373\u4ee3\u8868\u914d\u7f6e\u5b58\u5728\u4e25\u91cd\u51b2\u7a81\u3002<\/li>\n<li>\u5408\u7406\u8bbe\u7f6e CFS Period&#xff1a;\u5728 K8s API \u4e2d\u5bf9\u6781\u9ad8\u5e76\u53d1\u670d\u52a1\u8bbe\u7f6e cpu-cfs-quota-period \u4e3a 20ms \u4ee5\u964d\u4f4e\u987f\u632b\u5ef6\u8fdf\u3002<\/li>\n<li>\u9650\u5236 Goroutine \u6700\u5927\u4e0a\u9650&#xff1a;\u9ad8\u5e76\u53d1\u63a5\u53e3\u4f7f\u7528 GoPool \u9650\u5236\u903b\u8f91\u534f\u7a0b\u4e0a\u9650&#xff0c;\u907f\u514d\u65e0\u8282\u5236\u521b\u5efa\u7ebf\u7a0b\u62d6\u57ae\u5bb9\u5668\u3002<\/li>\n<h3>6. \u5bb9\u5668\u5316 Go \u6027\u80fd\u8c03\u4f18\u5b9e\u6218\u603b\u7ed3<\/h3>\n<p>\u6392\u67e5 cgroup CPU quota \u6291\u6b62\u5361\u987f\u7684\u8fc7\u7a0b&#xff0c;\u8ba9\u6211\u4eec\u6df1\u523b\u610f\u8bc6\u5230&#xff1a;\u8fd0\u884c\u5728 Docker \/ K8s \u5bb9\u5668\u4e2d\u7684 Go \u5e94\u7528\u7a0b\u5e8f&#xff0c;\u7edd\u4e0d\u662f\u8fd0\u884c\u5728\u7269\u7406\u673a\u4e0a\u7684\u7b80\u5355\u590d\u5236\u54c1\u3002<\/p>\n<p>Go Runtime \u8bed\u8a00\u5c42\u9762\u7684\u8f7b\u91cf\u7ea7 P \u8c03\u5ea6\u5668\u3001\u5783\u573e\u56de\u6536\u5668&#xff08;GC&#xff09;&#xff0c;\u5fc5\u987b\u4e0e\u5e95\u5c42 Linux \u5185\u6838\u7684 cgroup\u3001CFS \u8c03\u5ea6\u5668\u4ee5\u53ca Namespace \u9694\u79bb\u673a\u5236\u4ea7\u751f\u548c\u8c10\u7684\u5171\u9e23\u3002\u5ffd\u89c6\u4e86\u5bb9\u5668\u73af\u5883\u7684\u9650\u5236&#xff0c;\u76f2\u76ee\u4f9d\u8d56\u9ed8\u8ba4\u914d\u7f6e&#xff0c;\u6781\u6613\u89e6\u53d1\u8bf8\u5982 GOMAXPROCS \u66b4\u6da8\u5bfc\u81f4 CPU \u6291\u6b62\u3001\u5185\u5b58\u9875\u672a\u5f52\u8fd8\u5bfc\u81f4 OOM Killed \u7b49\u9690\u853d\u6545\u969c\u3002<\/p>\n<p>\u901a\u8fc7\u5728 main.go \u4e2d\u5f15\u5165 uber-go\/automaxprocs&#xff0c;\u914d\u5408 Prometheus \u76d1\u63a7\u5bfc\u51fa\u7684 container_cpu_cfs_throttled_periods_total \u6838\u5fc3\u6307\u6807&#xff0c;\u6211\u4eec\u5f7b\u5e95\u638c\u63e1\u4e86\u5bb9\u5668\u5316 Go \u5e94\u7528\u7684\u9ad8\u53ef\u7528\u8c03\u4f18\u79d8\u8bc0&#xff0c;\u4e3a\u96c6\u7fa4\u67b6\u6784\u7684\u9ad8\u6548\u7a33\u5b9a\u8fd0\u884c\u7b51\u7262\u4e86\u575a\u5b9e\u7684\u5de5\u7a0b\u6839\u57fa\u3002<\/p>\n<h3>7. \u5bb9\u5668\u5316 Go \u5e94\u7528\u914d\u989d\u6cbb\u7406\u4f53\u4f1a<\/h3>\n<p>Go \u8fd0\u884c\u65f6\u7684 GMP \u8c03\u5ea6\u673a\u5236\u4e0e Linux cgroup CFS \u914d\u989d\u4e4b\u95f4\u7684\u76f8\u4e92\u4f5c\u7528&#xff0c;\u662f\u5bb9\u5668\u5316\u90e8\u7f72\u4e2d\u5bb9\u6613\u88ab\u5ffd\u89c6\u7684\u6027\u80fd\u9677\u9631\u3002\u5728\u5fae\u670d\u52a1\u67b6\u6784\u4e2d&#xff0c;\u52a1\u5fc5\u5f15\u5165 automaxprocs \u6765\u5b9e\u73b0\u5bb9\u5668 CPU \u9650\u5236\u7684\u81ea\u52a8\u611f\u77e5&#xff0c;\u9632\u6b62\u7531\u4e8e\u7ebf\u7a0b\u8fc7\u591a\u5bfc\u81f4\u7684 CPU \u6291\u6b62\u3002\u7ed3\u5408 Prometheus \u544a\u8b66\u6307\u6807\u4e0e\u5408\u7406\u914d\u7f6e\u7684 CFS \u5468\u671f&#xff0c;\u80fd\u591f\u663e\u8457\u964d\u4f4e\u7cfb\u7edf\u5361\u987f\u4e0e\u4e0a\u4e0b\u6587\u5207\u6362\u5f00\u9500&#xff0c;\u4e3a\u5e94\u7528\u63d0\u4f9b\u7a33\u5b9a\u53ef\u9760\u7684\u8fd0\u884c\u73af\u5883\u3002\u901a\u8fc7\u5bf9 Go \u5bb9\u5668\u5316\u914d\u989d\u8c03\u4f18\u7684\u6df1\u5165\u63a2\u7d22&#xff0c;\u6211\u4eec\u603b\u7ed3\u51fa\u4e86\u4e00\u5957\u6807\u51c6\u5316\u7684\u751f\u4ea7\u6392\u969c\u4e0e\u6027\u80fd\u4f18\u5316 SOP \u6d41\u7a0b\u3002\u4ece\u6700\u521d\u7684\u544a\u8b66\u89e6\u53d1\u3001\u76d1\u63a7\u770b\u677f\u5206\u6790&#xff0c;\u5230\u4f7f\u7528\u7cfb\u7edf\u7ea7\u7684\u5de5\u5177\u5b9a\u4f4d\u5e95\u5c42\u6839\u56e0&#xff0c;\u518d\u5230\u5f15\u5165\u5f00\u6e90\u5e93\u8fdb\u884c\u81ea\u52a8\u611f\u77e5\u4e0e\u4fee\u590d&#xff0c;\u6bcf\u4e00\u4e2a\u6b65\u9aa4\u90fd\u73af\u73af\u76f8\u6263\u3002\u8fd9\u79cd\u4e25\u8c28\u7684\u5de5\u7a0b\u6001\u5ea6\u4e0d\u4ec5\u5e2e\u52a9\u6211\u4eec\u89e3\u51b3\u4e86\u7279\u5b9a\u7684 CPU \u6291\u6b62\u95ee\u9898&#xff0c;\u4e5f\u4e3a\u540e\u7eed\u5927\u578b Golang \u5fae\u670d\u52a1\u96c6\u7fa4\u7684\u5e73\u7a33\u8fd0\u884c\u5960\u5b9a\u4e86\u575a\u5b9e\u7684\u57fa\u7840\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f&#xff1f;\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86<br \/>\n1. \u5b9a\u65f6\u5361\u987f\u73b0\u8c61&#xff1a;\u76d1\u63a7\u5927\u76d8\u4e0a&#xff0c;P99 \u5ef6\u8fdf\u6bcf\u9694 1 \u5c0f\u65f6\u56fa\u5b9a\u51fa\u73b0\u5cf0\u503c<br \/>\n\u7ebf\u4e0a\u6392\u969c\u9047\u5230\u7684\u5947\u8469\u73b0\u8c61&#xff1a;<br \/>\n\u67d0\u4e2a\u6838\u5fc3 Go \u670d\u52a1\u5728 Docker \u5bb9\u5668\u5316\u90e8\u7f72\u540e&#xff0c;\u76d1\u63a7\u5927\u76d8\u4e0a\u7684 P99 \u5ef6\u8fdf\u5448\u73b0\u51fa\u60ca\u4eba\u7684\u5468\u671f\u6027\u952f\u9f7f&#xff1a;\u6bcf\u9694\u6574\u70b9\u4e00\u5230&#xff0c;P99 \u5ef6\u8fdf\u5c31\u7a81\u7136\u4ece 10ms \u98d9\u5347\u5230 800ms&#xff0c;\u6301\u7eed\u7ea6 2 \u5206<\/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":[723,458,594,87],"topic":[],"class_list":["post-89784","post","type-post","status-publish","format-standard","hentry","category-server","tag-react","tag-vue","tag-web","tag-87"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \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\/89784.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f&#xff1f;\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 1. \u5b9a\u65f6\u5361\u987f\u73b0\u8c61&#xff1a;\u76d1\u63a7\u5927\u76d8\u4e0a&#xff0c;P99 \u5ef6\u8fdf\u6bcf\u9694 1 \u5c0f\u65f6\u56fa\u5b9a\u51fa\u73b0\u5cf0\u503c \u7ebf\u4e0a\u6392\u969c\u9047\u5230\u7684\u5947\u8469\u73b0\u8c61&#xff1a; \u67d0\u4e2a\u6838\u5fc3 Go \u670d\u52a1\u5728 Docker \u5bb9\u5668\u5316\u90e8\u7f72\u540e&#xff0c;\u76d1\u63a7\u5927\u76d8\u4e0a\u7684 P99 \u5ef6\u8fdf\u5448\u73b0\u51fa\u60ca\u4eba\u7684\u5468\u671f\u6027\u952f\u9f7f&#xff1a;\u6bcf\u9694\u6574\u70b9\u4e00\u5230&#xff0c;P99 \u5ef6\u8fdf\u5c31\u7a81\u7136\u4ece 10ms \u98d9\u5347\u5230 800ms&#xff0c;\u6301\u7eed\u7ea6 2 \u5206\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/89784.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-03T10:40:41+00:00\" \/>\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\/89784.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/89784.html\",\"name\":\"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-03T10:40:41+00:00\",\"dateModified\":\"2026-08-03T10:40:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/89784.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/89784.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/89784.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86\"}]},{\"@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":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \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\/89784.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f&#xff1f;\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 1. \u5b9a\u65f6\u5361\u987f\u73b0\u8c61&#xff1a;\u76d1\u63a7\u5927\u76d8\u4e0a&#xff0c;P99 \u5ef6\u8fdf\u6bcf\u9694 1 \u5c0f\u65f6\u56fa\u5b9a\u51fa\u73b0\u5cf0\u503c \u7ebf\u4e0a\u6392\u969c\u9047\u5230\u7684\u5947\u8469\u73b0\u8c61&#xff1a; \u67d0\u4e2a\u6838\u5fc3 Go \u670d\u52a1\u5728 Docker \u5bb9\u5668\u5316\u90e8\u7f72\u540e&#xff0c;\u76d1\u63a7\u5927\u76d8\u4e0a\u7684 P99 \u5ef6\u8fdf\u5448\u73b0\u51fa\u60ca\u4eba\u7684\u5468\u671f\u6027\u952f\u9f7f&#xff1a;\u6bcf\u9694\u6574\u70b9\u4e00\u5230&#xff0c;P99 \u5ef6\u8fdf\u5c31\u7a81\u7136\u4ece 10ms \u98d9\u5347\u5230 800ms&#xff0c;\u6301\u7eed\u7ea6 2 \u5206","og_url":"https:\/\/www.wsisp.com\/helps\/89784.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-03T10:40:41+00:00","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\/89784.html","url":"https:\/\/www.wsisp.com\/helps\/89784.html","name":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-03T10:40:41+00:00","dateModified":"2026-08-03T10:40:41+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/89784.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/89784.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/89784.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7ebf\u4e0a Go \u96c6\u7fa4\u6bcf\u9694 1 \u5c0f\u65f6\u6296\u52a8\u5361\u987f\uff1f\u7adf\u662f cgroup CPU quota \u8e29\u9650\u4e86"}]},{"@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\/89784","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=89784"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/89784\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=89784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=89784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=89784"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=89784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}