Projekt

Allgemein

Profil

Aktionen

710 Datenbankeinstellungen und Tuning (postgresql conf) » Historie » Revision 13

« Zurück | Revision 13/85 (diff) | Weiter »
[S] Dominik G, 02.10.2013 12:37


Datenbankeinstellungen und Tuning

postgresql.conf

Linux

- Betriebssystem - Speichereinstellungen mind. 3GiB Arbeitsspeicher!

  • standard:
    sysctl kernel.shmmax
    kernel.shmmax = 33554432
  • umsetzen auf 280437720 (256MB, Mindestens, LOLL steht auf 1024MB (8GB Ram)) (On Windows the useful range is 64MB to 512MB)
    /etc/sysctl.conf -> zeile aufnehmen: kernel.shmmax=280437720
    reboot

-Nur auf Systemen mit 3GiB+ RAM anzuwenden:

$ free -m

             total       used       free     shared    buffers     cached
Mem:          3018       1516       1501          0        208       1113
-/+ buffers/cache:        194       2823
Swap:         1023          0       1023

- Weiteres

Unter Linux ist noch die shmmax-Option aus der 99-postgresql.conf via sysctl zu setzen, sonst klappert das da.
http://www.postgresql.org/docs/8.2/static/kernel-resources.html

Konfiguration PostgreSQL (Beachte Betriebssystem)

shared_buffers = 1024MB
temp_buffers = 8MB
work_mem = 16MB (nicht zu hoch, da je sort bzw. hash Operation, auch mehrfach bei komplexen queries)
maintenance_work_mem = 512MB (für VACUUM, CREATE INDEX, and ALTER TABLE ADD FOREIGN KEY, außerdem für restore dumps)

effective_cache_size = 2056MB (Beachte 1/2 Arbeitsspeicher)

fsync = off
synchronous_commit = off
wal_buffers = 8MB
checkpoint_segments = 64

default_statistics_target = 1000

date_style = DMY
log_destination = 'eventlog' (unter Windows)

Bis Prodat 11.5.3 statement_timeout=120000

Könnte durchaus noch weiter getrieben werden, indem man Sie auf die Prodat-DB abstimmt:

Virtualisierung

Database_Virtualization_PG_China.pdf

Von [S] Dominik G vor fast 11 Jahren aktualisiert · 13 Revisionen