mirror of
https://github.com/fawney19/Aether.git
synced 2026-09-02 01:10:23 +08:00
fix: increase postgres shared memory for dashboard queries
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user