mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
Memcached, Joomla, Moodle, Odoo, Shopware, Snipe-IT and SuiteCRM set
their cache size, PHP memory_limit, OPcache, worker limits and search
heap as literals next to a mem_limit they never read. They now ask
lookup('service_memory_mb') for a share of that limit. The shares are
chosen so every rendered value stays what it was.
Where the parameter lives in a file that cannot hold a template, the
value is handed in: Shopware's init script reads INIT_PHP_MEMORY_LIMIT
and refuses to start without it, SuiteCRM's image takes it as a build
argument. Shopware's worker gets --memory-limit as a command appended
to its entrypoint, and Moodle's OPcache size moves from the static ini
into the rendered one.
The performance.php.memory_limit keys of Joomla and Moodle are gone
from services.yml; nothing else read them.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
16 lines
707 B
YAML
16 lines
707 B
YAML
---
|
|
application_id: svc-db-memcached
|
|
entity_name: "{{ application_id | get_entity_name }}"
|
|
|
|
database_type: "{{ entity_name }}"
|
|
|
|
MEMCACHED_CONTAINER: "{{ lookup('config', application_id, 'services.' ~ entity_name ~ '.name') }}"
|
|
MEMCACHED_CONTAINER_ADDRESS: "{{ lookup('container_address', application_id, entity_name) }}"
|
|
MEMCACHED_EXPOSE_LOCAL: true
|
|
MEMCACHED_LOCAL_HOST: "127.0.0.1"
|
|
MEMCACHED_RETRIES: 5
|
|
MEMCACHED_DELAY: 5
|
|
MEMCACHED_MEMORY_LIMIT_MB: "{{ lookup('service_memory_mb', application_id, entity_name, 0.75) }}"
|
|
MEMCACHED_EXEC_SHELL: "container exec {{ MEMCACHED_CONTAINER_ADDRESS }} sh -lc"
|
|
MEMCACHED_PROBE: "printf \"version\\r\\n\" | nc -w 1 {{ MEMCACHED_LOCAL_HOST }} 11211 | grep -q VERSION"
|