diff --git a/apps/smartdoc/conf.py b/apps/smartdoc/conf.py index 054c5d832..8d2248bca 100644 --- a/apps/smartdoc/conf.py +++ b/apps/smartdoc/conf.py @@ -111,7 +111,7 @@ class Config(dict): "ENGINE": self.get('DB_ENGINE'), "POOL_OPTIONS": { "POOL_SIZE": 20, - "MAX_OVERFLOW": 80 + "MAX_OVERFLOW": self.get('DB_MAX_OVERFLOW') } } diff --git a/installer/Dockerfile b/installer/Dockerfile index 33b5349ce..bd460bf8a 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -40,6 +40,7 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C MAXKB_DB_PORT=5432 \ MAXKB_DB_USER=root \ MAXKB_DB_PASSWORD=Password123@postgres \ + MAXKB_DB_MAX_OVERFLOW=80 \ MAXKB_EMBEDDING_MODEL_NAME=/opt/maxkb/model/embedding/shibing624_text2vec-base-chinese \ MAXKB_EMBEDDING_MODEL_PATH=/opt/maxkb/model/embedding \ MAXKB_SANDBOX=1 \ @@ -47,6 +48,7 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C PATH=/opt/py3/bin:$PATH \ POSTGRES_USER=root \ POSTGRES_PASSWORD=Password123@postgres \ + POSTGRES_MAX_CONNECTIONS=1000 \ PIP_TARGET=/opt/maxkb/app/sandbox/python-packages \ PYTHONPATH=/opt/maxkb/app/sandbox/python-packages \ PYTHONUNBUFFERED=1 diff --git a/installer/run-maxkb.sh b/installer/run-maxkb.sh index 43374dfb6..238875e06 100644 --- a/installer/run-maxkb.sh +++ b/installer/run-maxkb.sh @@ -1,7 +1,7 @@ #!/bin/bash rm -f /opt/maxkb/app/tmp/*.pid # Start postgresql -docker-entrypoint.sh postgres & +docker-entrypoint.sh postgres -c max_connections=${POSTGRES_MAX_CONNECTIONS} & sleep 10 # Wait postgresql until pg_isready --host=127.0.0.1; do sleep 1 && echo "waiting for postgres"; done