Spring

Undertow

꿀승 2025. 1. 2. 13:23
728x90
반응형
SMALL

Undertow vs Tomcat

특징 Undertow Tomcat
성능 고성능, 비동기적 처리로 높은 동시성 지원 상대적으로 덜 효율적, 동기식 처리 방식
설정 및 사용 용이성 간단하고 모듈화된 설정 많은 설정 옵션, 설정이 복잡할 수 있음
비동기 처리 비동기 처리 기본 지원, I/O 작업에 강점 비동기 서블릿 지원(8버전 이상), 상대적으로 덜 효율적
확장성 매우 모듈화되어 있어 필요한 기능만 추가 가능 안정적이나 대규모 트래픽 처리에는 더 무겁고 복잡함
기능 및 지원 HTTP, WebSocket, HTTP/2 등 지원, 플러그인 방식으로 기능 확장 Servlet, JSP, WebSocket 등 전통적인 기능 지원
사용 사례 마이크로서비스, RESTful API 서버, 경량화된 환경 전통적인 웹 애플리케이션, 엔터프라이즈 환경
커뮤니티 및 문서 상대적으로 작은 커뮤니티, WildFly와 통합 사용 방대한 커뮤니티와 문서, 튜토리얼 풍부

Undertow 의존성 추가

implementation('org.springframework.boot:spring-boot-starter-web') {
        //기본 내장 Tomcat 제외
        exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
    }
    //undertow 추가
    implementation 'org.springframework.boot:spring-boot-starter-undertow'

Undertow 설정 (application.yml)


server:
  port: 8080
  undertow:
    io-threads: 4  //io 쓰레드 개수 설정
    worker-threads: 20 //워커 쓰레드 개수 설정
    buffer-size: 1024 //버퍼크기를 바이트 단위로 설정
    direct-buffers: true //JVM힙메모리가 아닌 네이티브 메모리에 할당되는 버퍼
728x90
반응형
LIST

'Spring' 카테고리의 다른 글

MapStruct  (0) 2025.01.02
Flyway  (1) 2025.01.02
Spring Security 내부 필터  (1) 2024.10.24
Spring Security 내부 흐름  (0) 2024.10.22
Querydsl 기본 사용법  (2) 2024.09.30