Skip to content

Commit

Permalink
Add spring/embedded tomcat
Browse files Browse the repository at this point in the history
  • Loading branch information
hyh1016 committed Mar 20, 2024
1 parent a511322 commit e7aaaec
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions spring/Embedded_tomcat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Embedded Tomcat (๋‚ด์žฅ ํ†ฐ์บฃ)

## Tomcat?

- ์•„ํŒŒ์น˜ ์žฌ๋‹จ์—์„œ ๊ฐœ๋ฐœ ๋ฐ ์šด์˜ ์ค‘์ธ ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ(Servlet Container)์ด์ž WAS
- ์„œ๋ธ”๋ฆฟ ์ปจํ…Œ์ด๋„ˆ๋ž€, ์„œ๋ธ”๋ฆฟ์˜ ์ƒ๋ช…์ฃผ๊ธฐ๋ฅผ ๊ด€๋ฆฌํ•˜๋Š” ์ปจํ…Œ์ด๋„ˆ๋ฅผ ๋งํ•จ

## Spring Boot Embedded Tomcat

- ์›๋ž˜ Spring ๊ธฐ๋ฐ˜ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ `war`๋ผ๋Š” ํ™•์žฅ์ž์˜ ๋นŒ๋“œ ์‚ฐ์ถœ๋ฌผ๋กœ ๋งŒ๋“ค์–ด tomcat์„ ํ†ตํ•ด ์‹คํ–‰ํ•ด์•ผ ํ•จ
- ๊ทธ๋Ÿฐ๋ฐ spring boot ๊ธฐ๋ฐ˜์˜ ์›น ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์€ jar ์‚ฐ์ถœ๋ฌผ๋กœ๋„ ์‹คํ–‰์ด ๊ฐ€๋Šฅํ•จ
- ์ด๊ฒŒ ์–ด๋–ป๊ฒŒ ๊ฐ€๋Šฅํ• ๊นŒ? ๋ฐ”๋กœ spring boot์—๋Š” `๋‚ด์žฅ ํ†ฐ์บฃ`์ด ์กด์žฌํ•˜๊ธฐ ๋•Œ๋ฌธ
- ์•„๋ž˜๋Š” spring-boot-starter-web์˜ dependency tree. ๋‚ด์žฅ ํ†ฐ์บฃ์— ๋Œ€ํ•œ ์˜์กด์„ฑ์ด ์กด์žฌํ•จ

```java
\--- org.springframework.boot:spring-boot-starter-web -> 3.2.3
+--- org.springframework.boot:spring-boot-starter-tomcat:3.2.3
| +--- jakarta.annotation:jakarta.annotation-api:2.1.1
| +--- org.apache.tomcat.embed:tomcat-embed-core:10.1.19
```


### Default Tomcat Thread Pool ์„ค์ •

- spring boot ๊ธฐ์ค€ ๊ธฐ๋ณธ thread pool ์„ค์ •์€ ์•„๋ž˜์™€ ๊ฐ™์Œ
- max thread pool size๋Š” 200 - ์ตœ๋Œ€ 200๊ฐœ์˜ ์Šค๋ ˆ๋“œ๊ฐ€ ์ƒ์„ฑ๋จ
- core thread pool size๋Š” 10 - idle ์ƒํƒœ์ธ ๊ฒฝ์šฐ 10๊ฐœ์˜ ์Šค๋ ˆ๋“œ๊ฐ€ ์œ ์ง€๋จ
- waiting queue size๋Š” 100 - ์ตœ๋Œ€ 100๊ฐœ๊นŒ์ง€์˜ ์š”์ฒญ์ด ์Šค๋ ˆ๋“œ๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ ํ์—์„œ ๋Œ€๊ธฐ ๊ฐ€๋Šฅ
- max connection์€ 8192 - ๋™์‹œ ์ˆ˜์šฉ ๊ฐ€๋Šฅํ•œ ์š”์ฒญ์ž์˜ ์ˆ˜๋Š” 8192
- ์„œ๋ฒ„์˜ ์ŠคํŽ™, ์„œ๋น„์Šค์˜ ํŠน์„ฑ ๋“ฑ์„ ์ž˜ ๊ณ ๋ คํ•˜์—ฌ ์œ„์˜ ๊ฐ’๋“ค์„ ํŠœ๋‹ํ•  ์ˆ˜ ์žˆ์–ด์•ผ ํ•จ

0 comments on commit e7aaaec

Please sign in to comment.