Skip to content

Commit

Permalink
Add custom postgres config and set max_locks_per_transaction/max_pred…
Browse files Browse the repository at this point in the history
…_locks_per_transaction
  • Loading branch information
derschatta committed Jan 22, 2019
1 parent 5b17a14 commit 476fb70
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 16 deletions.
44 changes: 28 additions & 16 deletions compose/pgsql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,57 +5,69 @@ services:
image: postgres:9.3
container_name: totara_pgsql93
ports:
- "5493:5432"
- "5493:5432"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
command:
postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- pgsql93-data:/var/lib/postgresql/data
- ./pgsql/my-postgres.conf:/etc/postgresql/postgresql.conf
- pgsql93-data:/var/lib/postgresql/data
depends_on:
- nginx
- nginx
networks:
- totara
- totara

pgsql96:
image: postgres:9.6
container_name: totara_pgsql96
ports:
- "5496:5432"
- "5496:5432"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
command:
postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- pgsql96-data:/var/lib/postgresql/data
- ./pgsql/my-postgres.conf:/etc/postgresql/postgresql.conf
- pgsql96-data:/var/lib/postgresql/data
depends_on:
- nginx
- nginx
networks:
- totara
- totara

pgsql10:
image: postgres:10.6
container_name: totara_pgsql10
ports:
- "5410:5432"
- "5410:5432"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
command:
postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- pgsql10-data:/var/lib/postgresql/data
- ./pgsql/my-postgres.conf:/etc/postgresql/postgresql.conf
- pgsql10-data:/var/lib/postgresql/data
depends_on:
- nginx
- nginx
networks:
- totara
- totara

pgsql:
image: postgres:11.1
container_name: totara_pgsql11
ports:
- "5432:5432"
- "5432:5432"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
command:
postgres -c 'config_file=/etc/postgresql/postgresql.conf'
volumes:
- pgsql11-data:/var/lib/postgresql/data
- ./pgsql/my-postgres.conf:/etc/postgresql/postgresql.conf
- pgsql11-data:/var/lib/postgresql/data
depends_on:
- nginx
- nginx
networks:
- totara
- totara

volumes:
pgsql93-data:
Expand Down
16 changes: 16 additions & 0 deletions pgsql/my-postgres.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# How to get an example pgsql config file:
# docker run -i --rm postgres cat /usr/share/postgresql/postgresql.conf.sample > my-postgres.conf
#
# Memory units: kB = kilobytes Time units: ms = milliseconds
# MB = megabytes s = seconds
# GB = gigabytes min = minutes
# TB = terabytes h = hours
# d = days

listen_addresses = '*'
max_locks_per_transaction = 1024
max_pred_locks_per_transaction = 1024

0 comments on commit 476fb70

Please sign in to comment.