File tree Expand file tree Collapse file tree 4 files changed +37
-6
lines changed Expand file tree Collapse file tree 4 files changed +37
-6
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
- set -e
3
- if [ " ${POSTGRES_DB_MAX_CONNECTIONS} X " != " X " ] ; then
4
- set -x ;
2
+
3
+ # max_connections
4
+ if [[ " ${POSTGRES_DB_MAX_CONNECTIONS} X " != " X " ]] ; then
5
5
sed -i -e" s/^.*max_connections =.*$/max_connections = $POSTGRES_DB_MAX_CONNECTIONS /" $PGDATA /postgresql.conf
6
- set +x;
6
+ fi
7
+
8
+ # shared_buffers
9
+ if [[ " ${POSTGRES_DB_SHARED_BUFFERS} X" != " X" ]]; then
10
+ sed -i -e" s/^.*shared_buffers =.*$/shared_buffers = $POSTGRES_DB_SHARED_BUFFERS /" $PGDATA /postgresql.conf
11
+ fi
12
+
13
+ # work_mem
14
+ if [[ " ${POSTGRES_DB_WORK_MEM} X" != " X" ]]; then
15
+ sed -i -e" s/^.*#work_mem =.*$/work_mem = $POSTGRES_DB_WORK_MEM /" $PGDATA /postgresql.conf
16
+ fi
17
+
18
+ # maintenance_work_mem
19
+ if [[ " ${POSTGRES_DB_MAINTENANCE_WORK_MEM} X" != " X" ]]; then
20
+ sed -i -e" s/^.*maintenance_work_mem =.*$/maintenance_work_mem = $POSTGRES_DB_MAINTENANCE_WORK_MEM /" $PGDATA /postgresql.conf
21
+ fi
22
+
23
+ # effective_cache_size
24
+ if [[ " ${POSTGRES_DB_EFFECTIVE_CACHE_SIZE} X" != " X" ]]; then
25
+ sed -i -e" s/^.*effective_cache_size =.*$/effective_cache_size = $POSTGRES_DB_EFFECTIVE_CACHE_SIZE /" $PGDATA /postgresql.conf
7
26
fi
Original file line number Diff line number Diff line change @@ -50,4 +50,4 @@ COPY ./start.sh .
50
50
COPY ./expire-watcher.sh .
51
51
COPY ./seed-by-diffs.sh .
52
52
COPY ./tile_cache_downloader.sh .
53
- # CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh
53
+ CMD ./start.sh & ./tile_cache_downloader.sh & ./expire-watcher.sh
Original file line number Diff line number Diff line change 47
47
value : {{ .Values.tilerDb.persistenceDisk.mountPath }}
48
48
- name : POSTGRES_DB_MAX_CONNECTIONS
49
49
value : {{ default 100 .Values.tilerDb.env.POSTGRES_DB_MAX_CONNECTIONS | quote }}
50
+ - name : POSTGRES_DB_SHARED_BUFFERS
51
+ value : {{ default "128MB" .Values.tilerDb.env.POSTGRES_DB_SHARED_BUFFERS | quote }}
52
+ - name : POSTGRES_DB_WORK_MEM
53
+ value : {{ default "4MB" .Values.tilerDb.env.POSTGRES_DB_WORK_MEM | quote }}
54
+ - name : POSTGRES_DB_MAINTENANCE_WORK_MEM
55
+ value : {{ default "64MB" .Values.tilerDb.env.POSTGRES_DB_MAINTENANCE_WORK_MEM | quote }}
56
+ - name : POSTGRES_DB_EFFECTIVE_CACHE_SIZE
57
+ value : {{ default "4GB" .Values.tilerDb.env.POSTGRES_DB_EFFECTIVE_CACHE_SIZE | quote }}
50
58
- name : POD_IP
51
59
valueFrom : { fieldRef: { fieldPath: status.podIP } }
52
60
livenessProbe :
Original file line number Diff line number Diff line change @@ -259,7 +259,11 @@ tilerDb:
259
259
POSTGRES_USER : postgres
260
260
POSTGRES_PASSWORD : ' 1234'
261
261
POSTGRES_PORT : 5432
262
- POSTGRES_DB_MAX_CONNECTIONS : 500
262
+ POSTGRES_DB_MAX_CONNECTIONS : 100
263
+ POSTGRES_DB_SHARED_BUFFERS : 128MB
264
+ POSTGRES_DB_WORK_MEM : 4MB
265
+ POSTGRES_DB_MAINTENANCE_WORK_MEM : 64MB
266
+ POSTGRES_DB_EFFECTIVE_CACHE_SIZE : 4GB
263
267
persistenceDisk :
264
268
enabled : false
265
269
accessMode : ReadWriteOnce
You can’t perform that action at this time.
0 commit comments