Skip to content

Size the route shared dicts to start on 64 KiB-page arm64 hosts - #13

Merged
zhanghaohit merged 2 commits into
mainfrom
fix/shm-64k-pages
Oct 28, 2026
Merged

zhanghaohit merged 2 commits into
mainfrom
fix/shm-64k-pages

Conversation

@zhanghaohit

@zhanghaohit zhanghaohit commented Oct 28, 2026 •

Copy link
Copy Markdown
Collaborator

On arm64 hosts with 64 KiB pages (Kunpeng 920, Kylin V10), openresty exits at startup with ngx_slab_alloc() failed: no memory when a shared dict is too small for the slab pool at that page size. Measured there with openresty -t: 16k / 64k / 128k fail, 192k and up start.

The route template autoconfig renders declares cluster_avg_<route> 16k, so the first ModelRoute on such a host would take openresty down. (The image's own dicts are fixed in modelsphere/llm-openresty#25.)

Change

  • internal/sink/route.tmpl: cluster_avg_<route> → 1m, like the other route dicts. route_video.tmpl declares none.
  • TestRenderRoute_SharedDictsFitLargePages: renders a route and fails on any lua_shared_dict under 256k (and on finding none, so it cannot pass vacuously). Against the old template it fails with lua_shared_dict cluster_avg_glm is 16k; with this change, go test ./internal/... passes.

Release. Also moves the chart, kustomize image tag, sample and e2e defaults to 0.4.3, so the 0.4.3 tag can be cut once this merges.

nginx carves each shared zone into pages of the kernel page size, and
arm64 kernels often use 64 KiB pages. There the per-route cluster_avg
dict (16k) is too small for the slab pool, and the openresty that loads
the generated route exits with "ngx_slab_alloc() failed: no memory".
Measured on Kunpeng 920 with 64 KiB pages: 128k fails, 192k starts.

Raise it to 1m, like the other route dicts, and add a test that renders
a route and refuses any dict under 256k. Checked against the old
template: the test fails on cluster_avg 16k.
Moves the chart (version, appVersion), the kustomize image tag, the
sample and the e2e scripts' default image tags to 0.4.3, the release
with the route shared dicts sized for 64 KiB-page hosts.
@zhanghaohit
zhanghaohit merged commit 48c7245 into main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant