Let measurements pin each component to its own CPUs

Track 1 compares replica layouts that must get exactly the same CPUs,
and the load generator, balancer, Valkey and PostgreSQL must not steal
cycles from the replicas or from each other. Every service now takes
an optional cpuset from LB_CPUSET, API_CPUSET, PG_CPUSET,
VALKEY_CPUSET and K6_CPUSET. They are empty by default and compose
drops an empty cpuset, so the ordinary stand is unchanged and make
limits still passes.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Artyom
2026-10-28 20:25:23 +03:00
co-authored by Claude Opus 5.5
parent d8d551aae4
commit 107fbbbe15
3 changed files with 14 additions and 3 deletions
+5
View File
@@ -26,6 +26,7 @@ services:
restart: unless-stopped
read_only: true
cap_drop: [ALL]
cpuset: ${LB_CPUSET:-}
deploy:
resources:
limits: {cpus: "${LB_CPUS:-1}", memory: 128m}
@@ -59,6 +60,7 @@ services:
restart: unless-stopped
read_only: true
tmpfs: [/tmp]
cpuset: ${API_CPUSET:-}
depends_on:
migrate:
condition: service_completed_successfully
@@ -111,6 +113,7 @@ services:
secrets: [postgres_password]
volumes: [pgdata:/var/lib/postgresql/data]
shm_size: 256m
cpuset: ${PG_CPUSET:-}
healthcheck:
test: ["CMD", "pg_isready", "-h", "127.0.0.1", "-U", "messenger", "-d", "messenger"]
interval: 2s
@@ -140,6 +143,7 @@ services:
- volatile-lru
secrets: [valkey.conf]
volumes: [valkeydata:/data]
cpuset: ${VALKEY_CPUSET:-}
healthcheck:
test: ["CMD-SHELL", "REDISCLI_AUTH=\"$$(sed -n 's/^requirepass //p' /run/secrets/valkey.conf)\" valkey-cli ping | grep -q PONG"]
interval: 2s
@@ -159,6 +163,7 @@ services:
BASE_URL: http://lb:8080
volumes: [./infra/k6:/scripts:ro]
networks: [edge]
cpuset: ${K6_CPUSET:-}
deploy:
resources:
limits: {cpus: "${K6_CPUS:-2}", memory: "${K6_MEMORY:-512m}"}