Skip to content

BrAPI Server DB connections exhausted on biapi startup caching #3

@sb2597

Description

@sb2597

Full Details can be found at: https://breedinginsight.atlassian.net/browse/BI-2450

When attempting to start biapi after clearing all keys from redis cache, brapi server gets overwhelmed due to large volume of requests coming in to cache all data. Database connections are exhausted and data requests fail with ApiExceptions 500 errors from brapi server.

This is applicable to systems that have a lot of data stored in the brapi server, in this case, rel-test but would likely also apply to other systems including production.

Per Matthew, we could increase the brapi-server's connection pool size by configuring it in the application.properties like this:

# Hikari Pool Configuration
spring.datasource.hikari.maximum-pool-size=50
spring.datasource.hikari.connection-timeout=30000

but from what I've read, increasing the connection pool size isn't a great solution, it would be better to troubleshoot and eliminate whatever transactions are taking 30 seconds plus to run.

Acceptance Criteria

GIVEN a deployment with data volume equivalent to to current rel-test brapi server
WHEN the redis cache keys are cleared and bi-api is restarted
THEN the redis cache should be populated without error on bi-api startup as verified by biapi and brapi server logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions