Core
Lynx Pooled Hosting Runtime
Server-wide runtime tuning for pooled (multi-database) Lynx hosting
lynx_pool
· v19.0.1.2.1
· Standard
What this solves
Lynx Pooled Hosting Runtime
Server-wide module (add lynx_pool to server_wide_modules) for Lynx instances that serve MANY tenant databases from one process pool (dbfilter = ^%d$, empty db_name). It is a no-op on single-database instances and holds no models, views, or data — everything happens at module import, before the prefork master forks its workers.
Key Features
Registry LRU sizing — applies LYNX_REGISTRY_LRU_SIZE to config['registry_lru_size'] as an int. This cannot be done from odoo.conf: unknown configuration keys are kept as unparsed strings, and the registry LRU asserts on an integer size — a string value crashes the server at first registry access. Setting it here, before the first Registry instantiation, is the supported path.
Optional code warm-up — LYNX_POOL_WARMUP_MODULES (comma list) pre-imports those addons' Python in the master process so the code is shared copy-on-write across all forked workers instead of re-imported (and duplicated) per worker. Plain imports only — no post_load hooks run, so uninstalled modules cannot monkey-patch anything.
Multi-domain host routing — when LYNX_POOL_HOST_DB_MAP_FILE points at a JSON {host: database} map, wraps odoo.http.db_filter so a tenant serving several unrelated domains from one database (a multi-website tenant the native dbfilter = ^%d$ cannot route) resolves to the right database statefully, without leaving the pooled model. The map is operator-authored and re-read on file change; a no-op when the variable is unset.
Verified custom domains — with LYNX_POOL_VERIFIED_DOMAINS=1, hosts that tenants have proved they own (lynx_domain) become routable without an operator editing a values file. The tenant supplies the CLAIM; this module forms the VERDICT -- it resolves the challenge TXT record itself and re-applies the reserved-host refusal itself, and never reads the tenant's own state column, which anyone with root on their own database could set by SQL. A host proved by two databases is routed to neither. The operator map above always wins. Rebuilt on a timer with a bounded budget (LYNX_POOL_VERIFIED_TTL / _BUDGET), so requests do not wait on DNS.
Needs dnspython, deliberately not declared (lazy import, opt-in path): without it no host verifies, fail-closed.
Rolling upgrades (ownership by colour) -- with LYNX_POOL_COLOR and LYNX_POOL_OWNERSHIP_FILE set, two deployments of one cell (the current and the next version) can run side by side: each serves, and runs the crons of, only the databases the ownership map gives its colour, so a cell is upgraded one tenant at a time. A mistake can only leave a database unserved, never served by two colours. /lynx_pool/ownership reports the applied map version. Off, and a no-op, when LYNX_POOL_COLOR is unset.
Try Lynx Pooled Hosting Runtime on your team.
Free trial, no credit card. Talk to sales when you're ready.