From dd54688f86101271fda14b9cc332a5e6402381c6 Mon Sep 17 00:00:00 2001 From: Niek Otten Date: Mon, 27 Jul 2026 13:07:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20cap=20Objecten/Objecttypen=20uWSGI=20to?= =?UTF-8?q?=201=20worker=20=E2=80=94=20unstarve=20verify-stack=20e2e=20(cl?= =?UTF-8?q?oses=20#144)=20(#145)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What & why **P0 — red `main`.** Fixes #144: `verify-stack` fails on the Playwright e2e step (main runs 2177 after #142, 2190 after #143), while the PR runs passed. Closes #144 ### Root cause The Maykin **Objecttypen** (S-18a) and **Objecten** (S-18b) images run their `web` under uWSGI with **4 processes × 4 threads by default** (`UWSGI_PROCESSES:-4`). Two web services × 4 idle Django workers (~200 MB each) sat idle during the e2e step and starved the single shared self-hosted runner — Keycloak and the portals stopped responding (the login `#username` never appeared) and Chromium hit `Target crashed`. The runner margin was already thin; the second chain tipped it over (main green through run 2159, red from 2177). ### Fix Cap `UWSGI_PROCESSES: "1"` + `UWSGI_THREADS: "2"` on both `objecten` and `objecttypen` in both compose files. These APIs only serve single-request smoke checks and are idle during e2e, so 1 worker is plenty — it frees ~1–1.5 GB. The `-init` containers ignore it (they run `setup_configuration`, not uwsgi). ## Verified locally Brought the objecten chain up with the cap: both services reach healthy, worker count drops from 6 (master + http + 4 workers) to 3 (master + http + 1 worker) per service, and `make verify-objecten` / `make verify-objecttypen` both still → **OK — no-auth 401, token 200**. `docker compose config` clean on both files. ## Definition of Done - [x] Linked issue (#144). - [x] Conventional Commit referencing #144. - [x] Verified locally (both APIs healthy + smoke green with 1 worker). - [x] Closed by the merging PR (`closes #144`). No ADR: config-only tuning of existing services — no boundary, dependency, or coupling change. 🤖 Generated with [Claude Code](https://claude.com/claude-code)Reviewed-on: https://git.labs.respellion.tech/eho/register-referentie/pulls/145 --- infra/docker-compose.local.yml | 6 ++++++ infra/docker-compose.yml | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/infra/docker-compose.local.yml b/infra/docker-compose.local.yml index a03cacd..a148115 100644 --- a/infra/docker-compose.local.yml +++ b/infra/docker-compose.local.yml @@ -583,6 +583,9 @@ services: objecttypen-init: image: docker.io/maykinmedia/objecttypes-api:${OBJECTTYPES_TAG:-3.4.2} environment: &objecttypen-env-local + # 1 uWSGI worker, not the image default of 4×4 (#144) — idle workers starve the CI runner. + UWSGI_PROCESSES: "1" + UWSGI_THREADS: "2" DJANGO_SETTINGS_MODULE: objecttypes.conf.docker SECRET_KEY: ${OBJECTTYPES_SECRET_KEY:-dev-only-not-for-production} DB_HOST: objecttypen-db @@ -644,6 +647,9 @@ services: objecten-init: image: docker.io/maykinmedia/objects-api:${OBJECTS_TAG:-3.4.0} environment: &objecten-env-local + # 1 uWSGI worker, not the image default of 4×4 (#144) — idle workers starve the CI runner. + UWSGI_PROCESSES: "1" + UWSGI_THREADS: "2" DJANGO_SETTINGS_MODULE: objects.conf.docker SECRET_KEY: ${OBJECTS_SECRET_KEY:-dev-only-not-for-production} DB_HOST: objecten-db diff --git a/infra/docker-compose.yml b/infra/docker-compose.yml index 2d0b2a0..c7a1fde 100644 --- a/infra/docker-compose.yml +++ b/infra/docker-compose.yml @@ -596,6 +596,11 @@ services: objecttypen-init: image: docker.io/maykinmedia/objecttypes-api:${OBJECTTYPES_TAG:-3.4.2} environment: &objecttypen-env + # 1 uWSGI worker, not the image default of 4×4: this API only serves single-request smoke + # checks and sits idle during the e2e step — 4 idle Django workers each pin ~200 MB and starve + # the shared CI runner (#144). Init ignores this (it runs setup_configuration, not uwsgi). + UWSGI_PROCESSES: "1" + UWSGI_THREADS: "2" DJANGO_SETTINGS_MODULE: objecttypes.conf.docker SECRET_KEY: ${OBJECTTYPES_SECRET_KEY:-dev-only-not-for-production} DB_HOST: objecttypen-db @@ -662,6 +667,9 @@ services: objecten-init: image: docker.io/maykinmedia/objects-api:${OBJECTS_TAG:-3.4.0} environment: &objecten-env + # 1 uWSGI worker, not the image default of 4×4 — see the objecttypen note above (#144). + UWSGI_PROCESSES: "1" + UWSGI_THREADS: "2" DJANGO_SETTINGS_MODULE: objects.conf.docker SECRET_KEY: ${OBJECTS_SECRET_KEY:-dev-only-not-for-production} DB_HOST: objecten-db