Skip to content

Commit

Permalink
perf: add POSTGRES_MAX_CONNECTIONS env.
Browse files Browse the repository at this point in the history
  • Loading branch information
liqiang-fit2cloud committed Dec 27, 2024
1 parent 68897b9 commit a0b03d3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/smartdoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def get_db_setting(self) -> dict:
"ENGINE": self.get('DB_ENGINE'),
"POOL_OPTIONS": {
"POOL_SIZE": 20,
"MAX_OVERFLOW": 80
"MAX_OVERFLOW": self.get('DB_MAX_OVERFLOW')
}
}

Expand Down
2 changes: 2 additions & 0 deletions installer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ 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 \
LANG=en_US.UTF-8 \
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
Expand Down
2 changes: 1 addition & 1 deletion installer/run-maxkb.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a0b03d3

Please sign in to comment.