Making Django PostgreSQL High Performance Settings
Below are the settings for high performance.
echo '' > /etc/postgresql/10/main/postgresql.conf
nano /etc/postgresql/10/main/postgresql.conf
data_directory = '/var/lib/postgresql/10/main'
hba_file = '/etc/postgresql/10/main/pg_hba.conf'
ident_file = '/etc/postgresql/10/main/pg_ident.conf'
external_pid_file = '/var/run/postgresql/10-main.pid'
listen_addresses = '*'
port=5432
max_connections = 300
shared_buffers = 2GB
effective_cache_size = 4GB
maintenance_work_mem = 512MB
checkpoint_completion_target = 0.9
wal_buffers = 16MB
default_statistics_target = 100
effective_io_concurrency = 200
work_mem = 6990kB
min_wal_size = 2GB
max_wal_size = 4GB
max_worker_processes = 2
max_parallel_workers_per_gather = 1
max_parallel_workers = 2
random_page_cost = 10
seq_page_cost = 1
unix_socket_directories = '/var/run/postgresql'
dynamic_shared_memory_type = posix
cluster_name = '10/main'
stats_temp_directory = '/var/run/postgresql/10-main.pg_stat_tmp'
datestyle = 'iso, mdy'
timezone = 'Europe/Istanbul'
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'
include_dir = 'conf.d'
log_statement = all
logging_collector = on
log_destination = 'stderr'
log_rotation_age = 1d
log_directory = '/var/log/postgresql/pg_log'
log_min_duration_statement = 30
log_rotation_age = 1d
log_timezone = 'Turkey'
log_rotation_size = 100MB
After making the settings, we restart and activate Postgresql with the following command.
systemctl restart postgresql; systemctl enable postgresql
Can't find the information you're looking for?
You have examined the knowledge base in detail, but if you cannot find the information you need,
Create a Support Ticket-
How to Open Ports in Windows?
207 2
-
How to Grant Windows Administrator Privileges?
184 0
-
How to install Webmin on Ubuntu?
803 2
-
Linux SSH Terminal Commands and Explanations
682 3
-
CentOS Stream 10 Update Commands
768 1
-
CentOS Stream 9 Update Commands
1112 1
-
CentOS Stream 8 Update Commands
621 0
-
What is FreeBSD?
765 2
-
Out: 452 4.3.1 Insufficient system storage
708 2
-
Turning Off Automatic Updates in Windows Operating Systems
822 0