Add memory partitioning for LXD containers, PostgreSQL, Tomcat, and Doris - #87
Open
jason-p-pickering wants to merge 6 commits into
Open
Add memory partitioning for LXD containers, PostgreSQL, Tomcat, and Doris#87jason-p-pickering wants to merge 6 commits into
jason-p-pickering wants to merge 6 commits into
Conversation
Codifies manually-verified memory partitioning (LXD limits.memory, Postgres/Tomcat/Doris tuning) into Ansible inventory variables and role changes, so memory-constrained hosts don't need hand-tuning rediscovered on every deployment. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The final review found a 7th container-creating lxd_container task that was missed when lxd_memory_limit was wired into the other 6 (postgres, create-instance x2, proxy, monitoring, integration, doris). Apply the identical combine() pattern to the backup container so it can be capped too, matching the feature's stated goal of letting an operator cap any LXD container's memory. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The spec described doris_fe_heap_size as setting a whole JAVA_OPTS line via lineinfile, replacing both -Xmx and -Xms. The shipped implementation in apache-doris-setup.yml actually uses ansible.builtin.replace with regex -Xmx\S+ to surgically swap only the -Xmx token, deliberately leaving -Xms and Doris's other default JVM flags (GC, metaspace, etc.) untouched. Update the doc so it matches the approved code. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
lxd_memory_limitinventory variable, wired into every container-creating role's LXDconfig:dict (postgres, create-instance, proxy, monitoring, integration, backups, and the standalone Doris setup playbook) via conditionalcombine().doris_fe_heap_size/doris_be_mem_limitvariables toapache-doris-setup.yml, applied via a surgical-Xmxtoken replace (fe.conf) andmem_limitlineinfile (be.conf), each notifying a restart handler.pg_shared_buffers,pg_work_mem,pg_maintenance_work_mem,pg_effective_cache_size,pg_max_connections,heap_memory_size) indeploy/inventory/hosts.template, including a new example[apache_doris]group.Design spec:
docs/superpowers/specs/2026-07-06-memory-partitioning-design.mdImplementation plan:
docs/superpowers/plans/2026-07-06-memory-partitioning.mdTest plan
ansible-lint/yamllintreviewed on all modified files (only pre-existing, unrelated warnings — missing collections, pre-existing var-naming/line-length issues elsewhere in the repo)ansible-playbook --syntax-checkondhis2.yml,playbooks/apache-doris-setup.yml, andbackup.ymlansible-inventory --graphagainst the updatedhosts.templateconfirms it still parses, including the new[apache_doris]grouplimits.memorycaps, Postgresconf.d/customoverride, Tomcat heap, Doris FE/BE tuning) before being codified here🤖 Generated with Claude Code