From eba93d7df8865f171c78780c1f60a61a2f35d3d5 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Tue, 27 Feb 2024 14:45:34 -0800 Subject: [PATCH] chore(ci): set min and max db (oracle) connections --- .github/workflows/pr-open.yml | 3 ++- backend/openshift.deploy.yml | 10 ++++++++++ backend/src/main/resources/application.properties | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index 0cb267cd..a8fc8941 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -102,8 +102,9 @@ jobs: file: backend/openshift.deploy.yml verification_path: /actuator/health parameters: - -p MIN_REPLICAS=1 -p MAX_REPLICAS=1 + -p MIN_REPLICAS=1 + -p DB_POOL_MAX_SIZE=1 -p AWS_COGNITO_ISSUER_URI=https://cognito-idp.${{ vars.AWS_REGION }}.amazonaws.com/${{ vars.VITE_USER_POOLS_ID }} - name: frontend file: frontend/openshift.deploy.yml diff --git a/backend/openshift.deploy.yml b/backend/openshift.deploy.yml index 0afee6da..ae44b0ec 100644 --- a/backend/openshift.deploy.yml +++ b/backend/openshift.deploy.yml @@ -44,6 +44,12 @@ parameters: - name: DB_POOL_MAX_LIFETIME description: Maximum lifetime of a connection in the pool. value: "1800000" + - name: DB_POOL_MAX_SIZE + description: Maximum number of connections per pod + value: "3" + - name: DB_POOL_MIN_IDLE + description: Minimum number of connections per pod + value: "1" - name: RESULTS_ENV_OPENSEARCH description: Environment name for OpenSearch. # One of: development, test, production required: true @@ -122,6 +128,10 @@ objects: value: ${DB_POOL_CONN_TIMEOUT} - name: DB_POOL_IDLE_TIMEOUT value: ${DB_POOL_IDLE_TIMEOUT} + - name: DB_POOL_MAX_SIZE + value: ${DB_POOL_MAX_SIZE} + - name: DB_POOL_MIN_IDLE + value: ${DB_POOL_MIN_IDLE} - name: DB_POOL_MAX_LIFETIME value: ${DB_POOL_MAX_LIFETIME} - name: RESULTS_ENV_OPENSEARCH diff --git a/backend/src/main/resources/application.properties b/backend/src/main/resources/application.properties index 96bd9c11..7d00a6d6 100644 --- a/backend/src/main/resources/application.properties +++ b/backend/src/main/resources/application.properties @@ -28,8 +28,8 @@ spring.datasource.hikari.idleTimeout = ${DB_POOL_IDLE_TIMEOUT:45000} spring.datasource.hikari.maxLifetime = ${DB_POOL_MAX_LIFETIME:30000} spring.datasource.hikari.keepaliveTime = 30000 spring.datasource.hikari.poolName = NrResultsDbPool -spring.datasource.hikari.minimumIdle = 1 -spring.datasource.hikari.maximumPoolSize = 3 +spring.datasource.hikari.minimumIdle = ${DB_POOL_MIN_IDLE:1} +spring.datasource.hikari.maximumPoolSize = ${DB_POOL_MAX_SIZE:3} spring.jpa.database-platform = org.hibernate.dialect.OracleDialect spring.jpa.show-sql = true