티스토리 뷰

DB 설정과 관련해서 많은 속성들이 있는데 기본값은 무엇이며 어떻게 설정할지에 대해 잘 정리된 글이 있어 가져왔습니다. 

아래 링크에 가셔서 내용 확인하시고 dasource 구성하실 때 참고하시면 큰 도움이 될거 같습니다. 

 

출처 : https://github.com/brettwooldridge/HikariCP/wiki/MySQL-Configuration

 

MySQL 최상의 성능을 위한 설정 

prepStmtCache
MySQL 드라이버가 연결당 캐시할 준비된 명령문의 수. 기본값은 25.
이 값을 250-500 사이로 설정하는 것이 좋습니다.

prepStmtCacheSqlLimit
드라이버가 캐시할 준비된 SQL 문의 최대 길이로 기본값은 256입니다.

Hibernate와 같은 ORM 프레임워크에서 기본값은 생성된 명령문 길이의 임계값보다 훨씬 낮습니다. 권장 설정은 2048입니다.

cachePrepStmts
캐시가 기본적으로 비활성화되어 있는 경우 위의 매개변수 중 어느 것도 영향을 미치지 않습니다. 이 매개변수를 true로 설정해야 합니다.

useServerPrepStmts

최신 버전의 MySQL은 서버 측 준비 명령문을 지원하므로 상당한 성능 향상을 제공할 수 있습니다. 이 속성을 true로 설정합니다.

HikariCP의 일반적인 MySQL 구성은 다음과 같습니다.

jdbcUrl=jdbc:mysql://localhost:3306/simpsons
username=test
password=test
dataSource.cachePrepStmts=true
dataSource.prepStmtCacheSize=250
dataSource.prepStmtCacheSqlLimit=2048
dataSource.useServerPrepStmts=true
dataSource.useLocalSessionState=true
dataSource.rewriteBatchedStatements=true
dataSource.cacheResultSetMetadata=true
dataSource.cacheServerConfiguration=true
dataSource.elideSetAutoCommits=true
dataSource.maintainTimeStats=false

See Also

If you are using MySQL, you really need to read this slide-stack

댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/04   »
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
글 보관함