Skills2026年4月15日·1 分钟阅读

Apache APISIX — Cloud Native High-Performance API Gateway

Apache APISIX is a dynamic, real-time, high-performance API gateway built on NGINX and etcd, offering rich traffic management with a large plugin ecosystem and sub-millisecond routing updates.

Agent 就绪

先审查再安装

这个资产需要先审查。复制的指令会要求 Agent dry-run、列出写入项,确认后再继续。

Needs Confirmation · 64/100策略:需确认
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Community
入口
Start APISIX
先审查命令
npx -y tokrepo@latest install aa6e7a65-38ce-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run,确认写入项后再运行此命令。

TL;DR
APISIX is a high-performance API gateway built on NGINX and etcd with sub-millisecond routing updates and a rich plugin ecosystem.
§01

What it is

Apache APISIX is a dynamic, real-time, high-performance API gateway built on NGINX and etcd. It provides rich traffic management features including load balancing, rate limiting, authentication, and observability through a large plugin ecosystem. Routes and plugins update in sub-millisecond time without server restarts.

It is designed for platform teams and API developers who need a production-grade gateway with dynamic configuration, multi-protocol support (HTTP, gRPC, WebSocket, MQTT), and extensibility via Lua or external plugins.

§02

How it saves time or tokens

Traditional gateways require config file edits and process reloads to apply routing changes. APISIX stores all configuration in etcd and pushes updates to NGINX workers in real time. Adding a new route, enabling rate limiting, or switching upstream targets happens through an admin API call without downtime. The plugin marketplace covers common needs -- JWT auth, CORS, Prometheus metrics, fault injection -- so you rarely write custom code.

§03

How to use

  1. Start APISIX with Docker Compose.
git clone https://github.com/apache/apisix-docker
cd apisix-docker/example
docker compose -p apisix up -d
  1. Create a route via the admin API.
curl -i http://127.0.0.1:9180/apisix/admin/routes/1 \
  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
  -X PUT -d '{
  "uri": "/get",
  "upstream": { "type": "roundrobin", "nodes": {"httpbin.org:80": 1} }
}'
  1. Test the route.
curl http://127.0.0.1:9080/get
§04

Example

Adding rate limiting to a route:

curl http://127.0.0.1:9180/apisix/admin/routes/1 \
  -H 'X-API-KEY: edd1c9f034335f136f87ad84b625c8f1' \
  -X PATCH -d '{
  "plugins": {
    "limit-req": {
      "rate": 10,
      "burst": 5,
      "key_type": "var",
      "key": "remote_addr",
      "rejected_code": 429
    }
  }
}'

The rate limit takes effect immediately without restarting the gateway.

§05

Related on TokRepo

  • DevOps tools -- Infrastructure tools for API management and deployment.
  • Monitoring tools -- Observability plugins that integrate with APISIX.
§06

Common pitfalls

  • The default admin API key is publicly known. Change it immediately in production by editing conf/config.yaml.
  • etcd is a required dependency. If etcd becomes unavailable, APISIX continues serving with cached config but cannot accept new route changes.
  • Custom Lua plugins run inside the NGINX worker process. CPU-intensive plugins can block request handling. Use external plugin runners for heavy computation.

常见问题

How does APISIX compare to Kong?+

Both are NGINX-based API gateways. APISIX uses etcd for configuration storage (sub-millisecond updates), while Kong uses PostgreSQL or Cassandra (slower propagation). APISIX is an Apache Software Foundation project; Kong is backed by Kong Inc. with both open-source and enterprise tiers.

Does APISIX support gRPC?+

Yes. APISIX can proxy gRPC traffic, perform gRPC-to-HTTP transcoding, and apply plugins (auth, rate limiting) to gRPC services the same way it handles HTTP routes.

Can I write custom plugins for APISIX?+

Yes. Plugins can be written in Lua (runs inside NGINX), or as external processes in Python, Go, or Java using the plugin runner protocol. Lua plugins have the lowest latency; external plugins offer language flexibility.

Is APISIX free to use?+

Yes. APISIX is open source under the Apache 2.0 license. There is no paid tier from the Apache project itself. Some vendors offer commercial support and management dashboards.

What is the APISIX Dashboard?+

The APISIX Dashboard is an optional web UI for managing routes, upstreams, and plugins visually. It communicates with APISIX through the admin API and is distributed as a separate Docker image.

引用来源 (3)

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产