Projekt

Allgemein

Profil

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

Revision 7 ([X] Daniel S, 09.05.2011 10:04) → Revision 8/85 ([X] Daniel S, 09.05.2011 10:46)

h1. Datenbankeinstellungen und Tuning 

 h2. Allgemeines 

 Bis Prodat 11.5.3 
 statement_timeout=120000 
 (danach keine Einstellung mehr vornehmen -> zurück auf 0) 

 fsync=off 
 date_style = DMY 
 log_destination (unter Windows -> eventlog) 

 h2. Linux - Betriebssystem - Speichereinstellungen, mind 3GB Arbeitsspeicher! 

 ->standard: 
 sysctl kernel.shmmax 
 kernel.shmmax = 33554432 

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


 h2. Speichereinstellungen Postgres (Beachte Betriebssystem) 

 shared_buffers = 256MB (default 32MB, (siehe oben)) (auch unter Windows, default 32MB) 
 work_mem         = 16MB    (default 8MB     (derzeit im Test, default 1MB) 

 effective_cache_size = 1280MB -> Beachte Arbeitsspeicher, 1/2... 
 > Setting effective_cache_size to 1/2 of total memory would be a normal conservative setting, and 3/4 of memory is a more aggressive but still reasonable amount. You might find a better estimate by looking at your operating system's statistics. On UNIX-like systems, add the free+cached numbers from free or top to get an estimate. On Windows see the "System Cache" size in the Windows Task Manager's Performance tab. Changing this setting does not require restarting the database (HUP is enough).  

 checkpoint_segments = 32 		 # in logfile segments, min 1, 16MB each 
 checkpoint_completion_target = 0.9 	 # checkpoint target duration, 0.0 - 1.0 


 -- 


 1.) 
 Nur auf Systemen mit 3+GB 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 

 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 

 2.) 
 Könnten durchaus noch weiter getrieben werden, indem man Sie auf die 
 Prodat-DB abstimmt: 
 > http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server 
 > http://www.postgresql.org/docs/current/static/performance-tips.html