From 518340b3737d427416d26348d0dd2f449d83b562 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Thu, 12 Mar 2026 19:21:15 -0500 Subject: [PATCH] Tune Zabbix stack: PostgreSQL, web PHP-FPM, server caches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PostgreSQL 16: - shared_buffers 128MB→256MB, work_mem 4MB→16MB - random_page_cost 4→1.1 (SSD/Longhorn), effective_io_concurrency→200 - maintenance_work_mem→128MB, wal_buffers→8MB - max_connections 100→50, memory limit 512Mi→1Gi Zabbix Web: - PHP_FPM_PM_MAX_CHILDREN 50→10 (fixes 68x OOMKill) - ZBX_MEMORYLIMIT 128M→256M, PM_MAX_REQUESTS→500 - Memory limit 512Mi→768Mi, request 128Mi→256Mi Zabbix Server: - ZBX_CACHESIZE→64M, ZBX_VALUECACHESIZE→64M - ZBX_HISTORYCACHESIZE→32M, ZBX_TRENDCACHESIZE→8M - ZBX_STARTPOLLERS→10, ZBX_STARTPOLLERSUNREACHABLE→3 --- apps/zabbix/zabbix.yaml | 57 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/apps/zabbix/zabbix.yaml b/apps/zabbix/zabbix.yaml index dea930d..173f5cc 100644 --- a/apps/zabbix/zabbix.yaml +++ b/apps/zabbix/zabbix.yaml @@ -32,6 +32,25 @@ spec: containers: - name: postgres image: postgres:16-alpine + args: + - "-c" + - "shared_buffers=256MB" + - "-c" + - "effective_cache_size=512MB" + - "-c" + - "work_mem=16MB" + - "-c" + - "maintenance_work_mem=128MB" + - "-c" + - "random_page_cost=1.1" + - "-c" + - "effective_io_concurrency=200" + - "-c" + - "max_connections=50" + - "-c" + - "checkpoint_completion_target=0.9" + - "-c" + - "wal_buffers=8MB" ports: - containerPort: 5432 name: postgres @@ -54,11 +73,11 @@ spec: subPath: pgdata resources: requests: - memory: 256Mi - cpu: 100m - limits: memory: 512Mi - cpu: 500m + cpu: 200m + limits: + memory: 1Gi + cpu: "1" livenessProbe: exec: command: @@ -139,6 +158,18 @@ spec: key: DB-Password - name: POSTGRES_DB value: zabbix + - name: ZBX_CACHESIZE + value: "64M" + - name: ZBX_VALUECACHESIZE + value: "64M" + - name: ZBX_HISTORYCACHESIZE + value: "32M" + - name: ZBX_TRENDCACHESIZE + value: "8M" + - name: ZBX_STARTPOLLERS + value: "10" + - name: ZBX_STARTPOLLERSUNREACHABLE + value: "3" resources: requests: memory: 256Mi @@ -239,12 +270,24 @@ spec: secretKeyRef: name: zabbix-credentials key: password + - name: ZBX_MEMORYLIMIT + value: "256M" + - name: PHP_FPM_PM_MAX_CHILDREN + value: "10" + - name: PHP_FPM_PM_START_SERVERS + value: "3" + - name: PHP_FPM_PM_MIN_SPARE_SERVERS + value: "2" + - name: PHP_FPM_PM_MAX_SPARE_SERVERS + value: "5" + - name: PHP_FPM_PM_MAX_REQUESTS + value: "500" resources: requests: - memory: 128Mi - cpu: 50m + memory: 256Mi + cpu: 100m limits: - memory: 512Mi + memory: 768Mi cpu: 500m livenessProbe: httpGet: