115 lines
No EOL
4.2 KiB
Django/Jinja
115 lines
No EOL
4.2 KiB
Django/Jinja
# PostgreSQL configuration for APRS.me on CM3588
|
|
# Optimized for RK3588 with RAID0 SSDs
|
|
|
|
#------------------------------------------------------------------------------
|
|
# FILE LOCATIONS
|
|
#------------------------------------------------------------------------------
|
|
|
|
data_directory = '{{ postgresql_data_directory }}'
|
|
hba_file = '{{ postgresql_config_directory }}/pg_hba.conf'
|
|
ident_file = '{{ postgresql_config_directory }}/pg_ident.conf'
|
|
external_pid_file = '/var/run/postgresql/{{ postgresql_version }}-main.pid'
|
|
|
|
#------------------------------------------------------------------------------
|
|
# CONNECTIONS AND AUTHENTICATION
|
|
#------------------------------------------------------------------------------
|
|
|
|
{% for key, value in postgresql_config.items() %}
|
|
{{ key }} = {{ value }}
|
|
{% endfor %}
|
|
|
|
#------------------------------------------------------------------------------
|
|
# RESOURCE USAGE (except WAL)
|
|
#------------------------------------------------------------------------------
|
|
|
|
# These settings are configured above in postgresql_config
|
|
|
|
#------------------------------------------------------------------------------
|
|
# WRITE-AHEAD LOG
|
|
#------------------------------------------------------------------------------
|
|
|
|
# WAL settings configured above
|
|
|
|
#------------------------------------------------------------------------------
|
|
# REPLICATION
|
|
#------------------------------------------------------------------------------
|
|
|
|
wal_level = replica
|
|
archive_mode = on
|
|
archive_command = 'test ! -f {{ postgresql_archive_directory }}/%f && cp %p {{ postgresql_archive_directory }}/%f'
|
|
max_wal_senders = 3
|
|
wal_keep_size = 1GB
|
|
|
|
#------------------------------------------------------------------------------
|
|
# QUERY TUNING
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Planner settings for PostGIS and complex queries
|
|
enable_partitionwise_join = on
|
|
enable_partitionwise_aggregate = on
|
|
jit = on
|
|
|
|
#------------------------------------------------------------------------------
|
|
# REPORTING AND LOGGING
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Logging configuration set above
|
|
|
|
#------------------------------------------------------------------------------
|
|
# STATISTICS
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Stats configuration set above
|
|
shared_preload_libraries = 'pg_stat_statements'
|
|
pg_stat_statements.max = 10000
|
|
pg_stat_statements.track = all
|
|
|
|
#------------------------------------------------------------------------------
|
|
# AUTOVACUUM
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Autovacuum settings configured above
|
|
|
|
#------------------------------------------------------------------------------
|
|
# CLIENT CONNECTION DEFAULTS
|
|
#------------------------------------------------------------------------------
|
|
|
|
datestyle = 'iso, mdy'
|
|
timezone = 'UTC'
|
|
lc_messages = 'en_US.UTF-8'
|
|
lc_monetary = 'en_US.UTF-8'
|
|
lc_numeric = 'en_US.UTF-8'
|
|
lc_time = 'en_US.UTF-8'
|
|
default_text_search_config = 'pg_catalog.english'
|
|
|
|
#------------------------------------------------------------------------------
|
|
# LOCK MANAGEMENT
|
|
#------------------------------------------------------------------------------
|
|
|
|
deadlock_timeout = 1s
|
|
max_locks_per_transaction = 128
|
|
|
|
#------------------------------------------------------------------------------
|
|
# VERSION/PLATFORM COMPATIBILITY
|
|
#------------------------------------------------------------------------------
|
|
|
|
# No specific settings needed
|
|
|
|
#------------------------------------------------------------------------------
|
|
# ERROR HANDLING
|
|
#------------------------------------------------------------------------------
|
|
|
|
exit_on_error = off
|
|
restart_after_crash = on
|
|
|
|
#------------------------------------------------------------------------------
|
|
# SSL/TLS CONFIGURATION
|
|
#------------------------------------------------------------------------------
|
|
|
|
ssl = on
|
|
ssl_cert_file = '/etc/postgresql/{{ postgresql_version }}/main/server.crt'
|
|
ssl_key_file = '/etc/postgresql/{{ postgresql_version }}/main/server.key'
|
|
ssl_ca_file = '/etc/postgresql/{{ postgresql_version }}/main/ca.crt'
|
|
ssl_ciphers = 'HIGH:MEDIUM:+3DES:!aNULL'
|
|
ssl_prefer_server_ciphers = on
|
|
ssl_min_protocol_version = 'TLSv1.2' |