Difference between revisions of "Postgres Tuning"

From UVOO Tech Wiki
Jump to navigation Jump to search
Line 24: Line 24:
 
lc_time = 'en_US.utf8'                          # locale for time formatting
 
lc_time = 'en_US.utf8'                          # locale for time formatting
 
default_text_search_config = 'pg_catalog.english'
 
default_text_search_config = 'pg_catalog.english'
 +
```
 +
 +
/dev/shm  default is 64GB
 +
```
 +
spec:
 +
  volumes:
 +
  - name: dshm
 +
    emptyDir:   
 +
        medium: Memory
 +
  - name: hostpath
 +
    hostPath:
 +
      path: /path/to/host/directory # Change to your directory
 +
  containers:
 +
  - image:  image-name #specify your image name here
 +
    volumeMounts:
 +
      - mountPath: /dev/shm
 +
        name: dshm
 +
      - mountPath: /workspace/container
 +
        name: hostpath
 
```
 
```

Revision as of 17:04, 22 April 2022

https://blog.crunchydata.com/blog/optimize-postgresql-server-performance

Query failed: ERROR: could not resize shared memory segment "/PostgreSQL.980262028" to 2097152 bytes: No space left on device
listen_addresses = '*'
max_connections = 100                   # (change requires restart)
shared_buffers = 4GB                    # min 128kB
temp_buffers = 24MB                     # min 800kB
work_mem = 100MB                                # min 64kB
maintenance_work_mem = 640MB            # min 1MB
dynamic_shared_memory_type = posix      # the default is the first option
max_wal_size = 4GB
min_wal_size = 80MB
effective_cache_size = 8GB
log_timezone = 'Etc/UTC'
datestyle = 'iso, mdy'
timezone = 'Etc/UTC'
lc_messages = 'en_US.utf8'                      # locale for system error message
lc_monetary = 'en_US.utf8'                      # locale for monetary formatting
lc_numeric = 'en_US.utf8'                       # locale for number formatting
lc_time = 'en_US.utf8'                          # locale for time formatting
default_text_search_config = 'pg_catalog.english'

/dev/shm default is 64GB

spec:
  volumes:
  - name: dshm
    emptyDir:     
        medium: Memory
  - name: hostpath
    hostPath:
      path: /path/to/host/directory # Change to your directory
  containers:
  - image:  image-name #specify your image name here
    volumeMounts:
      - mountPath: /dev/shm
        name: dshm
      - mountPath: /workspace/container
        name: hostpath