Tune Zabbix stack: PostgreSQL, web PHP-FPM, server caches

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
This commit is contained in:
Claude Code
2026-03-12 19:21:15 -05:00
parent 5cc7f787cc
commit 518340b373

View File

@@ -32,6 +32,25 @@ spec:
containers: containers:
- name: postgres - name: postgres
image: postgres:16-alpine 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: ports:
- containerPort: 5432 - containerPort: 5432
name: postgres name: postgres
@@ -54,11 +73,11 @@ spec:
subPath: pgdata subPath: pgdata
resources: resources:
requests: requests:
memory: 256Mi
cpu: 100m
limits:
memory: 512Mi memory: 512Mi
cpu: 500m cpu: 200m
limits:
memory: 1Gi
cpu: "1"
livenessProbe: livenessProbe:
exec: exec:
command: command:
@@ -139,6 +158,18 @@ spec:
key: DB-Password key: DB-Password
- name: POSTGRES_DB - name: POSTGRES_DB
value: zabbix 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: resources:
requests: requests:
memory: 256Mi memory: 256Mi
@@ -239,12 +270,24 @@ spec:
secretKeyRef: secretKeyRef:
name: zabbix-credentials name: zabbix-credentials
key: password 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: resources:
requests: requests:
memory: 128Mi memory: 256Mi
cpu: 50m cpu: 100m
limits: limits:
memory: 512Mi memory: 768Mi
cpu: 500m cpu: 500m
livenessProbe: livenessProbe:
httpGet: httpGet: