Skip to content

Commit fd80a49

Browse files
committed
- tuning pg_restore
- updated database version
1 parent ed17315 commit fd80a49

File tree

2 files changed

+26
-2
lines changed

2 files changed

+26
-2
lines changed

sanitizer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ARG version=13.1
22

3-
FROM plyo/postgres:database-7.3.0-$version
3+
FROM plyo/postgres:database-8.0.0-$version
44

55
ENV S3_BACKUP_MNT_POINT "/backups"
66
ENV S3_SANITIZED_BACKUP_MNT_POINT "/sanitized"

sanitizer/src/start.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,30 @@ backup_roles_file=${backup_file}_roles.out
2222

2323
echo "starting postgres..."
2424
rm -rf "${PGDATA}"
25+
26+
cat > /var/lib/postgresql/data/postgresql.conf <<EOL
27+
listen_addresses = '*'
28+
max_connections = 100
29+
shared_buffers = 128MB
30+
dynamic_shared_memory_type = posix
31+
max_wal_size = 1GB
32+
min_wal_size = 80MB
33+
log_timezone = 'UTC'
34+
lc_messages = 'en_US.utf8'
35+
lc_monetary = 'en_US.utf8'
36+
lc_numeric = 'en_US.utf8'
37+
lc_time = 'en_US.utf8'
38+
default_text_search_config = 'pg_catalog.english'
39+
40+
#pg_restore tuning
41+
work_mem = 32MB
42+
shared_buffers = 512MB
43+
maintenance_work_mem = 1GB
44+
full_page_writes = off
45+
autovacuum = off
46+
wal_buffers = 16MB
47+
EOL
48+
2549
/usr/local/bin/docker-entrypoint.sh postgres &
2650

2751
until pg_isready -U postgres -h 0.0.0.0 -p 5432 ; do echo "waiting for postgres to start" && sleep 5 ; done
@@ -61,7 +85,7 @@ if [[ ! -f "/files/${filename}" ]]; then
6185
fi
6286
log "Restoring '${backup_file}'..."
6387
log "pg_restore /files/${filename}"
64-
pg_restore "/files/${filename}" -U postgres -d ${DB_NAME} -v
88+
pg_restore "/files/${filename}" -U postgres -d ${DB_NAME} --jobs=4 -v
6589
status=$?
6690
if [ "$status" != "0" ];
6791
then

0 commit comments

Comments
 (0)