티스토리 뷰
반응형
    
    
    
  
Spring Boot Connection Pool 설정
Spring boot 기본 connection pool이 spring boot 2.0.0버전부터 hikariCP로 변경되었고
Spring boot 2.0.0 이상버전에서 hikariCP를 TomcatJDBC Connection Pool 로 변경하는 방법
성능상으로 hikariCP가 다른 DBCP보다 성능은 좋지만 혹시 변경할 일이 있을 경우를 대비해 포스팅
Spring boot 초기세팅(hikaraCP)
Pom.xml
| 1 2 3 4 5 6 7 8 9 10 |         <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-data-jpa</artifactId>         </dependency>         <dependency>         <dependency>             <groupId>mysql</groupId>             <artifactId>mysql-connector-java</artifactId>             <scope>runtime</scope>         </dependency> | cs | 
applicatoin.properties
| 1 2 3 4 5 6 7 8 9 10 11 12 | #mysql spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.url=jdbc:mysql://localhost:3306/dev?useSSL=false&allowPublicKeyRetrieval=true spring.datasource.username=usrname spring.datasource.password=pwd spring.jpa.show-sql=true spring.jpa.properties.hibernate.format_sql=true spring.jpa.properties.hibernate.show_sql=true spring.jpa.hibernate.ddl-auto=none logging.level.com=DEBUG | cs | 
실행시 로그레벨을 dubug로하여 확인해보면 default 인 hakiraCP로 연결이 된다.

1. Pom.xml dependency 변경
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |         <dependency>             <groupId>org.springframework.boot</groupId>             <artifactId>spring-boot-starter-data-jpa</artifactId>             <exclusions>                 <exclusion>                     <groupId>com.zaxxer</groupId>                     <artifactId>HikariCP</artifactId>                 </exclusion>             </exclusions>         </dependency>         <dependency>             <groupId>org.apache.tomcat</groupId>             <artifactId>tomcat-jdbc</artifactId>             <version>10.0.16</version>         </dependency> | cs | 
2.application.properties tomcat connection 설정 추가
| 1 2 3 4 5 6 7 | #tomcat connection pool setting spring.datasource.tomcat.initial-size=15  spring.datasource.tomcat.max-wait=20000  spring.datasource.tomcat.max-active=50  spring.datasource.tomcat.max-idle=15  spring.datasource.tomcat.min-idle=8  spring.datasource.tomcat.default-auto-commit=true | cs | 

반응형
    
    
    
  'Spring' 카테고리의 다른 글
| Srping Boot Quartz DB Cluster,Log 구현 (0) | 2023.01.18 | 
|---|---|
| Spring Boot zip END header not found (0) | 2022.11.02 | 
| Spring boot + JPA (1) (0) | 2022.09.26 | 
| Spring Data Redis 로 Redis 연동 (0) | 2022.09.20 | 
| Intellij Spring boot Jmx RMI remote objects have benn exported (0) | 2022.09.13 | 
반응형
    
    
    
  
                      공지사항
                      
                  
                
                  
                  
                    최근에 올라온 글
                    
                
                  
                  
                    최근에 달린 댓글
                    
                
                  
                  - Total
- Today
- Yesterday
                    링크
                    
                
                  
                  
                    TAG
                    
                
                  
                  - oubox pattern
- 배치 관리 ui
- quartz spring batch
- cursor ai crud
- kafka srping event
- cursor ai 프롬프트
- kafka redis
- cursor ai 프로젝트
- cursor ai
- kafka oubox
- CompositeItemWriter
- custom Item writer
- 잡 스케줄링
- cursorAI
- actuator prometheus grafana
- JdbcBatchItem
- SpringBatch 5.1.1
- no `meta.properties` found in
- Enum ==
- tomcat gzip
- Spring boot Actuator
- spring boot jpa
- Enum Equals ==
- quartz 실무 적용
- spring boot jpa crud
- Spring Actuator
- Enum equals
- 배치 모니터링
- 스케줄링 시스템
- spring security
| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 | 
| 9 | 10 | 11 | 12 | 13 | 14 | 15 | 
| 16 | 17 | 18 | 19 | 20 | 21 | 22 | 
| 23 | 24 | 25 | 26 | 27 | 28 | 29 | 
| 30 | 
                    글 보관함
                    
                
            