-
spring boot를 위한 wasspring 2023. 3. 23. 18:06
was 란? web application server servlet,jsp,php등의 동적인 컨텐츠를 반환하기 위한 목적으로 사용한다.
정적 + 동적을 합쳐서 사용하게 끔 만들어진 서버이다.
이제 좀 현실의 이야기로 돌아와 실제적으로 spring, spring boot가 베이스가 외장 was인지, 내장 was인지부터 시작해보자
spring은 기본적으로 외장으로 깔아서 써야한다. 그런데 spring boot는 베이스가 내장이여서 바로 jar로 올려서 사용가능하다. 실제로 내장 톰캣과 외장 톰캣의 성능차이는 없다고 밝히기도 했다.
또한 webflux를 쓰면 nio (비동기 처리를 위한) netty 가 기본이 된다.
여기까지는 내가 아는 부분이다
하지만 다른 선택지도 분명 존재할 것이다.
undertow에 대하여
처음 궁금증을 가진건 jhipster에서 기본적으로 사용하고 있는 was라는것이다. 기존에 톰캣만 썼던 나는 이걸 보고 알음알음 찾게 되어서 성능이 좋다라는 말만 듣었다. undertow의 특이한 점은 비동기 기반에 동기, 비동기를 둘 다 지원한다는 것이다. (based netty라는 말이 있다) 아래 벤치마크 쪽에서도 설명이 나와있듯이 동시에 많은 요청이 들어오는 것에 더 좋다는 내용이 있다.
번외로 요즘 특히나 마이크로 서비스 아키텍쳐가 등장하고 서버 내부적으로 통신을 많이 하는 경우가 있는데 이럴 수록 비동기가 인기를 끄는 것 같다. 공부하면서 좀 새로운 것도 알고 세팅도 쉬운데 도전해보면 재밌을 것 같다. 써 보시라.
benchmark 글, github, spring 선택지
https://medium.com/javarevisited/undertow-may-be-better-for-springboot-than-tomcat-4741c18b1a2
Undertow May Be Better for SpringBoot than Tomcat
But in the case of high concurrency, the performance of undertow is better than Tomcat.
medium.com
https://github.com/undertow-io/undertow
GitHub - undertow-io/undertow: High performance non-blocking webserver
High performance non-blocking webserver. Contribute to undertow-io/undertow development by creating an account on GitHub.
github.com
https://docs.spring.io/spring-boot/docs/2.1.6.RELEASE/reference/html/howto-embedded-web-servers.html
78. Embedded Web Servers
Each Spring Boot web application includes an embedded web server. This feature leads to a number of how-to questions, including how to change the embedded server and how to configure the embedded server. This section answers those questions. 78.2 Disablin
docs.spring.io
'spring' 카테고리의 다른 글
spring을 이용한 MSA 구축 - spring cloud gateway - 2 (0) 2023.03.19 test 설정 - 2 github actions 설정 (0) 2023.03.10 test 설정 - 1 spring boot (0) 2023.03.09 spring을 이용한 MSA 구축 - spring cloud gateway - 1 (0) 2023.03.05 스프링 멀티모듈 및 gradle 설정 (0) 2023.02.24