710 Datenbankeinstellungen und Tuning (postgresql conf) » Historie » Version 15
[S] Dominik G, 23.06.2014 11:19
| 1 | 1 | [X] Daniel S | h1. Datenbankeinstellungen und Tuning |
|---|---|---|---|
| 2 | |||
| 3 | 13 | [S] Dominik G | @postgresql.conf@ |
| 4 | 1 | [X] Daniel S | |
| 5 | 13 | [S] Dominik G | h2. Linux |
| 6 | 1 | [X] Daniel S | |
| 7 | 13 | [S] Dominik G | *- Betriebssystem - Speichereinstellungen mind. 3GiB Arbeitsspeicher!* |
| 8 | 1 | [X] Daniel S | |
| 9 | 13 | [S] Dominik G | * standard: |
| 10 | 1 | [X] Daniel S | sysctl kernel.shmmax |
| 11 | kernel.shmmax = 33554432 |
||
| 12 | |||
| 13 | 13 | [S] Dominik G | * umsetzen auf 280437720 (256MB, Mindestens, LOLL steht auf 1024MB (8GB Ram)) (On Windows the useful range is 64MB to 512MB) |
| 14 | 4 | [X] Daniel S | /etc/sysctl.conf -> zeile aufnehmen: kernel.shmmax=280437720 |
| 15 | 1 | [X] Daniel S | reboot |
| 16 | |||
| 17 | 13 | [S] Dominik G | *-Nur auf Systemen mit 3GiB+ RAM anzuwenden:* |
| 18 | 1 | [X] Daniel S | |
| 19 | 13 | [S] Dominik G | @$ free -m@ |
| 20 | <pre> |
||
| 21 | total used free shared buffers cached |
||
| 22 | Mem: 3018 1516 1501 0 208 1113 |
||
| 23 | -/+ buffers/cache: 194 2823 |
||
| 24 | Swap: 1023 0 1023 |
||
| 25 | </pre> |
||
| 26 | 1 | [X] Daniel S | |
| 27 | 13 | [S] Dominik G | *- Weiteres* |
| 28 | 1 | [X] Daniel S | |
| 29 | 13 | [S] Dominik G | Unter Linux ist noch die shmmax-Option aus der 99-postgresql.conf via sysctl zu setzen, sonst klappert das da. |
| 30 | http://www.postgresql.org/docs/8.2/static/kernel-resources.html |
||
| 31 | 1 | [X] Daniel S | |
| 32 | |||
| 33 | |||
| 34 | 13 | [S] Dominik G | h2. Konfiguration PostgreSQL (Beachte Betriebssystem) |
| 35 | 1 | [X] Daniel S | |
| 36 | 13 | [S] Dominik G | @shared_buffers = 1024MB@ |
| 37 | @temp_buffers = 8MB@ |
||
| 38 | @work_mem = 16MB@ (nicht zu hoch, da je sort bzw. hash Operation, auch mehrfach bei komplexen queries) |
||
| 39 | @maintenance_work_mem = 512MB@ (für VACUUM, CREATE INDEX, and ALTER TABLE ADD FOREIGN KEY, außerdem für restore dumps) |
||
| 40 | 1 | [X] Daniel S | |
| 41 | 13 | [S] Dominik G | @effective_cache_size = 2056MB@ (Beachte 1/2 Arbeitsspeicher) |
| 42 | 10 | [X] Daniel S | |
| 43 | 13 | [S] Dominik G | @fsync = off@ |
| 44 | @synchronous_commit = off@ |
||
| 45 | @wal_buffers = 8MB@ |
||
| 46 | @checkpoint_segments = 64@ |
||
| 47 | 11 | [X] Daniel S | |
| 48 | 13 | [S] Dominik G | @default_statistics_target = 1000@ |
| 49 | 11 | [X] Daniel S | |
| 50 | 13 | [S] Dominik G | @date_style = DMY@ |
| 51 | @log_destination = 'eventlog'@ (unter Windows) |
||
| 52 | 11 | [X] Daniel S | |
| 53 | 15 | [S] Dominik G | @standard_conforming_strings = OFF@ (siehe #4860) |
| 54 | @search_path = '"$user",public,TSystem'@ |
||
| 55 | |||
| 56 | |||
| 57 | 14 | [S] Dominik G | (Hinweis: Fehler im PgAdmin/Server-Status: ungültige Byte-Sequenz für Kodierung "UTF8" ... durch SELECT pg_file_read('pg_log/... kann ignoriert werden, da wir ja ins eventlog schreiben. Die Anzeige vom Log hier einfach schließen. Liegt an LC_MESSAGES und mehrsprachigen Systemen, vermutlich ein Bug, Workaround LC_MESSAGES='C' (evtl. nicht mit Prodat kompatibel)) |
| 58 | |||
| 59 | 13 | [S] Dominik G | Bis Prodat 11.5.3 @statement_timeout=120000@ |
| 60 | 11 | [X] Daniel S | |
| 61 | 13 | [S] Dominik G | Könnte durchaus noch weiter getrieben werden, indem man Sie auf die Prodat-DB abstimmt: |
| 62 | * http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server |
||
| 63 | * http://www.postgresql.org/docs/current/static/performance-tips.html |
||
| 64 | * "five_steps_perform_2009.pdf":http://www.prodat-sql.de/redmine/attachments/download/2528/five_steps_perform_2009.pdf Dokument über Einstellungen etc |
||
| 65 | 11 | [X] Daniel S | |
| 66 | |||
| 67 | 12 | [X] Daniel S | |
| 68 | 13 | [S] Dominik G | h2. Virtualisierung |
| 69 | 12 | [X] Daniel S | |
| 70 | 13 | [S] Dominik G | "Database_Virtualization_PG_China.pdf":http://www.prodat-sql.de/redmine/attachments/download/2568/Database_Virtualization_PG_China.pdf |