forked from decred/dcrdata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
postgresql-tuning.conf
39 lines (35 loc) · 1.33 KB
/
postgresql-tuning.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# PostgreSQL tuning suggestions (adjust for your machine).
# See PgTune: http://pgtune.leopard.in.ua/
#
# To apply these changes, edit the existing postgresql.conf that is in use on
# your system.
# - Arch: /var/lib/postgres/data/postgresql.conf
# - Ubuntu: /etc/postgresql/{{.pg_version}}/main/postgresql.conf
# - Mac: /usr/local/var/postgres/postgres.conf
# Be sure to restart PostgreSQL after saving the config.
# This is the most important setting for fast initial database population.
# OK for general use on a stable system. Insert with alacrity.
synchronous_commit = off
# Decent values for a 6-8GB system with 2 cores:
max_connections = 22
shared_buffers = 2GB
effective_cache_size = 6GB
maintenance_work_mem = 512MB
max_worker_processes = 2
work_mem = 47662kB # scale this down with increasing #cores and #connections!
max_parallel_workers_per_gather = 1
# max_parallel_workers = 2 # v10+ only
wal_buffers = 16MB
max_wal_size = 2GB
min_wal_size = 1GB
checkpoint_completion_target = 0.9
default_statistics_target = 100
# Drive type-specific settings
random_page_cost = 1.1 # for SSD/SAN
effective_io_concurrency = 200 # for SSD/SAN
# random_page_cost = 4 # for HDD
# effective_io_concurrency = 2 # for HDD
# Large import/insert only. Reverse for normal use.
autovacuum = off
fsync = off # but synchronous_commit is probably enough
full_page_writes = off