Guest mode. You can read posts without signing up. Comments, ratings, job contacts and your own posts open after you sign up and accept the rules. What is Kommit →

Reset

1 post tagged #тюнинг: articles, how-tos, projects and jobs from the portal's IT professionals.

Редакция КоммитРедакция портала
commit a5e50b0 · 15 days ago

🌐 Machine-translated from Russian. Show original

In this part:

Why the default settings don't work

postgresql.conf by default is designed so that PostgreSQL runs on any computer, even on a Raspberry Pi: 128 MB for cache, careful disk settings. On a server with 32 GB of memory, this leaves most resources unused.

Procedure: first basic calculation using the formulas below, then measurements (part 5) and spot adjustment. Do not copy other people's configs from the internet entirely.

Memory: basic calculation

Example for a dedicated database server: 32 GB RAM, 8 cores, NVMe, up to 200 connections, mixed load (OLTP).

ParameterRuleExample
shared_buffers~25 % RAM8GB
effective_cache_size~50–75% RAM (scheduler prompt, memory does not allocate)24GB
work_memper sort/hash operation; (RAM − shared_buffers) / (max_connections × 2–4)32MB
maintenance_work_memfor VACUUM, CREATE INDEX; 1–2 GB on large1GB
huge_pagestry by default; enable huge pages in the OS for shared_buffers from 8 GBtry
Read more
Comments 00 участников · 0 гостей🔒 Rate and discuss after signing up