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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user