Skip to content

Commit

Permalink
hotfix: DB Connection Pool 프로덕션 인스턴스에 맞게 설정 변경 & 프로덕션 쿼리 로깅 OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
Lim-Changi committed Feb 5, 2025
1 parent ef9ce49 commit 27956dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
6 changes: 6 additions & 0 deletions src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ spring:
url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC;
username: ${DB_USERNAME}
password: ${DB_PASSWORD}
hikari:
maximum-pool-size: 5
minimum-idle: 2
idle-timeout: 300000
connection-timeout: 20000
max-lifetime: 1200000

jpa:
hibernate:
Expand Down
13 changes: 9 additions & 4 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ spring:
url: jdbc:postgresql://${DB_HOST}:${DB_PORT}/${DB_DATABASE}?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC;
username: ${DB_USERNAME}
password: ${DB_PASSWORD}

hikari: # t3.micro 환경에 맞게 hikari pool 설정
maximum-pool-size: 5 # vCPU * 2 + 1 = 5
minimum-idle: 2 # 최소한의 idle 커넥션만 유지
idle-timeout: 300000 # 5분 (기본값 10분에서 줄임)
connection-timeout: 20000 # 20초
max-lifetime: 1200000 # 20분 (기본값 30분에서 줄임)
jpa:
hibernate:
ddl-auto: none
Expand All @@ -16,9 +21,9 @@ spring:

properties:
hibernate:
show_sql: true
format_sql: true
use_sql_comments: true
show_sql: false # Production 환경에서 로깅 OFF
format_sql: false
use_sql_comments: false
default_schema: public

springdoc:
Expand Down

0 comments on commit 27956dd

Please sign in to comment.