fix: increase postgres shared memory for dashboard queries

This commit is contained in:
fawney19
2026-05-23 00:21:34 +08:00
parent 74c82d9948
commit b5e942ca9d
2 changed files with 3 additions and 0 deletions

View File

@@ -69,6 +69,7 @@ ADMIN_USERNAME=admin123456
# PostgreSQL 性能调优(默认值适合 2核4GB 机器,按实际配置覆盖)
# 参考shared_buffers ≈ 可用内存 25%effective_cache_size ≈ 可用内存 50-75%
# POSTGRES_SHM_SIZE 控制 Docker 容器 /dev/shm仪表盘统计等并行查询会使用它。
# work_mem 是每个连接每个排序操作的内存,不要设太大(并发数 × work_mem 是实际占用)
# | 系统内存 | shared_buffers | effective_cache_size | work_mem |
# | 2GB | 256MB | 768MB | 4MB |
@@ -78,5 +79,6 @@ ADMIN_USERNAME=admin123456
# | 32GB+ | 8GB | 24GB | 32MB |
# POSTGRES_SHARED_BUFFERS=1GB
# POSTGRES_EFFECTIVE_CACHE_SIZE=3GB
# POSTGRES_SHM_SIZE=512mb
# POSTGRES_WORK_MEM=16MB
# POSTGRES_MAINTENANCE_WORK_MEM=256MB

View File

@@ -5,6 +5,7 @@ services:
postgres:
image: postgres:15
container_name: aether-postgres
shm_size: ${POSTGRES_SHM_SIZE:-512mb}
environment:
POSTGRES_DB: aether
POSTGRES_USER: postgres