카테고리 없음

자바 애플리케이션 성능 모니터링 도구 소개

흰색남자 2023. 8. 14. 14:29

[ 목적 ]

회사에서 사용하고 있는 오픈소스 라이브러리들을 익혀보자

[ JavaMelody ]

JavaMelody는 자ㅂ 기반 애플리케이션의 모니터링 및 성능 측정을 위한 도구이다. 주로 웹 애플리케이션에서 사용되며 사용자가 서버에 요청하는 거의 모든 것에 대한 정보를 볼 수 있다. 

예를들어 JDBC커넥션, 톰캣 쓰레드 풀, 메모리 사용 정보, SQL 실행 이력, SQL 에러, SLOW 쿼리, WAIT EVENT, 응답 속도, HTTP 에러, 애플리케이션 에러, 응답 시간 등 다양한 정보를 볼 수 있다.

 

[ JavaMelody - UI ]

UI 는 다소 올드하지만 시스템 운영에 필요한 정보들을 볼 수 있다. 이거랑 같이 그라파나, 컨테이너 환경이랑 같이 연동해서 사용하면 인스턴스의 운영도 같이 할 수 있을 것 같다.

 

 

 

[ JavaMelody - 환경 설정 ]

자세한 정보는 docs를 확인한다.
- https://github.com/javamelody/javamelody/wiki/UserGuide

gradle에 디펜던시를 등록한다

implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-web'

application.yml에 javamelody 설정을 등록한다.

server:
  tomcat:
    threads:
      max: 200
      min-spare: 50
    accept-count: 100
  port: 8080
spring:
  datasource:
    url: jdbc:mysql://localhost:3306/test_db?useSSL=false
    username: 
    password: 
    driver-class-name: com.mysql.cj.jdbc.Driver
  jpa:
    hibernate:
      ddl-auto: update
      show-sql: true
      properties:
        hibernate:
          dialect: org.hibernate.dialect.MySQL5Dialect
javamelody:
  enabled: true
  monitoring-path: /monitoring
  anonymous-access-allowed: true