- Introduced `saas.plan` model to define subscription plans with limits and pricing. - Created `saas.restaurant` model to manage restaurant tenants, including database provisioning and subscription management. - Implemented views for managing SaaS plans and restaurant tenants, including tree and form views. - Added security access rights for the new models. - Developed a backup management view for database backups. - Updated menu structure to include new SaaS management options. - Added Docker and deployment configurations for PostgreSQL, Redis, and Odoo services. - Included scaling guide and backup scripts for production environments. - Enhanced theme with new images and layout adjustments.
44 lines
1.3 KiB
Plaintext
44 lines
1.3 KiB
Plaintext
# PostgreSQL 15 configuration optimized for Odoo Multi-Tenant SaaS
|
|
# Assume 16GB system RAM, 4 CPU Cores
|
|
|
|
# Connectivity
|
|
max_connections = 500
|
|
superuser_reserved_connections = 3
|
|
|
|
# Memory Sizing
|
|
shared_buffers = 4GB # 25% of total RAM
|
|
work_mem = 16MB # Allocates per operation
|
|
maintenance_work_mem = 512MB
|
|
effective_cache_size = 12GB # 75% of total RAM
|
|
temp_buffers = 8MB
|
|
|
|
# Write-Ahead Log (WAL)
|
|
wal_level = replica
|
|
max_wal_size = 4GB
|
|
min_wal_size = 1GB
|
|
checkpoint_completion_target = 0.9
|
|
checkpoint_timeout = 15min
|
|
|
|
# Disk I/O & Query Planner
|
|
random_page_cost = 1.1 # Optimized for SSD storage
|
|
effective_io_concurrency = 200 # Concurrent read requests (SSD)
|
|
|
|
# Background Writer & Autovacuum (Crucial for Odoo table cleanup)
|
|
autovacuum = on
|
|
autovacuum_max_workers = 4
|
|
autovacuum_naptime = 1min
|
|
autovacuum_vacuum_threshold = 50
|
|
autovacuum_analyze_threshold = 50
|
|
autovacuum_vacuum_scale_factor = 0.05
|
|
autovacuum_analyze_scale_factor = 0.02
|
|
autovacuum_vacuum_cost_limit = 1000
|
|
|
|
# Logging
|
|
log_destination = 'stderr'
|
|
logging_collector = on
|
|
log_directory = 'log'
|
|
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
|
|
log_min_messages = warning
|
|
log_min_error_statement = error
|
|
log_min_duration_statement = 250 # Log slow queries taking longer than 250ms
|