Skip to content

Commit

Permalink
refactor: tomcat thread 50 그리고 hikari pool 75 (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
minsang-alt authored Nov 18, 2024
1 parent 6547538 commit 4b73aeb
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import dynamicquad.agilehub.issue.repository.ProjectIssueSequenceRepository;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
Expand All @@ -12,7 +13,7 @@ public class IssueNumberGenerator {

private final ProjectIssueSequenceRepository issueSequenceRepository;

@Transactional
@Transactional(propagation = Propagation.REQUIRES_NEW)
public String generate(String projectKey) {
ProjectIssueSequence sequence = issueSequenceRepository.findByProjectKey(projectKey)
.orElseThrow(() -> new IllegalArgumentException("ProjectIssueSequence not found"));
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,7 @@ logging:
org.hibernate.SQL: debug
root: info
org.hibernate.orm.jdbc.bind: trace
com.zaxxer.hikari: debug
com.zaxxer.hikari.HikariConfig: debug
com.zaxxer.hikari.HikariPool: debug
com.zaxxer.hikari.pool.PoolBase: DEBUG
11 changes: 0 additions & 11 deletions src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ spring:
password: ${MYSQL_PASSWORD}
driver-class-name: com.mysql.cj.jdbc.Driver


hikari:
# 풀 사이즈 설정
maximum-pool-size: 50 # VUser 20 기준, 톰캣 스레드(200)의 1/10
minimum-idle: 20 # 응답속도가 중요한 시스템이므로 maximum과 동일하게

# 시간 관련 설정
max-lifetime: 50000 # 50초, DB wait_timeout보다 작게
connection-timeout: 3000 # 3초, 빠른 응답이 필요한 API
validation-timeout: 1000 # 1초, connection-timeout보다 작게

sql:
init:
mode: never
Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,19 @@ spring:
max-request-size: 100MB
file-size-threshold: 0B
enabled: true
server:
tomcat:
max-threads: 50
min-spare-threads: 25
hikari:
# 풀 사이즈 설정
maximum-pool-size: 75
minimum-idle: 75

# 시간 관련 설정
max-lifetime: 50000 # 50초, DB wait_timeout보다 작게
connection-timeout: 3000 # 3초, 빠른 응답이 필요한 API
validation-timeout: 1000 # 1초, connection-timeout보다 작게

springdoc:
swagger-ui:
Expand Down

0 comments on commit 4b73aeb

Please sign in to comment.