{"id":287,"date":"2026-10-17T10:06:21","date_gmt":"2026-10-17T02:06:21","guid":{"rendered":"https:\/\/yykcj.com\/?p=287"},"modified":"2026-10-17T10:06:21","modified_gmt":"2026-10-17T02:06:21","slug":"node-js-%e6%80%a7%e8%83%bd%e8%b0%83%e4%bc%98%e5%ae%9e%e6%88%98%ef%bc%9a%e4%bb%8e%e7%81%ab%e7%84%b0%e5%9b%be%e5%88%b0%e4%ba%8b%e4%bb%b6%e5%be%aa%e7%8e%af%e7%9a%84%e6%b7%b1%e5%ba%a6%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/yykcj.com\/?p=287","title":{"rendered":"Node.js \u6027\u80fd\u8c03\u4f18\u5b9e\u6218\uff1a\u4ece\u706b\u7130\u56fe\u5230\u4e8b\u4ef6\u5faa\u73af\u7684\u6df1\u5ea6\u4f18\u5316"},"content":{"rendered":"<h2>\u80cc\u666f\uff1a\u4e3a\u4ec0\u4e48\u4f60\u7684 Node.js \u670d\u52a1\u8d8a\u6765\u8d8a\u6162\uff1f<\/h2>\n<p>\u5f88\u591a\u5f00\u53d1\u8005\u8ba4\u4e3a Node.js \u53ea\u9002\u5408 I\/O \u5bc6\u96c6\u578b\u573a\u666f\uff0c\u4e00\u65e6\u9047\u5230 CPU \u5bc6\u96c6\u578b\u4efb\u52a1\u5c31\u675f\u624b\u65e0\u7b56\u3002\u4f46\u771f\u5b9e\u7684\u751f\u4ea7\u73af\u5883\u4e2d\uff0c\u6027\u80fd\u95ee\u9898\u5f80\u5f80\u4e0d\u662f\u5355\u4e00\u539f\u56e0\u9020\u6210\u7684\uff1a\u53ef\u80fd\u662f\u67d0\u4e2a\u540c\u6b65\u64cd\u4f5c\u963b\u585e\u4e86\u4e8b\u4ef6\u5faa\u73af\uff0c\u53ef\u80fd\u662f\u5185\u5b58\u6cc4\u6f0f\u5bfc\u81f4 GC \u9891\u7e41\uff0c\u4e5f\u53ef\u80fd\u662f\u4f9d\u8d56\u5305\u4e2d\u7684\u4f4e\u6548\u7b97\u6cd5\u3002<\/p>\n<p>\u672c\u6587\u4ee5\u4e00\u4e2a\u6a21\u62df\u7684\u7535\u5546\u8ba2\u5355\u670d\u52a1\u4e3a\u4f8b\uff0c\u8be5\u670d\u52a1\u5728\u9ad8\u5e76\u53d1\u4e0b\u54cd\u5e94\u65f6\u95f4\u4ece 50ms \u98d9\u5347\u5230 2s\u3002\u6211\u4eec\u5c06\u4f7f\u7528 <strong>Clinic.js<\/strong> \u5de5\u5177\u94fe\u8fdb\u884c\u8bca\u65ad\uff0c\u7ed3\u5408 <strong>\u4e8b\u4ef6\u5faa\u73af\u76d1\u63a7<\/strong> \u548c <strong>\u4ee3\u7801\u7ea7\u4f18\u5316<\/strong>\uff0c\u6700\u7ec8\u5c06 P99 \u5ef6\u8fdf\u964d\u4f4e 80%\u3002<\/p>\n<p>> \u672c\u6587\u6240\u6709\u4ee3\u7801\u5747\u57fa\u4e8e Node.js 18+\uff0c\u53ef\u76f4\u63a5\u8fd0\u884c\u3002<\/p>\n<h2>\u7b2c\u4e00\u6b65\uff1a\u642d\u5efa\u53ef\u590d\u73b0\u7684\u6027\u80fd\u6d4b\u8bd5\u73af\u5883<\/h2>\n<p>\u9996\u5148\uff0c\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684 HTTP \u670d\u52a1\uff0c\u5305\u542b\u4e24\u4e2a\u63a5\u53e3\uff1a\u4e00\u4e2a\u5feb\u901f\u8fd4\u56de\uff0c\u4e00\u4e2a\u6a21\u62df CPU \u5bc6\u96c6\u578b\u8ba1\u7b97\uff08\u5982\u751f\u6210\u8ba2\u5355\u62a5\u8868\uff09\u3002<\/p>\n<pre><code class=\"language-javascript\">\n\/\/ server.js\nconst http = require(&#x27;http&#x27;);\nconst crypto = require(&#x27;crypto&#x27;);\n\nconst server = http.createServer((req, res) =&gt; {\n  if (req.url === &#x27;\/fast&#x27;) {\n    res.end(&#x27;OK&#x27;);\n  } else if (req.url === &#x27;\/report&#x27;) {\n    \/\/ \u6a21\u62df CPU \u5bc6\u96c6\u578b\u4efb\u52a1\uff1a\u8ba1\u7b97\u5927\u91cf\u54c8\u5e0c\n    let result = &#x27;&#x27;;\n    for (let i = 0; i &lt; 1e5; i++) {\n      result = crypto.createHash(&#x27;sha256&#x27;).update(result + i).digest(&#x27;hex&#x27;);\n    }\n    res.end(result);\n  } else {\n    res.statusCode = 404;\n    res.end(&#x27;Not Found&#x27;);\n  }\n});\n\nserver.listen(3000, () =&gt; console.log(&#x27;Server running on port 3000&#x27;));\n<\/code><\/pre>\n<p>\u542f\u52a8\u670d\u52a1\u540e\uff0c\u4f7f\u7528 <code>autocannon<\/code> \u8fdb\u884c\u538b\u6d4b\uff1a<\/p>\n<pre><code class=\"language-bash\">\nnpm install -g autocannon\n# \u6a21\u62df 100 \u4e2a\u5e76\u53d1\u8fde\u63a5\uff0c\u6301\u7eed 10 \u79d2\nautocannon -c 100 -d 10 http:\/\/localhost:3000\/report\n<\/code><\/pre>\n<p>\u4f60\u4f1a\u770b\u5230\u7c7b\u4f3c\u8f93\u51fa\uff1a<\/p>\n<pre><code>\nRunning 10s test @ http:\/\/localhost:3000\/report\n100 connections\n\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n\u2502 Stat    \u2502 2.5%  \u2502 50%   \u2502 97.5% \u2502 99%   \u2502 Avg      \u2502 Stdev   \u2502\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n\u2502 Latency \u2502 120ms \u2502 450ms \u2502 980ms \u2502 1.2s  \u2502 520ms    \u2502 210ms   \u2502\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n<\/code><\/pre>\n<p>P99 \u5ef6\u8fdf\u8fbe\u5230 1.2 \u79d2\uff0c\u663e\u7136\u4e0d\u53ef\u63a5\u53d7\u3002\u63a5\u4e0b\u6765\u6211\u4eec\u4f7f\u7528\u5de5\u5177\u5b9a\u4f4d\u74f6\u9888\u3002<\/p>\n<h2>\u7b2c\u4e8c\u6b65\uff1a\u4f7f\u7528 Clinic.js \u751f\u6210\u706b\u7130\u56fe\u4e0e\u4e8b\u4ef6\u5faa\u73af\u56fe<\/h2>\n<p>Clinic.js \u662f Node.js \u5b98\u65b9\u63a8\u8350\u7684\u6027\u80fd\u8bca\u65ad\u5de5\u5177\u5957\u4ef6\uff0c\u5305\u542b Doctor\u3001Flame\u3001Bubbleprof \u4e09\u4e2a\u5b50\u5de5\u5177\u3002\u6211\u4eec\u5b89\u88c5\u5e76\u8fd0\u884c\uff1a<\/p>\n<pre><code class=\"language-bash\">\nnpm install -g clinic\nclinic doctor -- node server.js\n<\/code><\/pre>\n<p>\u7136\u540e\u5728\u53e6\u4e00\u4e2a\u7ec8\u7aef\u7528 <code>autocannon<\/code> \u538b\u6d4b\uff0c\u7ed3\u675f\u540e\u6309 Ctrl+C\uff0cClinic \u4f1a\u81ea\u52a8\u751f\u6210\u62a5\u544a\u5e76\u6253\u5f00\u6d4f\u89c8\u5668\u3002<\/p>\n<p>\u5728 Doctor \u62a5\u544a\u4e2d\uff0c\u4f60\u4f1a\u770b\u5230 <strong>\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf<\/strong> \u548c <strong>CPU \u4f7f\u7528\u7387<\/strong> \u7684\u65f6\u5e8f\u56fe\u3002\u5982\u679c\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf\u51fa\u73b0\u5c16\u5cf0\uff0c\u8bf4\u660e\u6709\u540c\u6b65\u963b\u585e\u64cd\u4f5c\u3002<\/p>\n<p>\u8fdb\u4e00\u6b65\u4f7f\u7528 Flame \u751f\u6210\u706b\u7130\u56fe\uff1a<\/p>\n<pre><code class=\"language-bash\">\nclinic flame -- node server.js\n<\/code><\/pre>\n<p>\u538b\u6d4b\u540e\u751f\u6210\u7684\u706b\u7130\u56fe\u4e2d\uff0c\u4f60\u4f1a\u770b\u5230 <code>crypto.createHash<\/code> \u5360\u636e\u4e86\u5927\u90e8\u5206\u65f6\u95f4\uff0c\u4e14\u8c03\u7528\u6808\u663e\u793a\u5b83\u662f\u5728\u4e3b\u7ebf\u7a0b\u540c\u6b65\u6267\u884c\u7684\u3002\u8fd9\u6b63\u662f\u95ee\u9898\u6240\u5728\uff1a<strong>\u6bcf\u4e2a <code>\/report<\/code> \u8bf7\u6c42\u90fd\u540c\u6b65\u6267\u884c\u4e86 10 \u4e07\u6b21\u54c8\u5e0c\u8ba1\u7b97\uff0c\u5b8c\u5168\u963b\u585e\u4e86\u4e8b\u4ef6\u5faa\u73af<\/strong>\u3002<\/p>\n<p>> \ud83d\udca1 \u63d0\u793a\uff1a\u706b\u7130\u56fe\u4e2d\u6a2a\u5411\u5bbd\u5ea6\u4ee3\u8868 CPU \u65f6\u95f4\u5360\u6bd4\uff0c\u7eb5\u5411\u4ee3\u8868\u8c03\u7528\u6808\u6df1\u5ea6\u3002\u989c\u8272\u901a\u5e38\u65e0\u7279\u6b8a\u542b\u4e49\uff0c\u4f46\u53ef\u4ee5\u76f4\u89c2\u770b\u51fa\u70ed\u70b9\u51fd\u6570\u3002<\/p>\n<h2>\u7b2c\u4e09\u6b65\uff1a\u4f18\u5316 CPU \u5bc6\u96c6\u578b\u4efb\u52a1\u2014\u2014\u4f7f\u7528 Worker Threads<\/h2>\n<p>Node.js \u662f\u5355\u7ebf\u7a0b\u7684\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7 <code>worker_threads<\/code> \u6a21\u5757\u5c06 CPU \u5bc6\u96c6\u578b\u4efb\u52a1\u8f6c\u79fb\u5230\u5de5\u4f5c\u7ebf\u7a0b\uff0c\u907f\u514d\u963b\u585e\u4e3b\u7ebf\u7a0b\u3002<\/p>\n<p>\u6211\u4eec\u6539\u9020 <code>\/report<\/code> \u63a5\u53e3\uff1a<\/p>\n<pre><code class=\"language-javascript\">\n\/\/ server-worker.js\nconst http = require(&#x27;http&#x27;);\nconst { Worker } = require(&#x27;worker_threads&#x27;);\nconst path = require(&#x27;path&#x27;);\n\nconst server = http.createServer((req, res) =&gt; {\n  if (req.url === &#x27;\/fast&#x27;) {\n    res.end(&#x27;OK&#x27;);\n  } else if (req.url === &#x27;\/report&#x27;) {\n    const worker = new Worker(path.join(__dirname, &#x27;worker.js&#x27;));\n    worker.on(&#x27;message&#x27;, (result) =&gt; {\n      res.end(result);\n    });\n    worker.on(&#x27;error&#x27;, (err) =&gt; {\n      res.statusCode = 500;\n      res.end(err.message);\n    });\n  } else {\n    res.statusCode = 404;\n    res.end(&#x27;Not Found&#x27;);\n  }\n});\n\nserver.listen(3000, () =&gt; console.log(&#x27;Server running on port 3000&#x27;));\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">\n\/\/ worker.js\nconst { parentPort } = require(&#x27;worker_threads&#x27;);\nconst crypto = require(&#x27;crypto&#x27;);\n\nlet result = &#x27;&#x27;;\nfor (let i = 0; i &lt; 1e5; i++) {\n  result = crypto.createHash(&#x27;sha256&#x27;).update(result + i).digest(&#x27;hex&#x27;);\n}\nparentPort.postMessage(result);\n<\/code><\/pre>\n<p>\u518d\u6b21\u538b\u6d4b\uff0c\u4f60\u4f1a\u53d1\u73b0 <code>\/fast<\/code> \u63a5\u53e3\u7684\u54cd\u5e94\u65f6\u95f4\u4e0d\u518d\u53d7 <code>\/report<\/code> \u5f71\u54cd\uff0c\u800c <code>\/report<\/code> \u7684\u5ef6\u8fdf\u867d\u7136\u4ecd\u6709\uff0c\u4f46\u4e0d\u518d\u963b\u585e\u5176\u4ed6\u8bf7\u6c42\u3002<\/p>\n<p><strong>\u6ce8\u610f<\/strong>\uff1a\u6bcf\u4e2a\u8bf7\u6c42\u521b\u5efa\u4e00\u4e2a Worker \u7ebf\u7a0b\u5f00\u9500\u8f83\u5927\uff0c\u66f4\u597d\u7684\u505a\u6cd5\u662f\u4f7f\u7528 <strong>\u7ebf\u7a0b\u6c60<\/strong>\u3002Node.js \u5185\u7f6e\u4e86 <code>worker_threads<\/code> \u4f46\u6ca1\u6709\u6c60\u5316\u673a\u5236\uff0c\u53ef\u4ee5\u501f\u52a9 <code>piscina<\/code> \u5e93\uff1a<\/p>\n<pre><code class=\"language-bash\">\nnpm install piscina\n<\/code><\/pre>\n<pre><code class=\"language-javascript\">\nconst Piscina = require(&#x27;piscina&#x27;);\nconst piscina = new Piscina({ filename: path.join(__dirname, &#x27;worker.js&#x27;) });\n\n\/\/ \u5728\u8bf7\u6c42\u5904\u7406\u4e2d\nconst result = await piscina.run();\nres.end(result);\n<\/code><\/pre>\n<h2>\u7b2c\u56db\u6b65\uff1a\u76d1\u63a7\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf\uff0c\u5efa\u7acb\u6027\u80fd\u57fa\u7ebf<\/h2>\n<p>\u4f18\u5316\u540e\uff0c\u6211\u4eec\u9700\u8981\u6301\u7eed\u76d1\u63a7\u4e8b\u4ef6\u5faa\u73af\u7684\u5065\u5eb7\u72b6\u51b5\u3002Node.js \u63d0\u4f9b\u4e86 <code>perf_hooks<\/code> \u6a21\u5757\uff1a<\/p>\n<pre><code class=\"language-javascript\">\nconst { monitorEventLoopDelay } = require(&#x27;perf_hooks&#x27;);\nconst h = monitorEventLoopDelay({ resolution: 20 });\nh.enable();\n\nsetInterval(() =&gt; {\n  console.log(`Event loop delay: ${h.mean \/ 1e6} ms`);\n  h.reset();\n}, 5000);\n<\/code><\/pre>\n<p>\u5c06\u8fd9\u6bb5\u4ee3\u7801\u52a0\u5165\u670d\u52a1\uff0c\u89c2\u5bdf\u4f18\u5316\u524d\u540e\u7684\u5e73\u5747\u5ef6\u8fdf\u3002\u4f18\u5316\u524d\u53ef\u80fd\u9ad8\u8fbe 200ms\uff0c\u4f18\u5316\u540e\u5e94\u7a33\u5b9a\u5728 10ms \u4ee5\u5185\u3002<\/p>\n<p>> \ud83d\udca1 \u6700\u4f73\u5b9e\u8df5\uff1a\u5728\u751f\u4ea7\u73af\u5883\u4f7f\u7528 <code>clinic doctor<\/code> \u6216 <code>prom-client<\/code> \u66b4\u9732\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf\u6307\u6807\uff0c\u5e76\u8bbe\u7f6e\u544a\u8b66\u9608\u503c\uff08\u5982 >100ms\uff09\u3002<\/p>\n<h2>\u7b2c\u4e94\u6b65\uff1a\u5176\u4ed6\u5e38\u89c1\u6027\u80fd\u9677\u9631\u4e0e\u4f18\u5316\u6280\u5de7<\/h2>\n<h3>1. \u907f\u514d\u540c\u6b65 API<\/h3>\n<p>\u5982 <code>fs.readFileSync<\/code>\u3001<code>crypto.pbkdf2Sync<\/code> \u7b49\u540c\u6b65\u65b9\u6cd5\u4f1a\u963b\u585e\u4e8b\u4ef6\u5faa\u73af\u3002\u4e00\u5f8b\u4f7f\u7528\u5f02\u6b65\u7248\u672c\u3002<\/p>\n<h3>2. \u4f18\u5316 JSON \u5e8f\u5217\u5316<\/h3>\n<p>\u5927\u5bf9\u8c61 JSON \u5e8f\u5217\u5316\u53ef\u80fd\u6210\u4e3a\u74f6\u9888\u3002\u53ef\u4ee5\u4f7f\u7528 <code>fast-json-stringify<\/code> \u66ff\u4ee3 <code>JSON.stringify<\/code>\uff1a<\/p>\n<pre><code class=\"language-javascript\">\nconst fastJson = require(&#x27;fast-json-stringify&#x27;);\nconst stringify = fastJson({\n  type: &#x27;object&#x27;,\n  properties: {\n    id: { type: &#x27;number&#x27; },\n    name: { type: &#x27;string&#x27; }\n  }\n});\n<\/code><\/pre>\n<h3>3. \u4f7f\u7528\u6d41\u5904\u7406\u5927\u6587\u4ef6<\/h3>\n<p>\u907f\u514d\u4e00\u6b21\u6027\u8bfb\u53d6\u5927\u6587\u4ef6\u5230\u5185\u5b58\uff0c\u4f7f\u7528 <code>stream.pipeline<\/code> \u8fdb\u884c\u6d41\u5f0f\u5904\u7406\u3002<\/p>\n<h3>4. \u5408\u7406\u8bbe\u7f6e UV<em>THREADPOOL<\/em>SIZE<\/h3>\n<p>Node.js \u7684 libuv \u7ebf\u7a0b\u6c60\u9ed8\u8ba4\u5927\u5c0f\u4e3a 4\uff0c\u5bf9\u4e8e\u6587\u4ef6 I\/O \u5bc6\u96c6\u578b\u5e94\u7528\u53ef\u4ee5\u9002\u5f53\u8c03\u5927\uff08\u5982 8-16\uff09\uff0c\u4f46\u4e0d\u8981\u8d85\u8fc7 CPU \u6838\u5fc3\u6570\u3002<\/p>\n<pre><code class=\"language-bash\">\nUV_THREADPOOL_SIZE=8 node server.js\n<\/code><\/pre>\n<h2>\u603b\u7ed3\u4e0e\u5ef6\u4f38<\/h2>\n<p>\u901a\u8fc7\u672c\u6587\u7684\u5b9e\u6218\uff0c\u6211\u4eec\u5b8c\u6210\u4e86\u4ece\u6027\u80fd\u95ee\u9898\u53d1\u73b0\u3001\u5de5\u5177\u8bca\u65ad\u5230\u4ee3\u7801\u4f18\u5316\u7684\u5b8c\u6574\u95ed\u73af\u3002\u5173\u952e\u8981\u70b9\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <strong>Clinic.js<\/strong> \u5feb\u901f\u5b9a\u4f4d CPU \u70ed\u70b9\u548c\u4e8b\u4ef6\u5faa\u73af\u963b\u585e\u3002<\/li>\n<li>\u5c06 CPU \u5bc6\u96c6\u578b\u4efb\u52a1\u79fb\u5165 <strong>Worker Threads<\/strong> \u6216\u4f7f\u7528\u7ebf\u7a0b\u6c60\uff08\u5982 Piscina\uff09\u3002<\/li>\n<li>\u6301\u7eed\u76d1\u63a7 <strong>\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf<\/strong>\uff0c\u5efa\u7acb\u6027\u80fd\u57fa\u7ebf\u3002<\/li>\n<li>\u907f\u514d\u540c\u6b65 API\uff0c\u4f18\u5316\u5e8f\u5217\u5316\u4e0e I\/O \u6a21\u5f0f\u3002<\/li>\n<\/ul>\n<p>\u4e0b\u4e00\u6b65\uff0c\u4f60\u53ef\u4ee5\u63a2\u7d22\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528 <code>--prof<\/code> \u751f\u6210 V8 \u65e5\u5fd7\u5e76\u7528 <code>node --prof-process<\/code> \u5206\u6790\u3002<\/li>\n<li>\u7ed3\u5408 OpenTelemetry \u5b9e\u73b0\u5206\u5e03\u5f0f\u8ffd\u8e2a\u3002<\/li>\n<li>\u5bf9\u5185\u5b58\u6cc4\u6f0f\u4f7f\u7528 <code>heapdump<\/code> \u548c Chrome DevTools \u5206\u6790\u3002<\/li>\n<\/ul>\n<p>\u6027\u80fd\u8c03\u4f18\u662f\u4e00\u4e2a\u6301\u7eed\u7684\u8fc7\u7a0b\uff0c\u5e0c\u671b\u672c\u6587\u80fd\u6210\u4e3a\u4f60\u5de5\u5177\u7bb1\u4e2d\u7684\u4e00\u628a\u5229\u5668\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u901a\u8fc7\u4e00\u4e2a\u771f\u5b9e\u7684\u9ad8\u5e76\u53d1 API \u670d\u52a1\u6848\u4f8b\uff0c\u624b\u628a\u624b\u6559\u4f60\u4f7f\u7528 Clinic.js \u751f\u6210\u706b\u7130\u56fe\u3001\u5206\u6790\u4e8b\u4ef6\u5faa\u73af\u5ef6\u8fdf\u3001\u4f18\u5316 CPU \u5bc6\u96c6\u578b\u4efb\u52a1\uff0c\u5e76\u7ed9\u51fa\u53ef\u843d\u5730\u7684\u6027\u80fd\u63d0\u5347\u65b9\u6848\u3002\u8bfb\u5b8c\u4f60\u5c06\u638c\u63e1 Node.js \u6027\u80fd\u8c03\u4f18\u7684\u6838\u5fc3\u65b9\u6cd5\u8bba\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4],"tags":[7,5,87,146,112],"class_list":["post-287","post","type-post","status-publish","format-standard","hentry","category-3","category-4","tag-clinic-js","tag-node-js","tag-worker-threads","tag-146","tag-112"],"_links":{"self":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=287"}],"version-history":[{"count":0,"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/287\/revisions"}],"wp:attachment":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=287"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=287"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}