Skip to content

Commit

Permalink
SS-1089 Add connection pooling (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
hamzaimran08 authored Sep 16, 2024
1 parent 20c2929 commit 7076f61
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
9 changes: 8 additions & 1 deletion serve/templates/studio-settings-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,14 @@ data:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
"ENGINE": "django.db.backends.postgresql",
"OPTIONS": {
"pool": {
"min_size": {{ .Values.studio.connectionPool.minSize | default 2 }},
"max_size": {{ .Values.studio.connectionPool.maxSize | default 4 }},
"timeout": {{ .Values.studio.connectionPool.timeout | default 10 }},
}
},
'NAME': '{{ .Values.postgresql.global.postgresql.auth.database }}',
'USER': '{{ .Values.postgresql.global.postgresql.auth.username }}',
'PASSWORD': os.environ.get('POSTGRES_PASSWORD'),
Expand Down
7 changes: 7 additions & 0 deletions serve/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ studio:
enabled: false
fields:
- ''
connectionPool:
minSize: 2
maxSize: 4
timeout: 10

#kubernetes config
kubeconfig: ""
Expand Down Expand Up @@ -191,6 +195,9 @@ postgresql:
service:
ports:
postgresql: 5432
extraEnvVars:
- name: POSTGRESQL_MAX_CONNECTIONS
value: "300"
persistence:
enabled: true
size: "10Gi"
Expand Down

0 comments on commit 7076f61

Please sign in to comment.