Skip to content

Commit a0b03d3

Browse files
perf: add POSTGRES_MAX_CONNECTIONS env.
1 parent 68897b9 commit a0b03d3

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

apps/smartdoc/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def get_db_setting(self) -> dict:
111111
"ENGINE": self.get('DB_ENGINE'),
112112
"POOL_OPTIONS": {
113113
"POOL_SIZE": 20,
114-
"MAX_OVERFLOW": 80
114+
"MAX_OVERFLOW": self.get('DB_MAX_OVERFLOW')
115115
}
116116
}
117117

installer/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C
4040
MAXKB_DB_PORT=5432 \
4141
MAXKB_DB_USER=root \
4242
MAXKB_DB_PASSWORD=Password123@postgres \
43+
MAXKB_DB_MAX_OVERFLOW=80 \
4344
MAXKB_EMBEDDING_MODEL_NAME=/opt/maxkb/model/embedding/shibing624_text2vec-base-chinese \
4445
MAXKB_EMBEDDING_MODEL_PATH=/opt/maxkb/model/embedding \
4546
MAXKB_SANDBOX=1 \
4647
LANG=en_US.UTF-8 \
4748
PATH=/opt/py3/bin:$PATH \
4849
POSTGRES_USER=root \
4950
POSTGRES_PASSWORD=Password123@postgres \
51+
POSTGRES_MAX_CONNECTIONS=1000 \
5052
PIP_TARGET=/opt/maxkb/app/sandbox/python-packages \
5153
PYTHONPATH=/opt/maxkb/app/sandbox/python-packages \
5254
PYTHONUNBUFFERED=1

installer/run-maxkb.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
rm -f /opt/maxkb/app/tmp/*.pid
33
# Start postgresql
4-
docker-entrypoint.sh postgres &
4+
docker-entrypoint.sh postgres -c max_connections=${POSTGRES_MAX_CONNECTIONS} &
55
sleep 10
66
# Wait postgresql
77
until pg_isready --host=127.0.0.1; do sleep 1 && echo "waiting for postgres"; done

0 commit comments

Comments
 (0)