-
Notifications
You must be signed in to change notification settings - Fork 388
[4 단계 Tomcat 구현하기] 짱수(장혁수) 미션 제출합니다. #727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
caae46a
fed02f6
7e91356
04921cb
a7f5de9
17dbf54
b9d506e
8b282f7
465fa4a
85c117e
b1ce6e7
01b3a00
f48b05d
36a521e
8a7ef8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
|
|
||
| public class Http11Processor implements Runnable, Processor { | ||
|
|
||
| private static final Logger log = LoggerFactory.getLogger(Http11Processor.class); | ||
| private static final Logger log = LoggerFactory.getLogger("ConsoleTraceLogger"); | ||
| private final ServletContainer servletContainer; | ||
| private final Socket connection; | ||
|
|
||
|
|
@@ -39,7 +39,7 @@ public void process(Socket connection) { | |
| var outputStream = connection.getOutputStream()) { | ||
|
|
||
| HttpRequest httpRequest = HttpRequest.readFrom(requestBufferedReader); | ||
| log.info("request : {}", httpRequest); | ||
| log.trace("request : {}", httpRequest); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오 trace로 변경했네요! 제가 궁금한건데, 그러면 혹시 이제 request는 어떻게 볼 수 있나요?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. trace 레벨의 request 를 보기 위해선 logback 설정을 변경해 주어야 해요. |
||
| HttpResponse httpResponse = new HttpResponse(httpRequest); | ||
|
|
||
| service(httpRequest, httpResponse); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 해당 코드에 리뷰하는 것은 아니고 Http11Processor의 58번째줄 리뷰입니다! Cache-Control 붙인 이유가 궁금합니다! 각 no-cahe와 private은 무슨 역할을 하고 있나요? 짱수 덕분에 저도 공부하고 갑니다!
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이게 로그인이 된 경우에 자꾸 |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <configuration scan="true" scanPeriod="30 seconds"> | ||
| <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | ||
| <encoder> | ||
| <Pattern>%d{HH:mm} %-5level %logger{36} - %msg%n</Pattern> | ||
| </encoder> | ||
| </appender> | ||
|
|
||
| <root level="trace"> | ||
| <appender-ref ref="CONSOLE"/> | ||
| </root> | ||
| </configuration> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
각 accept-count, max-connections, min-spare, max는 무엇을 의미할까요!?
기존에 max-connections: 1 일때는 왜 테스트가 성공하지 않았을까요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
max-connections: 톰캣이 처리할 수 있는 연결의 최대 개수accept-count:max-connections만큼의 연결을 처리하고 있을 때 대기할 수 있는 최대 요청의 개수thread.max: 스레드풀에서 사용할 최대 스레드 개수thread.min-spare: 스레드에서 유지할 활성 스레드의 최소 개수FixedThreadPool을 쓸 건데 의미가 있는 값인가.. 하는 생각이 듭니다.+) 최종적으로
accept-count+max-connections만큼의 TCP 연결이 가능하고, 그 이상의 TCP 연결 요청에 대해선 time out 이 발생하겠네용There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
스레드풀이라도 스레드는 생성과 소멸이 존재합니다. 그렇기에 min-spare가 존재하고 중요한 역할을 한다고 생각합니다. 적어도 소멸하지 않고 계속 재사용되는 스레드의 개수니까요!