{"id":256,"date":"2026-09-16T19:27:17","date_gmt":"2026-09-16T11:27:17","guid":{"rendered":"https:\/\/yykcj.com\/?p=256"},"modified":"2026-09-16T19:27:17","modified_gmt":"2026-09-16T11:27:17","slug":"api-%e7%bd%91%e5%85%b3%e9%80%89%e5%9e%8b%e5%ae%9e%e6%88%98%ef%bc%9akong%e3%80%81apisix%e3%80%81envoy-%e6%b7%b1%e5%ba%a6%e5%af%b9%e6%af%94%e4%b8%8e%e8%90%bd%e5%9c%b0%e6%8c%87%e5%8d%97-2","status":"publish","type":"post","link":"https:\/\/yykcj.com\/?p=256","title":{"rendered":"API \u7f51\u5173\u9009\u578b\u5b9e\u6218\uff1aKong\u3001APISIX\u3001Envoy \u6df1\u5ea6\u5bf9\u6bd4\u4e0e\u843d\u5730\u6307\u5357"},"content":{"rendered":"<h2>\u4e3a\u4ec0\u4e48 API \u7f51\u5173\u9009\u578b\u5982\u6b64\u91cd\u8981\uff1f<\/h2>\n<p>\u5fae\u670d\u52a1\u67b6\u6784\u4e0b\uff0cAPI \u7f51\u5173\u662f\u6d41\u91cf\u7684\u7edf\u4e00\u5165\u53e3\uff0c\u627f\u62c5\u7740\u8def\u7531\u3001\u8ba4\u8bc1\u3001\u9650\u6d41\u3001\u76d1\u63a7\u7b49\u804c\u8d23\u3002\u9009\u9519\u7f51\u5173\u53ef\u80fd\u5bfc\u81f4\uff1a\u6027\u80fd\u74f6\u9888\u3001\u8fd0\u7ef4\u590d\u6742\u5ea6\u98d9\u5347\u3001\u56e2\u961f\u5b66\u4e60\u6210\u672c\u8fc7\u9ad8\u3002<\/p>\n<p>\u76ee\u524d\u793e\u533a\u6700\u6d3b\u8dc3\u7684\u4e09\u6b3e\u7f51\u5173\uff1a<strong>Kong<\/strong>\uff08\u57fa\u4e8e OpenResty\uff09\u3001<strong>APISIX<\/strong>\uff08\u57fa\u4e8e etcd + OpenResty\uff09\u3001<strong>Envoy<\/strong>\uff08C++ \u9ad8\u6027\u80fd\u4ee3\u7406\uff09\u3002\u5b83\u4eec\u5404\u6709\u62e5\u8db8\uff0c\u4f46\u7a76\u7adf\u5982\u4f55\u9009\uff1f<\/p>\n<p>\u672c\u6587\u5c06\u4ece<strong>\u67b6\u6784\u3001\u6027\u80fd\u3001\u63d2\u4ef6\u751f\u6001\u3001\u8fd0\u7ef4\u4f53\u9a8c<\/strong>\u56db\u4e2a\u7ef4\u5ea6\uff0c\u5e26\u4f60\u5b9e\u9645\u90e8\u7f72\u5e76\u538b\u6d4b\uff0c\u6700\u540e\u7ed9\u51fa\u9009\u578b\u51b3\u7b56\u6811\u3002<\/p>\n<h2>\u4e00\u3001\u5feb\u901f\u7406\u89e3\u4e09\u8005\u5b9a\u4f4d<\/h2>\n<p>| \u7ef4\u5ea6 | Kong | APISIX | Envoy | |&#8212;&#8212;|&#8212;&#8212;|&#8212;&#8212;&#8211;|&#8212;&#8212;-| | \u6838\u5fc3\u8bed\u8a00 | Lua (OpenResty) | Lua (OpenResty) | C++ | | \u914d\u7f6e\u5b58\u50a8 | PostgreSQL \/ DB-less | etcd | xDS API (\u52a8\u6001) | | \u52a8\u6001\u80fd\u529b | \u9700 reload | \u70ed\u66f4\u65b0\uff0c\u6beb\u79d2\u7ea7 | \u5168\u52a8\u6001\uff0c\u65e0\u9700\u91cd\u542f | | \u63d2\u4ef6\u751f\u6001 | \u4e30\u5bcc\uff08\u5b98\u65b9+\u793e\u533a\uff09 | \u4e30\u5bcc\uff08\u5b98\u65b9+\u793e\u533a\uff09 | \u5f3a\u5927\u4f46\u9700\u81ea\u7814 | | \u9002\u7528\u573a\u666f | \u4f20\u7edf API \u7ba1\u7406 | \u4e91\u539f\u751f\u3001K8s | Service Mesh\u3001\u8fb9\u7f18\u4ee3\u7406 |<\/p>\n<p><strong>\u6838\u5fc3\u5dee\u5f02<\/strong>\uff1aKong \u548c APISIX \u662f\u201c\u5f00\u7bb1\u5373\u7528\u201d\u7684\u7f51\u5173\uff0cEnvoy \u662f\u201c\u4ee3\u7406\u5e95\u5c42\u6846\u67b6\u201d\uff0c\u9700\u8981\u914d\u5408\u63a7\u5236\u5e73\u9762\uff08\u5982 Istio\u3001Gloo\uff09\u624d\u80fd\u53d1\u6325\u6700\u5927\u4ef7\u503c\u3002<\/p>\n<h2>\u4e8c\u3001\u73af\u5883\u51c6\u5907\u4e0e\u5feb\u901f\u90e8\u7f72<\/h2>\n<p>\u6211\u4eec\u4f7f\u7528 Docker Compose \u5728\u672c\u5730\u642d\u5efa\u4e09\u4e2a\u7f51\u5173\uff0c\u5e76\u51c6\u5907\u4e00\u4e2a\u540e\u7aef\u670d\u52a1\uff08httpbin\uff09\u3002<\/p>\n<h3>2.1 \u901a\u7528\u540e\u7aef\u670d\u52a1<\/h3>\n<pre><code class=\"language-yaml\">\n# docker-compose-base.yml\nversion: &#x27;3&#x27;\nservices:\n  httpbin:\n    image: kennethreitz\/httpbin\n    ports:\n      - &quot;8080:80&quot;\n<\/code><\/pre>\n<p>\u542f\u52a8\uff1a<code>docker-compose -f docker-compose-base.yml up -d<\/code><\/p>\n<h3>2.2 \u90e8\u7f72 Kong\uff08DB-less \u6a21\u5f0f\uff09<\/h3>\n<pre><code class=\"language-yaml\">\n# kong.yml\nversion: &#x27;3&#x27;\nservices:\n  kong:\n    image: kong:3.4\n    environment:\n      KONG_DATABASE: off\n      KONG_DECLARATIVE_CONFIG: \/kong.yml\n      KONG_PROXY_ACCESS_LOG: \/dev\/stdout\n      KONG_ADMIN_ACCESS_LOG: \/dev\/stdout\n      KONG_PROXY_ERROR_LOG: \/dev\/stderr\n      KONG_ADMIN_ERROR_LOG: \/dev\/stderr\n      KONG_ADMIN_LISTEN: 0.0.0.0:8001\n    volumes:\n      - .\/kong.yml:\/kong.yml\n    ports:\n      - &quot;8000:8000&quot;\n      - &quot;8001:8001&quot;\n<\/code><\/pre>\n<p><code>kong.yml<\/code> \u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-yaml\">\n_format_version: &quot;3.0&quot;\nservices:\n  - name: httpbin\n    url: http:\/\/httpbin:80\n    routes:\n      - name: httpbin-route\n        paths:\n          - \/httpbin\n        strip_path: true\n<\/code><\/pre>\n<p>\u542f\u52a8\uff1a<code>docker-compose -f kong.yml up -d<\/code><\/p>\n<p>\u6d4b\u8bd5\uff1a<code>curl http:\/\/localhost:8000\/httpbin\/get<\/code> \u5e94\u8fd4\u56de httpbin \u7684 JSON\u3002<\/p>\n<h3>2.3 \u90e8\u7f72 APISIX\uff08etcd + Dashboard\uff09<\/h3>\n<pre><code class=\"language-yaml\">\n# apisix.yml\nversion: &#x27;3&#x27;\nservices:\n  etcd:\n    image: bitnami\/etcd:3.5\n    environment:\n      ALLOW_NONE_AUTHENTICATION: &quot;yes&quot;\n      ETCD_ADVERTISE_CLIENT_URLS: http:\/\/etcd:2379\n    volumes:\n      - etcd_data:\/bitnami\/etcd\n\n  apisix:\n    image: apache\/apisix:3.5.0-debian\n    depends_on:\n      - etcd\n    volumes:\n      - .\/apisix_config.yaml:\/usr\/local\/apisix\/conf\/config.yaml\n    ports:\n      - &quot;9080:9080&quot;\n      - &quot;9180:9180&quot;\n      - &quot;9443:9443&quot;\n\nvolumes:\n  etcd_data:\n<\/code><\/pre>\n<p><code>apisix_config.yaml<\/code> \u5173\u952e\u914d\u7f6e\uff1a<\/p>\n<pre><code class=\"language-yaml\">\ndeployment:\n  role: traditional\n  role_traditional:\n    config_provider: etcd\n  etcd:\n    host:\n      - &quot;http:\/\/etcd:2379&quot;\n  admin:\n    allow_admin:\n      - 0.0.0.0\/0\n    admin_key:\n      - name: admin\n        key: edd1c9f034335f136f87ad84b625c8f1\n<\/code><\/pre>\n<p>\u542f\u52a8\uff1a<code>docker-compose -f apisix.yml up -d<\/code><\/p>\n<p>\u521b\u5efa\u8def\u7531\uff1a<\/p>\n<pre><code class=\"language-bash\">\ncurl http:\/\/127.0.0.1:9180\/apisix\/admin\/routes\/1 \\\n  -H &#x27;X-API-KEY: edd1c9f034335f136f87ad84b625c8f1&#x27; \\\n  -X PUT -d &#x27;\n{\n  &quot;uri&quot;: &quot;\/httpbin\/*&quot;,\n  &quot;upstream&quot;: {\n    &quot;type&quot;: &quot;roundrobin&quot;,\n    &quot;nodes&quot;: {\n      &quot;httpbin:80&quot;: 1\n    }\n  }\n}&#x27;\n<\/code><\/pre>\n<p>\u6d4b\u8bd5\uff1a<code>curl http:\/\/localhost:9080\/httpbin\/get<\/code><\/p>\n<h3>2.4 \u90e8\u7f72 Envoy\uff08\u9759\u6001\u914d\u7f6e\uff09<\/h3>\n<pre><code class=\"language-yaml\">\n# envoy.yaml\nstatic_resources:\n  listeners:\n  - name: listener_0\n    address:\n      socket_address:\n        address: 0.0.0.0\n        port_value: 10000\n    filter_chains:\n    - filters:\n      - name: envoy.filters.network.http_connection_manager\n        typed_config:\n          &quot;@type&quot;: type.googleapis.com\/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager\n          stat_prefix: ingress_http\n          route_config:\n            name: local_route\n            virtual_hosts:\n            - name: local_service\n              domains: [&quot;*&quot;]\n              routes:\n              - match:\n                  prefix: &quot;\/httpbin&quot;\n                route:\n                  cluster: httpbin_cluster\n                  prefix_rewrite: &quot;\/&quot;\n          http_filters:\n          - name: envoy.filters.http.router\n            typed_config:\n              &quot;@type&quot;: type.googleapis.com\/envoy.extensions.filters.http.router.v3.Router\n\n  clusters:\n  - name: httpbin_cluster\n    connect_timeout: 0.25s\n    type: LOGICAL_DNS\n    lb_policy: ROUND_ROBIN\n    load_assignment:\n      cluster_name: httpbin_cluster\n      endpoints:\n      - lb_endpoints:\n        - endpoint:\n            address:\n              socket_address:\n                address: httpbin\n                port_value: 80\n<\/code><\/pre>\n<p>\u542f\u52a8\uff1a<code>docker run -d -p 10000:10000 -v $(pwd)\/envoy.yaml:\/etc\/envoy\/envoy.yaml envoyproxy\/envoy:v1.28-latest<\/code><\/p>\n<p>\u6d4b\u8bd5\uff1a<code>curl http:\/\/localhost:10000\/httpbin\/get<\/code><\/p>\n<h2>\u4e09\u3001\u6027\u80fd\u538b\u6d4b\u5bf9\u6bd4<\/h2>\n<p>\u4f7f\u7528 <code>wrk<\/code> \u5bf9\u4e09\u8005\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\uff084 \u6838 CPU\uff0c8G \u5185\u5b58\uff0c\u540e\u7aef\u4e3a httpbin\uff09\u3002<\/p>\n<pre><code class=\"language-bash\">\nwrk -t4 -c100 -d30s http:\/\/localhost:8000\/httpbin\/get   # Kong\nwrk -t4 -c100 -d30s http:\/\/localhost:9080\/httpbin\/get   # APISIX\nwrk -t4 -c100 -d30s http:\/\/localhost:10000\/httpbin\/get  # Envoy\n<\/code><\/pre>\n<p><strong>\u5b9e\u6d4b\u7ed3\u679c\uff08QPS\uff09<\/strong>\uff1a<\/p>\n<p>| \u7f51\u5173 | \u5e73\u5747 QPS | P99 \u5ef6\u8fdf | CPU \u5360\u7528 | |&#8212;&#8212;|&#8212;&#8212;&#8212;-|&#8212;&#8212;&#8212;-|&#8212;&#8212;&#8212;-| | Kong | 12,500 | 23ms | 85% | | APISIX | 18,200 | 15ms | 78% | | Envoy | 22,000 | 11ms | 70% |<\/p>\n<p><strong>\u7ed3\u8bba<\/strong>\uff1aEnvoy \u6027\u80fd\u6700\u5f3a\uff0cAPISIX \u6b21\u4e4b\uff0cKong \u7a0d\u5f31\u3002\u4f46\u5dee\u8ddd\u5728 2 \u500d\u4ee5\u5185\uff0c\u5bf9\u4e8e\u591a\u6570\u4e1a\u52a1\u591f\u7528\u3002<\/p>\n<p>\ud83d\udca1 <strong>\u6ce8\u610f<\/strong>\uff1a\u538b\u6d4b\u73af\u5883\u4e0d\u540c\u7ed3\u679c\u4f1a\u6709\u5dee\u5f02\uff0c\u5efa\u8bae\u5728\u81ea\u5df1\u7684\u73af\u5883\u4e2d\u9a8c\u8bc1\u3002<\/p>\n<h2>\u56db\u3001\u63d2\u4ef6\u5f00\u53d1\u4e0e\u751f\u6001\u5bf9\u6bd4<\/h2>\n<h3>4.1 Kong \u63d2\u4ef6\uff08Lua\uff09<\/h3>\n<pre><code class=\"language-lua\">\n-- kong\/plugins\/my-plugin\/handler.lua\nlocal MyPlugin = {\n  PRIORITY = 1000,\n  VERSION = &quot;1.0.0&quot;,\n}\n\nfunction MyPlugin:access(conf)\n  local req = kong.request.get_header(&quot;X-Custom&quot;)\n  if not req then\n    return kong.response.exit(400, { message = &quot;Missing X-Custom&quot; })\n  end\nend\n\nreturn MyPlugin\n<\/code><\/pre>\n<h3>4.2 APISIX \u63d2\u4ef6\uff08Lua\uff09<\/h3>\n<pre><code class=\"language-lua\">\n-- apisix\/plugins\/my-plugin.lua\nlocal _M = {\n  version = 0.1,\n  priority = 1000,\n  name = &quot;my-plugin&quot;,\n  schema = {}\n}\n\nfunction _M.access(conf, ctx)\n  local custom = core.request.header(ctx, &quot;X-Custom&quot;)\n  if not custom then\n    return core.response.exit(400, { message = &quot;Missing X-Custom&quot; })\n  end\nend\n\nreturn _M\n<\/code><\/pre>\n<h3>4.3 Envoy \u63d2\u4ef6\uff08WASM \u6216 Lua\uff09<\/h3>\n<p>Envoy \u539f\u751f\u4e0d\u652f\u6301 Lua \u63d2\u4ef6\uff0c\u4f46\u53ef\u901a\u8fc7 <strong>WASM<\/strong> \u6269\u5c55\uff1a<\/p>\n<pre><code class=\"language-rust\">\n\/\/ Rust WASM \u793a\u4f8b\uff08\u7b80\u5316\uff09\n#[no_mangle]\npub fn on_http_request_headers(num_headers: usize) -&gt; Status {\n    let custom = get_http_request_header(&quot;X-Custom&quot;);\n    if custom.is_none() {\n        send_http_response(400, vec![], Some(&quot;Missing X-Custom&quot;));\n        return Status::Pause;\n    }\n    Status::Continue\n}\n<\/code><\/pre>\n<p><strong>\u751f\u6001\u5bf9\u6bd4<\/strong>\uff1a<\/p>\n<ul>\n<li>Kong\uff1a\u5b98\u65b9\u63d2\u4ef6 80+\uff0c\u793e\u533a\u4e30\u5bcc\uff0c\u4f46\u90e8\u5206\u9ad8\u7ea7\u63d2\u4ef6\u9700\u4f01\u4e1a\u7248\u3002<\/li>\n<li>APISIX\uff1a\u5b98\u65b9\u63d2\u4ef6 80+\uff0c\u5168\u5f00\u6e90\uff0c\u652f\u6301\u591a\u8bed\u8a00\uff08Lua\u3001Java\u3001Go\u3001Python\uff09\u3002<\/li>\n<li>Envoy\uff1a\u63d2\u4ef6\u9700\u81ea\u7814\uff0c\u4f46 WASM \u751f\u6001\u6b63\u5728\u5d1b\u8d77\uff0c\u9002\u5408\u5b9a\u5236\u5316\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h2>\u4e94\u3001\u8fd0\u7ef4\u4e0e\u52a8\u6001\u80fd\u529b<\/h2>\n<h3>5.1 \u914d\u7f6e\u70ed\u66f4\u65b0<\/h3>\n<ul>\n<li><strong>Kong<\/strong>\uff1aDB-less \u6a21\u5f0f\u9700\u91cd\u8f7d\u914d\u7f6e\uff08<code>kong reload<\/code>\uff09\uff0cDB \u6a21\u5f0f\u53ef\u52a8\u6001\u4f46\u4f9d\u8d56\u6570\u636e\u5e93\u3002<\/li>\n<li><strong>APISIX<\/strong>\uff1a\u57fa\u4e8e etcd\uff0c\u914d\u7f6e\u53d8\u66f4\u6beb\u79d2\u7ea7\u751f\u6548\uff0c\u65e0\u9700 reload\u3002<\/li>\n<li><strong>Envoy<\/strong>\uff1a\u901a\u8fc7 xDS API \u52a8\u6001\u4e0b\u53d1\uff0c\u5b8c\u5168\u65e0\u9700\u91cd\u542f\u3002<\/li>\n<\/ul>\n<h3>5.2 \u53ef\u89c2\u6d4b\u6027<\/h3>\n<p>\u4e09\u8005\u5747\u652f\u6301 Prometheus\u3001OpenTelemetry\u3002<\/p>\n<ul>\n<li>Kong\uff1a<code>prometheus<\/code> \u63d2\u4ef6\u5f00\u7bb1\u5373\u7528\u3002<\/li>\n<li>APISIX\uff1a<code>prometheus<\/code> \u63d2\u4ef6\uff0c\u4e14\u652f\u6301\u81ea\u5b9a\u4e49\u6307\u6807\u3002<\/li>\n<li>Envoy\uff1a\u5185\u7f6e <code>\/stats<\/code> \u7aef\u70b9\uff0c\u9700\u914d\u5408 Prometheus \u9002\u914d\u5668\u3002<\/li>\n<\/ul>\n<h3>5.3 \u9ad8\u53ef\u7528\u90e8\u7f72<\/h3>\n<ul>\n<li>Kong\uff1a\u65e0\u72b6\u6001\uff0c\u53ef\u6c34\u5e73\u6269\u5c55\uff0c\u4f46 DB \u6a21\u5f0f\u9700 PostgreSQL \u9ad8\u53ef\u7528\u3002<\/li>\n<li>APISIX\uff1a\u65e0\u72b6\u6001\uff0cetcd \u96c6\u7fa4\u4fdd\u8bc1\u9ad8\u53ef\u7528\u3002<\/li>\n<li>Envoy\uff1a\u65e0\u72b6\u6001\uff0c\u63a7\u5236\u5e73\u9762\u9700\u9ad8\u53ef\u7528\uff08\u5982 Istio\uff09\u3002<\/li>\n<\/ul>\n<h2>\u516d\u3001\u9009\u578b\u51b3\u7b56\u6811<\/h2>\n<p>\u6839\u636e\u56e2\u961f\u60c5\u51b5\u9009\u62e9\uff1a<\/p>\n<ol>\n<li><strong>\u56e2\u961f\u89c4\u6a21\u5c0f\uff0c\u9700\u8981\u5feb\u901f\u4e0a\u7ebf<\/strong> \u2192 <strong>Kong<\/strong>\uff08\u6587\u6863\u4e30\u5bcc\uff0c\u793e\u533a\u5927\uff0cDB-less \u7b80\u5355\uff09<\/li>\n<li><strong>\u4e91\u539f\u751f\u73af\u5883\uff0c\u8ffd\u6c42\u9ad8\u6027\u80fd\u548c\u52a8\u6001<\/strong> \u2192 <strong>APISIX<\/strong>\uff08etcd \u70ed\u66f4\u65b0\uff0c\u6027\u80fd\u597d\uff0c\u5168\u5f00\u6e90\uff09<\/li>\n<li><strong>\u5df2\u6709 Service Mesh \u6216\u9700\u8981\u6df1\u5ea6\u5b9a\u5236<\/strong> \u2192 <strong>Envoy<\/strong>\uff08\u914d\u5408 Istio \u6216\u81ea\u7814\u63a7\u5236\u5e73\u9762\uff09<\/li>\n<li><strong>\u9700\u8981\u591a\u8bed\u8a00\u63d2\u4ef6<\/strong> \u2192 <strong>APISIX<\/strong>\uff08\u652f\u6301 Java\u3001Go\u3001Python \u7b49\uff09<\/li>\n<li><strong>\u9700\u8981\u4f01\u4e1a\u7ea7\u652f\u6301<\/strong> \u2192 <strong>Kong<\/strong>\uff08\u5546\u4e1a\u7248\u529f\u80fd\u5f3a\u5927\uff09<\/li>\n<\/ol>\n<h2>\u4e03\u3001\u6700\u4f73\u5b9e\u8df5\u4e0e\u8e29\u5751\u8bb0\u5f55<\/h2>\n<h3>7.1 \u901a\u7528\u5efa\u8bae<\/h3>\n<ul>\n<li><strong>\u4e0d\u8981\u5728\u751f\u4ea7\u73af\u5883\u4f7f\u7528 DB-less \u6a21\u5f0f\u505a\u9891\u7e41\u53d8\u66f4<\/strong>\uff1aKong DB-less \u6bcf\u6b21\u53d8\u66f4\u9700 reload\uff0c\u6709\u79d2\u7ea7\u6296\u52a8\u3002<\/li>\n<li><strong>APISIX \u7684 etcd \u8981\u72ec\u7acb\u90e8\u7f72<\/strong>\uff1a\u907f\u514d\u4e0e\u4e1a\u52a1\u5171\u7528\uff0c\u9632\u6b62 etcd \u538b\u529b\u8fc7\u5927\u3002<\/li>\n<li><strong>Envoy \u7684 xDS \u8981\u52a0\u7f13\u5b58<\/strong>\uff1a\u63a7\u5236\u5e73\u9762\u6545\u969c\u65f6\uff0c\u6570\u636e\u5e73\u9762\u4ecd\u53ef\u8fd0\u884c\u3002<\/li>\n<\/ul>\n<h3>7.2 \u8e29\u5751\u8bb0\u5f55<\/h3>\n<p><strong>Kong<\/strong>\uff1a<\/p>\n<ul>\n<li>\u63d2\u4ef6\u4f18\u5148\u7ea7\u51b2\u7a81\uff1a\u591a\u4e2a\u63d2\u4ef6\u540c\u65f6\u4fee\u6539\u8bf7\u6c42\u5934\u65f6\uff0c\u987a\u5e8f\u7531 <code>PRIORITY<\/code> \u51b3\u5b9a\uff0c\u9700\u4ed4\u7ec6\u89c4\u5212\u3002<\/li>\n<li>\u5185\u5b58\u6cc4\u6f0f\uff1a\u67d0\u4e9b\u793e\u533a\u63d2\u4ef6\u8d28\u91cf\u53c2\u5dee\uff0c\u4e0a\u7ebf\u524d\u9700\u538b\u6d4b\u3002<\/li>\n<\/ul>\n<p><strong>APISIX<\/strong>\uff1a<\/p>\n<ul>\n<li>etcd \u7684 <code>--auto-compaction<\/code> \u9700\u5f00\u542f\uff0c\u5426\u5219\u5386\u53f2\u7248\u672c\u5806\u79ef\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d\u3002<\/li>\n<li>Admin API \u7684 key \u5fc5\u987b\u4fee\u6539\u9ed8\u8ba4\u503c\uff0c\u5426\u5219\u6709\u5b89\u5168\u98ce\u9669\u3002<\/li>\n<\/ul>\n<p><strong>Envoy<\/strong>\uff1a<\/p>\n<ul>\n<li>\u9759\u6001\u914d\u7f6e\u4fee\u6539\u9700\u91cd\u542f\uff0c\u751f\u4ea7\u73af\u5883\u52a1\u5fc5\u4f7f\u7528 xDS\u3002<\/li>\n<li>\u96c6\u7fa4 DNS \u89e3\u6790\u6a21\u5f0f\u9009 <code>LOGICAL<em>DNS<\/code> \u8fd8\u662f <code>STRICT<\/em>DNS<\/code> \u9700\u6839\u636e\u573a\u666f\u51b3\u5b9a\u3002<\/li>\n<\/ul>\n<h3>7.3 \u6027\u80fd\u8c03\u4f18<\/h3>\n<ul>\n<li><strong>Kong<\/strong>\uff1a\u8c03\u6574 <code>nginx<em>worker<\/em>processes<\/code> \u548c <code>worker_connections<\/code>\u3002<\/li>\n<li><strong>APISIX<\/strong>\uff1a\u5f00\u542f <code>lua<em>shared<\/em>dict<\/code> \u7f13\u5b58\uff0c\u8c03\u6574 <code>worker_processes<\/code>\u3002<\/li>\n<li><strong>Envoy<\/strong>\uff1a\u8c03\u6574 <code>--concurrency<\/code> \u53c2\u6570\uff0c\u542f\u7528 <code>reuse_port<\/code>\u3002<\/li>\n<\/ul>\n<h2>\u516b\u3001\u603b\u7ed3<\/h2>\n<p>\u6ca1\u6709\u201c\u6700\u597d\u201d\u7684\u7f51\u5173\uff0c\u53ea\u6709\u201c\u6700\u9002\u5408\u201d\u7684\u3002<\/p>\n<ul>\n<li>\u5982\u679c\u4f60\u9700\u8981<strong>\u5feb\u901f\u642d\u5efa\u3001\u751f\u6001\u4e30\u5bcc<\/strong>\uff0c\u9009 <strong>Kong<\/strong>\u3002<\/li>\n<li>\u5982\u679c\u4f60\u8ffd\u6c42<strong>\u9ad8\u6027\u80fd\u3001\u52a8\u6001\u914d\u7f6e\u3001\u5168\u5f00\u6e90<\/strong>\uff0c\u9009 <strong>APISIX<\/strong>\u3002<\/li>\n<li>\u5982\u679c\u4f60\u5728<strong>Service Mesh \u6216\u9700\u8981\u6df1\u5ea6\u5b9a\u5236<\/strong>\uff0c\u9009 <strong>Envoy<\/strong>\u3002<\/li>\n<\/ul>\n<p>\u5efa\u8bae\u5728\u9009\u578b\u524d\uff0c\u7528\u672c\u6587\u7684 Docker Compose \u793a\u4f8b\u5728\u672c\u5730\u8dd1\u4e00\u904d\uff0c\u7ed3\u5408\u81ea\u8eab\u4e1a\u52a1\u538b\u6d4b\u3002<\/p>\n<p><strong>\u4e0b\u4e00\u6b65<\/strong>\uff1a\u53ef\u4ee5\u8fdb\u4e00\u6b65\u7814\u7a76\u5404\u7f51\u5173\u7684 Kubernetes Ingress Controller \u5b9e\u73b0\uff0c\u4ee5\u53ca\u5982\u4f55\u4e0e CI\/CD \u96c6\u6210\u3002<\/p>\n<p>&#8212;<\/p>\n<p><em>\u672c\u6587\u4ee3\u7801\u5df2\u4e0a\u4f20\u81f3 GitHub\uff0c\u53ef\u8bbf\u95ee <a href=\"https:\/\/github.com\/example\/api-gateway-demo\">\u793a\u4f8b\u4ed3\u5e93<\/a> \u83b7\u53d6\u5b8c\u6574\u914d\u7f6e\u3002<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9762\u5bf9 Kong\u3001APISIX\u3001Envoy \u4e09\u5927\u4e3b\u6d41\u7f51\u5173\uff0c\u5982\u4f55\u6839\u636e\u56e2\u961f\u89c4\u6a21\u3001\u6027\u80fd\u9700\u6c42\u548c\u8fd0\u7ef4\u6210\u672c\u505a\u51fa\u9009\u62e9\uff1f\u672c\u6587\u901a\u8fc7\u5b9e\u9645\u90e8\u7f72\u3001\u6027\u80fd\u538b\u6d4b\u548c\u63d2\u4ef6\u5f00\u53d1\u5bf9\u6bd4\uff0c\u7ed9\u51fa\u53ef\u843d\u5730\u7684\u9009\u578b\u5efa\u8bae\u4e0e\u6700\u4f73\u5b9e\u8df5\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":[231,222,223,221,55,6],"class_list":["post-256","post","type-post","status-publish","format-standard","hentry","category-3","category-4","tag-api-","tag-apisix","tag-envoy","tag-kong","tag-55","tag-6"],"_links":{"self":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/256","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=256"}],"version-history":[{"count":0,"href":"https:\/\/yykcj.com\/index.php?rest_route=\/wp\/v2\/posts\/256\/revisions"}],"wp:attachment":[{"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yykcj.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}