| 5 | == OS optimizations == |
| 6 | |
| 7 | * ''filesystem'' - it's recommended to use the '''xfs''' filesystem, over ''ext4'' or similar. Mount with '''noatime''', e.g. in `/etc/fstab`: |
| 8 | {{{ |
| 9 | # / was on /dev/sda1 during installation |
| 10 | UUID=212a6de3-515b-4e12-aa17-3e466f6966aa / ext4 noatime,errors=remount-ro 0 1 |
| 11 | }}} |
| 12 | * ''scheduler'' - '''deadline''' for spinning disk, '''noop''' for ssd or high caching raid, e.g. |
| 13 | {{{ |
| 14 | echo deadline > /sys/block/DEVICE/queue/scheduler |
| 15 | }}} |
| 16 | * ''read ahead'' - enable with below command, which can be made permanent by putting in `/etc/rc.local` for example: |
| 17 | {{{ |
| 18 | /sbin/blockdev --setra 4096 /dev/DEVICE |
| 19 | }}} |
| 20 | * ''write cache'' - put the below in `/etc/sysctl.conf` and load with `sysctl -p`: |
| 21 | {{{ |
| 22 | vm.dirty_background_ratio = 5 |
| 23 | vm.dirty_background_ratio = 10 |
| 24 | }}} |
| 25 | * ''shared memory'' - run attachment:calc_kernel_shm.sh and substituted the outputs into `/etc/sysctl.conf`: |
| 26 | {{{ |
| 27 | kernel.shmmax=VALUE |
| 28 | kernel.shmall=VALUE |
| 29 | }}} |
| 30 | |
| 31 | == PostgreSQL == |
| 32 | The default PostgreSQL configuration can be tuned for better performance with rasdaman. The parameters below should be adapted in the `postgresql.conf`, typically found under `/etc/postgresql`. |
| 33 | * ''max_connections'' - as long as a single user is using the database, this can be decreased to about 40 |
| 34 | * ''shared_buffers'' - should be 25%-33% of your total RAM |
| 35 | * ''work_mem'' - `(total RAM / connections) / 4..16`, but not lower then 128 MB. When you have 4 GB RAM and you are alone then 256 MB is fine. |
| 36 | * ''maintenance_work_mem'' - total RAM / 16 |
| 37 | * ''synchronous_commit'' - set to ''off'' when doing bulk ingestion |
| 38 | * ''wal_buffer'' - should be 16 MB; by default 1/32 from the shared buffer value is taken as long as it is lower then 16 MB otherwise it is 16 MB |
| 39 | * ''checkpoint_segments'' - 256 is a good start value when doing bulk ingestion |
| 40 | * ''checkpoint_completion_target'' - 0.0 (especially important for bulk ingestion) |
| 41 | * ''random_page_cost'' - 2.0 for spinning disk and 1.01 for ssd, high caching raid and when DB fits into RAM |
| 42 | * ''effective_cache_write'' - total RAM - shared_buffers value |
| 43 | * ''logging_collector'' - set to on if it isn't set already |
| 44 | * ''log_line_prefix'' - set to '%t ' to get timestamps in the logs |