File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
toolset/databases/postgres Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 22
33set -e
44
5- cat /tmp/postgresql.conf >> " ${PGDATA} /postgresql.conf"
5+ cat /docker-entrypoint-initdb.d/postgresql.conf >> " ${PGDATA} /postgresql.conf"
6+
7+ IO_WORKERS=" $(( `nproc` / 4 )) "
8+
9+ # The maximum valid value for the io_workers configuration parameter is 32.
10+ if [[ " $IO_WORKERS " -lt 32 ]]; then
11+ sed -i " s/io_workers = 32/io_workers = ${IO_WORKERS} /" " ${PGDATA} /postgresql.conf"
12+ fi
Original file line number Diff line number Diff line change 11FROM postgres:18-trixie
22
3- ENV PGDATA=/ssd/postgresql \
4- POSTGRES_DB=hello_world \
3+ ENV POSTGRES_DB=hello_world \
54 POSTGRES_PASSWORD=benchmarkdbpass \
65 POSTGRES_USER=benchmarkdbuser
76
87COPY 60-postgresql-shm.conf /etc/sysctl.d/
9- COPY config.sh create-postgres.sql /docker-entrypoint-initdb.d/
10- COPY postgresql.conf /tmp/
8+ COPY config.sh create-postgres.sql postgresql.conf /docker-entrypoint-initdb.d/
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ listen_addresses = '*'
55max_connections = 2000
66ssl = false
77
8+ # Tuning AIO in PostgreSQL 18:
9+ # https://vondra.me/posts/tuning-aio-in-postgresql-18
10+ # The config.sh script sets the actual value based on that article and the runtime environment.
11+ io_workers = 32
12+
813# values from: http://blog.pgaddict.com/posts/performance-since-postgresql-7-4-to-9-4-pgbench
914# details: http://www.postgresql.org/docs/9.4/static/runtime-config-resource.html
1015# http://www.postgresql.org/docs/9.4/static/runtime-config-wal.html
You can’t perform that action at this time.
0 commit comments