Skip to content

Instantly share code, notes, and snippets.

@geo-stanciu
Last active July 26, 2019 20:02
Show Gist options
  • Select an option

  • Save geo-stanciu/0ea3fb7f2013c072bd315f2ed35a5442 to your computer and use it in GitHub Desktop.

Select an option

Save geo-stanciu/0ea3fb7f2013c072bd315f2ed35a5442 to your computer and use it in GitHub Desktop.
my postgres settings
# general
ALTER SYSTEM SET autovacuum_max_workers = 4;
ALTER SYSTEM SET autovacuum_vacuum_scale_factor = 0.01;
# backup settings
ALTER SYSTEM SET wal_level = 'logical';
ALTER SYSTEM SET wal_log_hints = 'on';
ALTER SYSTEM SET archive_mode = 'on';
ALTER SYSTEM SET wal_compression='on';
ALTER SYSTEM SET max_wal_senders = '8';
ALTER SYSTEM SET wal_keep_segments='24';
ALTER SYSTEM SET max_parallel_workers_per_gather = '4';
ALTER SYSTEM SET max_worker_processes = '12';
ALTER SYSTEM SET archive_command = 'copy "%p" "d:/backup/archive/%f"';
# memory settings - for 2GB - for other settings go to - http://pgtune.leopard.in.ua/
ALTER SYSTEM SET max_connections = '100';
ALTER SYSTEM SET shared_buffers = '512MB';
ALTER SYSTEM SET effective_cache_size = '1536MB';
ALTER SYSTEM SET work_mem = '5242kB';
ALTER SYSTEM SET maintenance_work_mem = '128MB';
ALTER SYSTEM SET min_wal_size = '2GB';
ALTER SYSTEM SET max_wal_size = '4GB';
ALTER SYSTEM SET checkpoint_completion_target = '0.9';
ALTER SYSTEM SET wal_buffers = '16MB';
ALTER SYSTEM SET default_statistics_target = '100';
ALTER SYSTEM SET random_page_cost = '4';
# memory settings - for 4GB - for other settings go to - http://pgtune.leopard.in.ua/
ALTER SYSTEM SET max_connections = '100';
ALTER SYSTEM SET shared_buffers = '512MB';
ALTER SYSTEM SET effective_cache_size = '3GB';
ALTER SYSTEM SET work_mem = '12233kB';
ALTER SYSTEM SET maintenance_work_mem = '256MB';
ALTER SYSTEM SET min_wal_size = '2GB';
ALTER SYSTEM SET max_wal_size = '4GB';
ALTER SYSTEM SET checkpoint_completion_target = '0.9';
ALTER SYSTEM SET wal_buffers = '16MB';
ALTER SYSTEM SET default_statistics_target = '100';
ALTER SYSTEM SET random_page_cost = '4';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment