Repository navigation
chore: 운영 SQL 로그를 끄고 메모리·종료 설정을 측정 기준으로 조정한다 - #145
Merged
Merged
Conversation
- show-sql 기본값을 false로(JPA_SHOW_SQL로 로컬에서 켤 수 있음). 운영 로그에 모든 쿼리가 찍히고 있었다. - Tomcat 최대 스레드 200 -> 50, JVM은 C1 전용 JIT·코드 캐시 32m·스택 512k·힙 40%로. 300MiB 한도에서 부하 중 NMT committed 합계가 약 373MiB -> 333MiB로 줄었다. Metaspace 사용이 약 120MiB라 상한 160m은 유지한다. - 종료 시 요청(20초)과 큐의 비동기 메일(20초)을 기다리고, deploy.yml의 docker stop 대기를 기본 10초에서 45초로 늘려 graceful shutdown이 강제 종료되지 않게 한다.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 7 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
로그인(BCrypt cost 12) 응답 중앙값이 322ms에서 397ms로 약 23% 느려졌다. 메모리 절감은 대부분 스레드 수 축소에서 나오므로 나머지 플래그는 유지한다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
요약
application.yml이 유일한 설정 파일인데show-sql: true라 운영 로그에 모든 쿼리가 찍혔다. 기본false, 로컬에서는JPA_SHOW_SQL=true.docker stop기본 대기 10초가 Spring graceful shutdown(기본 30초)보다 짧아, 처리 중인 요청과@Async메일 큐가 강제 종료로 잘렸다.메모리 측정
eclipse-temurin:21-jdk+--memory=300m+ Dockerfile과 같은 플래그 + NMT로 앱을 띄우고, 동시 150개로 공개 API·로그인 요청 18,000건을 보낸 뒤 측정했다(로컬 x86·WSL(스왑 있음), 운영은 arm64라 수치는 근사).-XX:MaxRAMPercentage=40(45),-Xss512k,-XX:ReservedCodeCacheSize=32m(48m).160m은 줄이지 않았다(줄이면 기동 직후 OOM 종료 위험).-XX:TieredStopAtLevel=1)도 시험했지만, 로그인(BCrypt cost 12) 응답 중앙값이 322ms → 397ms(약 23%)로 느려져 넣지 않았다.--memory=300m)를 올릴지는 서버 여유를 보고 따로 정해야 한다. 이 PR은 한도를 바꾸지 않는다.종료
spring.lifecycle.timeout-per-shutdown-phase: 20s,spring.task.execution.shutdown.await-termination: true(20초).deploy.yml:docker stop -t 45.Commencing graceful shutdown→Graceful shutdown complete확인. SQL 로그가 찍히지 않는 것도 확인.테스트
./gradlew test: 532건 중 531 통과, 1 스킵.-Xss512k로 한 번 더 돌려 스택 오버플로가 없음을 확인.