{"id":203,"date":"2025-07-23T14:59:23","date_gmt":"2025-07-23T06:59:23","guid":{"rendered":"https:\/\/shop.etsow.com\/news\/?p=203"},"modified":"2025-07-24T13:34:02","modified_gmt":"2025-07-24T05:34:02","slug":"%e9%ad%94%e4%ba%91%e8%85%beapi%e7%9a%84%e4%bd%bf%e7%94%a8%e6%8c%87%e5%8d%97%ef%bc%9a%e5%a6%82%e4%bd%95%e4%bc%98%e5%8c%96%e6%80%a7%e8%83%bd%e6%8f%90%e5%8d%87%e6%95%88%e7%8e%87%e4%b8%8e%e9%99%8d","status":"publish","type":"post","link":"https:\/\/shop.etsow.com\/news\/?p=203","title":{"rendered":"\u9b54\u4e91\u817eAPI\u7684\u4f7f\u7528\u6307\u5357\uff1a\u5982\u4f55\u4f18\u5316\u6027\u80fd\u63d0\u5347\u6548\u7387\u4e0e\u964d\u4f4e\u6210\u672c\uff1f"},"content":{"rendered":"<p>\u200b<strong>\u200b\u9b54\u4e91\u817eAPI\u7684\u4f7f\u7528\u6307\u5357\uff1a\u5982\u4f55\u4f18\u5316\u6027\u80fd\u63d0\u5347\u6548\u7387\u4e0e\u964d\u4f4e\u6210\u672c\uff1f\u200b<\/strong>\u200b<\/p>\n<p>\u5728\u4e91\u8ba1\u7b97\u548c\u865a\u62df\u5316\u6280\u672f\u5feb\u901f\u53d1\u5c55\u7684\u4eca\u5929\uff0c\u9b54\u4e91\u817eAPI\u51ed\u501f\u5176\u591a\u5f00\u5b89\u5353\u5bb9\u5668\u7684\u80fd\u529b\uff0c\u6210\u4e3a\u6e38\u620f\u6302\u673a\u3001\u81ea\u52a8\u5316\u6d4b\u8bd5\u7b49\u573a\u666f\u7684\u70ed\u95e8\u5de5\u5177\u3002\u7136\u800c\uff0c\u968f\u7740\u4e1a\u52a1\u89c4\u6a21\u6269\u5927\uff0c\u7528\u6237\u5e38\u9762\u4e34\u200b<strong>\u200b\u6027\u80fd\u74f6\u9888\u200b<\/strong>\u200b\u548c\u200b<strong>\u200b\u6210\u672c\u6fc0\u589e\u200b<\/strong>\u200b\u7684\u95ee\u9898\u3002\u5982\u4f55\u901a\u8fc7\u6280\u672f\u624b\u6bb5\u4f18\u5316API\u8c03\u7528\uff0c\u5b9e\u73b0\u6548\u7387\u4e0e\u6210\u672c\u7684\u5e73\u8861\uff1f\u672c\u6587\u5c06\u7ed3\u5408\u5b9e\u6218\u7ecf\u9a8c\uff0c\u63d0\u4f9b\u4e00\u5957\u7cfb\u7edf\u5316\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<hr \/>\n<p>\u200b<strong>\u200b\u4e00\u3001\u51cf\u5c11API\u8bf7\u6c42\uff1a\u4ece\u6e90\u5934\u964d\u4f4e\u8d1f\u8f7d\u200b<\/strong>\u200b<\/p>\n<p>\u9ad8\u9891\u7684API\u8c03\u7528\u4e0d\u4ec5\u589e\u52a0\u670d\u52a1\u5668\u538b\u529b\uff0c\u8fd8\u4f1a\u63a8\u9ad8\u4e91\u670d\u52a1\u8ba1\u8d39\u6210\u672c\u3002\u4ee5\u4e0b\u662f\u4e24\u79cd\u6838\u5fc3\u4f18\u5316\u7b56\u7565\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u6279\u91cf\u8bf7\u6c42\u5408\u5e76\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u9b54\u4e91\u817eAPI\u652f\u6301\u901a\u8fc7\u5355\u6b21\u8c03\u7528\u83b7\u53d6\u591a\u4e2a\u5bb9\u5668\u7684\u72b6\u6001\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\u539f\u672c\u9700\u898112\u6b21\u8bf7\u6c42\u7684\u5bb9\u5668\u76d1\u63a7\uff0c\u53ef\u901a\u8fc7<code class=\"hyc-common-markdown__code__inline\">GET \/api\/containers?ids=1,2,3\u202612<\/code>\u4e00\u6b21\u6027\u5b8c\u6210\uff0c\u51cf\u5c11\u7f51\u7edc\u5f80\u8fd4\u65f6\u95f4\u3002<\/p>\n<p>\u200b<strong>\u200b\u64cd\u4f5c\u5efa\u8bae\u200b<\/strong>\u200b\uff1a\u5728\u4e1a\u52a1\u903b\u8f91\u4e2d\uff0c\u5c06\u5206\u6563\u7684\u67e5\u8be2\u4efb\u52a1\u805a\u5408\u4e3a\u6279\u91cf\u64cd\u4f5c\uff0c\u5e76\u5229\u7528\u5f02\u6b65\u56de\u8c03\u5904\u7406\u7ed3\u679c\u3002<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u667a\u80fd\u7f13\u5b58\u673a\u5236\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u5bf9\u4e8e\u200b<strong>\u200b\u4f4e\u9891\u53d8\u66f4\u7684\u6570\u636e\u200b<\/strong>\u200b\uff08\u5982\u5bb9\u5668\u914d\u7f6e\u3001\u955c\u50cf\u7248\u672c\uff09\uff0c\u53ef\u91c7\u7528Redis\u7f13\u5b58\uff0c\u8bbe\u5b9a\u5408\u7406\u7684TTL\uff08\u59825\u5206\u949f\uff09\u3002\u4f8b\u5982\uff0c\u5bb9\u5668\u5217\u8868\u4fe1\u606f\u53ef\u7f13\u5b58\u540e\u590d\u7528\uff0c\u907f\u514d\u91cd\u590d\u67e5\u8be2\u6570\u636e\u5e93\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u200b<strong>\u200b\u4e8c\u3001\u4f18\u5316\u6570\u636e\u5904\u7406\uff1a\u538b\u7f29\u4e0e\u5f02\u6b65\u5316\u200b<\/strong>\u200b<\/p>\n<p>\u6570\u636e\u4f20\u8f93\u548c\u5904\u7406\u6548\u7387\u76f4\u63a5\u5f71\u54cdAPI\u54cd\u5e94\u901f\u5ea6\uff0c\u4ee5\u4e0b\u662f\u5173\u952e\u4f18\u5316\u70b9\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u8d1f\u8f7d\u538b\u7f29\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u542f\u7528GZIP\u538b\u7f29API\u54cd\u5e94\u6570\u636e\uff0c\u5c24\u5176\u9002\u7528\u4e8e\u8fd4\u56de\u5927\u91cf\u65e5\u5fd7\u6216\u76d1\u63a7\u4fe1\u606f\u7684\u573a\u666f\u3002\u6d4b\u8bd5\u8868\u660e\uff0c\u538b\u7f29\u540e\u7684\u6570\u636e\u4f53\u79ef\u53ef\u51cf\u5c1160%-70%\uff0c\u663e\u8457\u964d\u4f4e\u5e26\u5bbd\u6d88\u8017\u3002<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u5f02\u6b65\u65e5\u5fd7\u4e0e\u4efb\u52a1\u961f\u5217\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u5c06\u65e5\u5fd7\u8bb0\u5f55\u3001\u72b6\u6001\u4e0a\u62a5\u7b49\u975e\u5b9e\u65f6\u4efb\u52a1\u653e\u5165\u6d88\u606f\u961f\u5217\uff08\u5982RabbitMQ\uff09\uff0c\u907f\u514d\u963b\u585e\u4e3b\u7ebf\u7a0b\u3002\u4f8b\u5982\uff0c\u9b54\u4e91\u817e\u5bb9\u5668\u7684\u64cd\u4f5c\u65e5\u5fd7\u53ef\u901a\u8fc7\u5f02\u6b65\u5199\u5165Elasticsearch\uff0c\u63d0\u5347API\u541e\u5410\u91cf\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u200b<strong>\u200b\u4e09\u3001\u8d44\u6e90\u7ba1\u7406\uff1a\u8fde\u63a5\u6c60\u4e0e\u5f39\u6027\u4f38\u7f29\u200b<\/strong>\u200b<\/p>\n<p>\u8d44\u6e90\u590d\u7528\u548c\u52a8\u6001\u8c03\u6574\u662f\u964d\u4f4e\u6210\u672c\u7684\u6838\u5fc3\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u8fde\u63a5\u6c60\u914d\u7f6e\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u6570\u636e\u5e93\u548c\u5916\u90e8API\u7684\u8fde\u63a5\u5e94\u4f7f\u7528\u8fde\u63a5\u6c60\uff08\u5982HikariCP\uff09\uff0c\u5efa\u8bae\u521d\u59cb\u8fde\u63a5\u6570\u8bbe\u4e3a\u5bb9\u5668\u6570\u91cf\u76841.5\u500d\uff0c\u907f\u514d\u9891\u7e41\u521b\u5efa\u9500\u6bc1\u7684\u5f00\u9500\u3002<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u57fa\u4e8e\u8d1f\u8f7d\u7684\u5f39\u6027\u8ba1\u8d39\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u9b54\u4e91\u817e\u7684\u4e91\u4e3b\u673a\u5b9e\u4f8b\u652f\u6301\u6309\u9700\u4ed8\u8d39\u3002\u4f8b\u5982\uff0c\u5728\u4e1a\u52a1\u4f4e\u8c37\u671f\uff08\u5982\u591c\u95f4\uff09\uff0c\u53ef\u901a\u8fc7API\u52a8\u6001\u5173\u95ed\u90e8\u5206\u5bb9\u5668\uff0c\u8282\u770130%\u4ee5\u4e0a\u7684\u6210\u672c\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u200b<strong>\u200b\u56db\u3001\u76d1\u63a7\u4e0e\u8c03\u4f18\uff1a\u6570\u636e\u9a71\u52a8\u7684\u4f18\u5316\u200b<\/strong>\u200b<\/p>\n<p>\u6301\u7eed\u76d1\u63a7\u662f\u6027\u80fd\u4f18\u5316\u7684\u57fa\u7840\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u5173\u952e\u6307\u6807\u76d1\u63a7\u200b<\/strong>\u200b\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\n<p>\u6307\u6807<\/p>\n<\/th>\n<th>\n<p>\u9608\u503c\u5efa\u8bae<\/p>\n<\/th>\n<th>\n<p>\u5de5\u5177\u63a8\u8350<\/p>\n<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n<p>API\u54cd\u5e94\u65f6\u95f4<\/p>\n<\/td>\n<td>\n<p>&lt;500ms<\/p>\n<\/td>\n<td>\n<p>Prometheus<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5bb9\u5668CPU\u4f7f\u7528\u7387<\/p>\n<\/td>\n<td>\n<p>&lt;70%<\/p>\n<\/td>\n<td>\n<p>Grafana\u9762\u677f<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u9519\u8bef\u7387<\/p>\n<\/td>\n<td>\n<p>&lt;0.1%<\/p>\n<\/td>\n<td>\n<p>\u9b54\u4e91\u817e\u63a7\u5236\u53f0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u6162\u67e5\u8be2\u5206\u6790\u200b<\/strong>\u200b\uff1a<\/p>\n<p>\u901a\u8fc7APM\u5de5\u5177\uff08\u5982SkyWalking\uff09\u8ffd\u8e2a\u8017\u65f6\u64cd\u4f5c\uff0c\u4f18\u5316\u9ad8\u9891\u7684\u6df1\u5206\u9875\u67e5\u8be2\u6216\u672a\u7d22\u5f15\u7684JOIN\u8bed\u53e5\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u200b<strong>\u200b\u4e94\u3001\u5b89\u5168\u4e0e\u6027\u80fd\u7684\u5e73\u8861\u200b<\/strong>\u200b<\/p>\n<p>\u8fc7\u5ea6\u5b89\u5168\u6821\u9a8c\u53ef\u80fd\u62d6\u7d2f\u6027\u80fd\uff0c\u9700\u6743\u8861\u4ee5\u4e0b\u4e24\u70b9\uff1a<\/p>\n<ul>\n<li>\n<p>\u200b<strong>\u200b\u7cbe\u7b80\u8ba4\u8bc1\u6d41\u7a0b\u200b<\/strong>\u200b\uff1a\u4f7f\u7528JWT\u66ff\u4ee3\u9891\u7e41\u7684OAuth\u4ee4\u724c\u6821\u9a8c\uff0c\u51cf\u5c11\u8eab\u4efd\u9a8c\u8bc1\u7684\u5ef6\u8fdf\u3002<\/p>\n<\/li>\n<li>\n<p>\u200b<strong>\u200b\u9650\u6d41\u4fdd\u62a4\u200b<\/strong>\u200b\uff1a\u901a\u8fc7\u4ee4\u724c\u6876\u7b97\u6cd5\u9650\u5236\u5355\u4e2aIP\u7684\u8bf7\u6c42\u9891\u7387\uff08\u5982100\u6b21\/\u79d2\uff09\uff0c\u9632\u6b62\u6076\u610f\u8bf7\u6c42\u5bfc\u81f4\u8d44\u6e90\u8017\u5c3d\u3002<\/p>\n<\/li>\n<\/ul>\n<hr \/>\n<p>\u200b<strong>\u200b\u4e2a\u4eba\u89c1\u89e3\u200b<\/strong>\u200b\uff1a\u9b54\u4e91\u817eAPI\u7684\u6f5c\u529b\u4e0d\u4ec5\u9650\u4e8e\u591a\u5f00\u5bb9\u5668\u3002\u7ed3\u5408\u200b<strong>\u200bDocker SDK\u4e8c\u6b21\u5f00\u53d1\u200b<\/strong>\u200b\uff0c\u7528\u6237\u53ef\u6784\u5efa\u81ea\u5b9a\u4e49\u7684\u81ea\u52a8\u5316\u8fd0\u7ef4\u5e73\u53f0\uff0c\u4f8b\u5982\u6279\u91cf\u90e8\u7f72\u70ed\u66f4\u65b0\u6216\u8de8\u5bb9\u5668\u6570\u636e\u540c\u6b65\u3002\u6b64\u5916\uff0c\u5b98\u65b9\u6587\u6863\u4e2d\u672a\u5145\u5206\u63d0\u53ca\u7684\u200b<strong>\u200b\u51b7\u70ed\u6570\u636e\u5206\u79bb\u200b<\/strong>\u200b\u7b56\u7565\uff08\u5982\u5c06\u5386\u53f2\u65e5\u5fd7\u5f52\u6863\u81f3\u5bf9\u8c61\u5b58\u50a8\uff09\uff0c\u4e5f\u80fd\u8fdb\u4e00\u6b65\u964d\u4f4e\u6210\u672c\u3002<\/p>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u65b9\u6cd5\uff0c\u7528\u6237\u53ef\u5728\u4fdd\u8bc1\u4e1a\u52a1\u9700\u6c42\u7684\u524d\u63d0\u4e0b\uff0c\u5c06API\u6548\u7387\u63d0\u534750%\u4ee5\u4e0a\uff0c\u540c\u65f6\u964d\u4f4e20%-30%\u7684\u8fd0\u8425\u6210\u672c\u3002\u6280\u672f\u7684\u4ef7\u503c\u5728\u4e8e\u9002\u914d\u573a\u666f\uff0c\u800c\u975e\u76f2\u76ee\u8ffd\u6c42\u6781\u81f4\u6027\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u200b\u200b\u9b54\u4e91\u817eAPI\u7684\u4f7f\u7528\u6307\u5357\uff1a\u5982\u4f55\u4f18\u5316\u6027\u80fd\u63d0\u5347\u6548\u7387\u4e0e\u964d\u4f4e\u6210\u672c\uff1f&#8230;<\/p>\n","protected":false},"author":1,"featured_media":558,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-203","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts\/203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=203"}],"version-history":[{"count":0,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/posts\/203\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=\/wp\/v2\/media\/558"}],"wp:attachment":[{"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=203"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=203"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shop.etsow.com\/news\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}