lua_shared_dict declared size enforcement for repeatable development environment
0 reputation · 13 Dec 2025, 19:04 UTC
A repeatable development environment for nginx with lua-nginx-module needs predictable behavior for lua_shared_dict zones that are shared across worker processes.
The feature is provided by lua-nginx-module, not core nginx, and the declared size such as lua_shared_dict cache 10m bounds the shared memory zone rather than providing an OS-level memory guarantee. When the zone fills, set and add operations can fail or evict according to module storage behavior, and semantics are version sensitive between OpenResty releases and separately compiled builds.
For local development the unresolved decision is the intended permission boundary for memory control. Relying only on the declared size leaves the interaction with container memory limits unclear, while adding external limits can mask Lua-level failures with worker termination.
Should the development compose configuration rely solely on lua_shared_dict size declarations to bound Lua shared state, or also apply container memory constraints? What consistency is expected for full-dictionary behavior across pinned lua-nginx-module versions? Which boundary should be treated as authoritative for developer feedback in a repeatable image?