블로그 이미지
윤영식
Full Stacker, Application Architecter, KnowHow Dispenser and Bike Rider

Publication

Category

Recent Post

2013. 7. 10. 18:06 Middleware, Cloud/WAS

아파치<->제이보스로 연결되어 있고 업무 애플리케이션에서 큰 파일을 업로드하면서 아파치에서는 응답없음 메세지가 화면에 나타나고, 제이보스는 계속해서 파일업로드 처리를 하여 정상 종료되었을 경우 어디를 보아야 하는지 알아보자 



1. mod_jk 설정 찾기

  - 먼저 apache에 설정된 workers.properties 파일을 찾는다

  - socket_timeout 과 reply_timeout 설정 값을 확인한다



2. socket_timeout 의미

Socket timeout in seconds used for communication channel between JK and remote host. If remote host does not respond inside that timeout the JK will generate an error, and retry again. If set to value zero (default) the JK will wait for infinite on all socket operations. 

  - 초단위로 설정

  - JK와 리모트이니 여기서는 제이보스간의 연결

  - 제이보스에서 응답이 없으면 timeout 설정값에 따라 에러가 발생함

  - 0으로 설정하면 응답 올 때까지 socket 동작이 유지됨. 권장하지 않음 (참조)



3. reply_timeout 의미

 Reply_timeout property told webserver to wait some time for reply to a forwarded request before considering the remote tomcat is dead and eventually switch to another tomcat in a cluster group. 

  - 밀리초단위로 설정

  - 리모트 서버 -여기서는 제이보스가 다운되기 전까지- 아파치가 앞선 요청에 대하여 응답을 기다리는 시간

  - 만일 제이보스가 클러스터링 되어 있고 timeout이 발생하면 Live된 곳으로 요청이 재전송됨



4. 상황 및 튜닝

  - socket_timeout 300 초, reply_timeout 60 초 이면서 파일 업로드가 180초걸릴 경우

    + 아파치에서는 60초후 응답이 없으므로 브라우져로 응답이 없다고 에러를 클라이언트에게 던진다

    + 그러나 리모트 서버쪽의 socket은 300초까지 live 이므로 파일업로드는 정상적으로 수행하게 된다 

    + 클라이언트 입장에서는 브라우져에서 에러를 뱉어내니 에러인줄 알지만 실상은 서버에 정상적으로 업로드 되었다 


  - 파일 업로드 시간이 최대 180초 걸릴 경우

    + socket_timeout = 200 , reply_timeout = 200000 

    + 즉 각 timeout 값을 180초 이상 설정한다 



<참조> 

  - workers.properties 설정하기

  - socket_timeout과 reply_timeout의 의미

  - apache timeout 에 대하여 : 파일다운로드시

  - socket_timeout과 retry count에 대하여

posted by 윤영식