config.sh 342 B

123456789101112
  1. #!/bin/bash
  2. set -e
  3. cat /docker-entrypoint-initdb.d/postgresql.conf >> "${PGDATA}/postgresql.conf"
  4. IO_WORKERS="$(( (`nproc` + 3) / 4 ))"
  5. # The maximum valid value for the io_workers configuration parameter is 32.
  6. if [[ "$IO_WORKERS" -lt 32 ]]; then
  7. sed -i "s/io_workers = 32/io_workers = ${IO_WORKERS}/" "${PGDATA}/postgresql.conf"
  8. fi