~/talk

Tuning PostgreSQL to work even better

Talkat DjangoCon Europe 2023 · on Tuesday, 2023-05-30· at 16:10· Music Hall· [databases]
slides:none on file

PostgreSQL defaults are conservative but a handful of concrete changes usually help: inspect values with SHOW and the pg_settings view and edit postgresql.conf or use ALTER SYSTEM, then RELOAD or restart as required. Key levers include shared_buffers (default ~128MB — try 25–40% of RAM), work_mem (default 4MB — try 10MB for big sorts), max_connections (default 100 — use pooling like PgBouncer if you need hundreds), checkpoint_timeout (default 5min — 10–30min common), max_wal_size (default 1GB), effective_cache_size (50–70%), random_page_cost (~1.1 for SSD), plus logging via log_min_duration_statement. Leave fsync and autovacuum enabled.

AI-written summary · about

  1. 0:00Introduction and overview
  2. 3:19PostgreSQL configuration basics
  3. 11:36Key parameters by category
  4. 17:18Memory-related settings
  5. 21:31Logging for debugging
  6. 23:57WAL and checkpoint tuning
  7. 27:49Query tuning parameters
  8. 29:57Parameters to leave alone
  9. 33:18Top parameters to start with
  10. 33:59Conclusion and takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.