Spring/MVC1-웹 어플리케이션 이해
-
멀티 쓰레드Spring/MVC1-웹 어플리케이션 이해 2023. 6. 7. 00:06
쓰레드란, 프로세스(process) 내에서 실제로 작업을 수행하는 주체를 말한다. 이러한 쓰레드의 특징으로는, 코드를 순차적으로 실행한다 자바는 기본적으로 main(main 메소드) 이라는 이름의 쓰레드가 실행 코드를 한줄 한줄 읽어 나가기 때문에, 동시에 처리해야하는 상황이 생긴다면, 별도의 쓰레드를 추가로 생성해야함 위의 그림처럼, 하나의 쓰레드는 하나의 요청을 받아서 처리할 수 있다. 하지만, 1. 여러 요청이 들어오고, 2. 앞의 요청의 처리가 지연되고 있다면, 서버에서는 TIMEOUT이 발생하여 쓰레드가 다운되어 버린다. 위에서 다중 요청이 들어왔을 때, 2가지 방법이 존재한다. 방법1. 요청 마다 쓰레드 생성하기 장단점 장점 요청마다 쓰레드를 생성하기 때문에 동시요청 처리 가능! CPU, 메모..
-
서블릿(Servlet)Spring/MVC1-웹 어플리케이션 이해 2023. 6. 6. 23:39
우리가 흔히 알고 있듯이 HTML에서 Form 데이터의 전송이 서버로 일어나게 되면, 다음의 과정이 필요하다 1. Form 데이터 전송(POST) 2. 웹 브라우저가 생성한 요청 HTTP 메세지 이렇게 전달이 되면, 서버에서는 다양한 일들이 일어난다. 서버 연결 대기 및 소켓 연결 HTTP 요청 메세지에 대한 파싱 작업 메소드에 따른 HEADER 정보 파악 전달받은 Form 데이터 파싱 . . . HTTP 응답에 대한 메세지 생성 시작 TCP/IP에 응답 전달, 소켓 종료 이때, 서블릿을 지원하는 WAS에서는, 비지니스 로직을 실행하고, 데이터베이스에 POST(저장 일 경우) 요청에 대한 처리를 하는 것을 제외한 모든 일들을 Servlet이 담당해준다. 서블릿의 특징 특정 url 요청이 들어오면 해당 S..
-
웹서버 vs 웹 어플리케이션 서버Spring/MVC1-웹 어플리케이션 이해 2023. 6. 6. 22:48
모든 웹어플리케이션은 HTTP 프로토콜을 기반으로 이뤄진다. 이유는 , 대부부은의 형태의 데이터가 HTTP를 기반으로 전송이 가능하기 때문이다. 여기서 우리는 Wab Server 와 Web Application Server(WAS)를 구분할 필요가 있다. Web Server란 HTTP를 기반으로 동작하며, 보통 정적인 리소스를 제공하는 것을 말한다. 여기서 정적 리소스란, 이미 만들어진 HTML파일, CSS, JS, 영상, 이미지 등을 말한다. 이러한 리소스는 단순히 클라이언트의 요청이 들어왔을 때, 가지고 있는 데이터를 보내주기만 하면 끝인 경우이다. 정확하게 Web Server와 Web Application Server를 나누는 기준은 아니지만, 대개 이 둘을 나눌 때는 정적인 리소스를 내보내는 것이..