From 2c4d25239b66e5a67d5a446344e44040f5368dea Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sun, 15 Nov 2026 21:22:27 +0800 Subject: [PATCH 1/2] docs(aisix): say config.proxy.workers also sizes the token-estimate pool --- charts/aisix/README.md | 2 +- charts/aisix/values.yaml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/aisix/README.md b/charts/aisix/README.md index 9d2d592..acd883e 100644 --- a/charts/aisix/README.md +++ b/charts/aisix/README.md @@ -575,7 +575,7 @@ rejects. New installs set the value in its own key in `values.yaml` or under | config.proxy.request_id.accept_headers | list | `["x-aisix-request-id"]` | Headers a caller may supply its own request id in. Add `x-request-id` only when no proxy in front stamps it | | config.proxy.thread_per_core | bool | `nil` | Thread-per-core serving topology. Null uses the gateway default (on for Linux) | | config.proxy.url_rewrites | list | `[]` | Entry-level URL rewrite rules, first match wins, e.g. `[{name: per-server-mcp, match: "^/mcp-servers/([^/]+)/mcp$", rewrite: "/mcp/$1"}]` | -| config.proxy.workers | int | `nil` | Worker count. Null uses the gateway default | +| config.proxy.workers | int | `nil` | Worker count. Null uses the gateway default (the available CPUs). Also sizes the token-estimate pool, whose threads each hold their own tokenizer copy per encoding they count with (about 40 MiB per thread when both cl100k and o200k are used) | | config.ratelimit.concurrency_ttl_secs | int | `300` | Seconds a concurrency-limit slot is held at most | | config.ratelimit.redis | object | `nil` | Extra settings for the shared rate-limit Redis selected by `rateLimit.backend: redis`, e.g. `{timeout_secs: 2}` or `{mode: cluster, nodes: [...]}`. Same keys as `cache.redis`; the URL comes from `rateLimit.redis`, `username` and `password` go through `configSecrets` | | config.shutdown.min_drain_secs | int | `30` | Seconds the gateway keeps accepting after SIGTERM while `/readyz` reports 503. `terminationGracePeriodSeconds` must cover it | diff --git a/charts/aisix/values.yaml b/charts/aisix/values.yaml index a9c84d1..13ab0e2 100644 --- a/charts/aisix/values.yaml +++ b/charts/aisix/values.yaml @@ -254,7 +254,10 @@ config: # -- (bool) Thread-per-core serving topology. Null uses the gateway default (on # for Linux) thread_per_core: null - # -- (int) Worker count. Null uses the gateway default + # -- (int) Worker count. Null uses the gateway default (the available CPUs). + # Also sizes the token-estimate pool, whose threads each hold their own + # tokenizer copy per encoding they count with (about 40 MiB per thread when + # both cl100k and o200k are used) workers: null # -- Entry-level URL rewrite rules, first match wins, e.g. # `[{name: per-server-mcp, match: "^/mcp-servers/([^/]+)/mcp$", rewrite: "/mcp/$1"}]` From f16d1119df369e551fe06cbd01e615ac0bbb9950 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Sun, 15 Nov 2026 23:31:08 +0800 Subject: [PATCH 2/2] docs(aisix): state measured per-encoding tokenizer memory for config.proxy.workers --- charts/aisix/README.md | 2 +- charts/aisix/values.yaml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/aisix/README.md b/charts/aisix/README.md index acd883e..d6e5fe2 100644 --- a/charts/aisix/README.md +++ b/charts/aisix/README.md @@ -575,7 +575,7 @@ rejects. New installs set the value in its own key in `values.yaml` or under | config.proxy.request_id.accept_headers | list | `["x-aisix-request-id"]` | Headers a caller may supply its own request id in. Add `x-request-id` only when no proxy in front stamps it | | config.proxy.thread_per_core | bool | `nil` | Thread-per-core serving topology. Null uses the gateway default (on for Linux) | | config.proxy.url_rewrites | list | `[]` | Entry-level URL rewrite rules, first match wins, e.g. `[{name: per-server-mcp, match: "^/mcp-servers/([^/]+)/mcp$", rewrite: "/mcp/$1"}]` | -| config.proxy.workers | int | `nil` | Worker count. Null uses the gateway default (the available CPUs). Also sizes the token-estimate pool, whose threads each hold their own tokenizer copy per encoding they count with (about 40 MiB per thread when both cl100k and o200k are used) | +| config.proxy.workers | int | `nil` | Worker count. Null uses the gateway default (the available CPUs). Also sizes the token-estimate pool: one thread per worker, each holding one tokenizer instance per encoding it has counted with (about 17 MiB cl100k, 27 MiB o200k, 39 MiB o200k_harmony) | | config.ratelimit.concurrency_ttl_secs | int | `300` | Seconds a concurrency-limit slot is held at most | | config.ratelimit.redis | object | `nil` | Extra settings for the shared rate-limit Redis selected by `rateLimit.backend: redis`, e.g. `{timeout_secs: 2}` or `{mode: cluster, nodes: [...]}`. Same keys as `cache.redis`; the URL comes from `rateLimit.redis`, `username` and `password` go through `configSecrets` | | config.shutdown.min_drain_secs | int | `30` | Seconds the gateway keeps accepting after SIGTERM while `/readyz` reports 503. `terminationGracePeriodSeconds` must cover it | diff --git a/charts/aisix/values.yaml b/charts/aisix/values.yaml index 13ab0e2..bbfd443 100644 --- a/charts/aisix/values.yaml +++ b/charts/aisix/values.yaml @@ -255,9 +255,9 @@ config: # for Linux) thread_per_core: null # -- (int) Worker count. Null uses the gateway default (the available CPUs). - # Also sizes the token-estimate pool, whose threads each hold their own - # tokenizer copy per encoding they count with (about 40 MiB per thread when - # both cl100k and o200k are used) + # Also sizes the token-estimate pool: one thread per worker, each holding one + # tokenizer instance per encoding it has counted with (about 17 MiB cl100k, + # 27 MiB o200k, 39 MiB o200k_harmony) workers: null # -- Entry-level URL rewrite rules, first match wins, e.g. # `[{name: per-server-mcp, match: "^/mcp-servers/([^/]+)/mcp$", rewrite: "/mcp/$1"}]`