worker: GOMEMLIMIT 560MiB, замер oom/memlimit в limits
This commit is contained in:
@@ -20,6 +20,8 @@ MAX_UPLOAD_BYTES=10485760
|
|||||||
MAX_IMAGE_PIXELS=40000000
|
MAX_IMAGE_PIXELS=40000000
|
||||||
BROKER_URL_FILE=/run/secrets/broker_url
|
BROKER_URL_FILE=/run/secrets/broker_url
|
||||||
WORKER_CONCURRENCY=2
|
WORKER_CONCURRENCY=2
|
||||||
|
# Мягкий лимит кучи Go в worker (≈75% WORKER_MEMORY)
|
||||||
|
WORKER_GOMEMLIMIT=560MiB
|
||||||
JOB_MAX_ATTEMPTS=5
|
JOB_MAX_ATTEMPTS=5
|
||||||
JOB_TIMEOUT_SECONDS=60
|
JOB_TIMEOUT_SECONDS=60
|
||||||
STAGING_RETENTION_SECONDS=86400
|
STAGING_RETENTION_SECONDS=86400
|
||||||
|
|||||||
@@ -267,6 +267,9 @@ services:
|
|||||||
CACHE_URL_FILE: ""
|
CACHE_URL_FILE: ""
|
||||||
BROKER_URL_FILE: /run/secrets/broker_url
|
BROKER_URL_FILE: /run/secrets/broker_url
|
||||||
FAULT_POINTS: ${WORKER_FAULT_POINTS:-}
|
FAULT_POINTS: ${WORKER_FAULT_POINTS:-}
|
||||||
|
# Мягкий лимит кучи Go ≈ 75% лимита контейнера: без него GC (GOGC=100) даёт куче
|
||||||
|
# расти до ~2× живого объёма, и пик подходил вплотную к 768M (замер прогона 4).
|
||||||
|
GOMEMLIMIT: ${WORKER_GOMEMLIMIT:-560MiB}
|
||||||
secrets: [database_url, s3_access_key_id, s3_secret_access_key, broker_url]
|
secrets: [database_url, s3_access_key_id, s3_secret_access_key, broker_url]
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pgrep -x pipeline >/dev/null || pidof pipeline >/dev/null"]
|
test: ["CMD-SHELL", "pgrep -x pipeline >/dev/null || pidof pipeline >/dev/null"]
|
||||||
|
|||||||
@@ -414,6 +414,8 @@ def scenario_limits(c):
|
|||||||
'worker_anon_memory_max_mib': round(anon_max[0] / 1048576, 1),
|
'worker_anon_memory_max_mib': round(anon_max[0] / 1048576, 1),
|
||||||
'worker_memory_peak_incl_page_cache_mib': round(int(peak) / 1048576, 1) if peak.isdigit() else peak,
|
'worker_memory_peak_incl_page_cache_mib': round(int(peak) / 1048576, 1) if peak.isdigit() else peak,
|
||||||
'oom_kill_events': oom.get('oom_kill', 0),
|
'oom_kill_events': oom.get('oom_kill', 0),
|
||||||
|
'go_memlimit': sh('docker', 'exec', cid, 'printenv', 'GOMEMLIMIT', check=False).stdout.strip(),
|
||||||
|
'oom_events': oom.get('oom', 0),
|
||||||
'worker_memory_limit_mib': round(int(limit) / 1048576, 1) if limit.isdigit() else limit,
|
'worker_memory_limit_mib': round(int(limit) / 1048576, 1) if limit.isdigit() else limit,
|
||||||
'pixel_budget': 60_000_000, 'decoded_rgba_per_image_mib': round(6000 * 6000 * 4 / 1048576, 1),
|
'pixel_budget': 60_000_000, 'decoded_rgba_per_image_mib': round(6000 * 6000 * 4 / 1048576, 1),
|
||||||
'variant_sizes': th}
|
'variant_sizes': th}
|
||||||
|
|||||||
Reference in New Issue
Block a user