arc/config/postgresql-hesabix.conf
Babak Alizadeh c6f59bcea3 some bug fixes
2026-05-14 16:01:31 +03:30

31 lines
1.6 KiB
Text
Executable file
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Hesabix PostgreSQL Optimization Configuration (مرجع دستی برای سرور ~۳۲GB)
# نصب خودکار: deploy.sh دیگر این فایل را کپی نمی‌کند؛ تنظیمات را بر اساس MemTotal
# و (workers × pool) در conf.d/hesabix-optimization.conf تولید می‌کند.
# برای تغییر دائمی پروفایل‌ها، توابع assign_pg_memory_profile_from_mem_kb و
# write_postgresql_hesabix_optimization_conf را در deploy.sh ویرایش کنید.
# ==============================================================================
# CONNECTIONS - ضروری برای Hesabix (pool_size 150 + max_overflow 150 = 300)
# ==============================================================================
max_connections = 300
# ==============================================================================
# MEMORY - بهینه برای سرور ~32GB RAM
# ==============================================================================
# حافظه مشترک برای کش داده (حدود 25% RAM)
shared_buffers = 8GB
# حافظه تخمینی برای planner (حدود 75% RAM)
effective_cache_size = 24GB
# حافظه هر عملیات sort/hash (افزایش برای کوئری‌های سنگین)
work_mem = 16MB
# حافظه برای VACUUM، CREATE INDEX و ...
maintenance_work_mem = 512MB
# ==============================================================================
# QUERY PLANNER - برای دیسک SSD
# اگر از HDD استفاده می‌کنید، این خط را حذف یا comment کنید
# ==============================================================================
random_page_cost = 1.1