hotfix: 운영 DB 서버의 커넥션 누수 문제 해결 #239
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
User description
#️⃣ 이슈
none
🔎 작업 내용
현재 운영 서버에 연결된 PSQL 서버의 커넥션이 가득차는 문제가 발생.
과거 hikariCP의 maximum-pool-size를 PSQL의 최대 커넥션 크기를 넘지 않도록 수정했음.
그러나 DB 작업 후, 유휴 커넥션이 그대로 남아있는 문제가 발생.
따라서 Connection Pool의 유휴 시간과 최대 생명주기 시간을 설정하여 커넥션 누수가 발생하지 않도록 해결.
🤔 고민해볼 부분 & 코드 리뷰 희망사항
🧲 참고 자료 및 공유 사항
추후 트러블 슈팅 문서 첨부 예정
PR Type
Bug fix
Description
Fixes a connection leak issue in the production database server.
Configures HikariCP connection pool settings:
leak-detection-thresholdto 300000ms (5 minutes).connection-timeoutto 300000ms (5 minutes).max-lifetimeto 1800000ms (30 minutes).Disables
show_sqlproperty.Diagram Walkthrough
flowchart LR A["application.properties"] --> B("HikariCP Configuration"); B -- "Set leak-detection-threshold" --> C("300000ms"); B -- "Set connection-timeout" --> D("300000ms"); B -- "Set max-lifetime" --> E("1800000ms"); A --> F("Disable show_sql");File Walkthrough
application.properties
Configured HikariCP and disabled show_sql propertyserver/src/main/resources/application.properties
leaks by setting
leak-detection-threshold,connection-timeout, andmax-lifetime.show_sqlproperty to reduce logging overhead.