이 페이지의 이전 버전을 보고 있습니다. 현재 버전 보기.

현재와 비교 페이지 이력 보기

« 이전 버전 5 다음 »

Read the following to regist, edit or delete the MagicINFO Server service.

Regist / Delete  the service


You can specify options additionally or change options that will be applied by default when running the service of MagicINFO Server.

And it can be applied by deleting from and registering to Windows service.

For example, in case jvm is out of memory, you can change the size of heap memory or perm memory.

How to change the option


File path : {The path installed the MagicINFO Server}\tomcat\bin\service.bat


After opening the file with a text editor, move the page down and check the command under :installed. (Refer the below image)

You can specify or change the options that will be executed when the service is registed and started.

For the related options, refer the configuration of daemon execution.

The list of options : https://commons.apache.org/proper/commons-daemon/procrun.html


After modifying(adding/editing/deleting) the options related to daemon configuraion, stop, delete and restart the registed service.

Execute in order : Stop the service → Delete the service → Install the service → Restart the service


TypeCommand
Delete serviceservice uninstall 
Install serviceservice install




tomcat server.xml settings


You can modify the settings that required for executing the web service when running tomcat.

After opening below file with a text editor, modify the options that you need and save, and restart MagicInfoPremium service to take effect.

File path : {The path installed the MagicINFO Server}\tomcat\conf\server.xml


The descriptions of existing options

optiondescription
port

Specify a port number that the connector operates on.

If the port is already in use, then you can change the port number to use.

maxHttpHeaderSize

If there is a lot of information in the HTTP Header, it needs to be modified according to the characteristics of the service. (The default value is 4KB)

maxThreads

사실상 이 옵션이 가장 중요한 옵션이 아닌가 싶다. 톰캣내의 쓰레드 수를 결정 하는 옵션이다. 쓰레드수는 실제 Active User 수를 뜻한다. 즉 순간 처리 가능한 Transaction 수를 의미한다.

일반적으로 100 내외가 가장 적절하고, 트렌젝션의 무게에 따라 50~500 개 정도로 설정하는 게 일반적이다. 이 값은 성능 테스트를 통해서 튜닝을 하면서 조정해 나가는 것이 좋다.

acceptCount

이 옵션은 request Queue의 길이를 정의한다. HTTP request가 들어왔을때, idle thread가 없으면 queue에서 idle thread가 생길때 까지 요청을 대기하는 queue의 길이이다. 보통 queue에 메세지가 쌓였다는 것은 해당 톰캣 인스턴스에 처리할 수 있는 쓰레드가 없다는 이야기이고, 모든 쓰레드를 사용해도 요청을 처리를 못한다는 것은 이미 장애 상태일 가능성이 높다.

그래서 큐의 길이를 길게 주는 것 보다는, 짧게 줘서, 요청을 처리할 수 없는 상황이면 빨리 에러 코드를 클라이언트에게 보내서 에러처리를 하도록 하는 것이 좋다. Queue의 길이가 길면, 대기 하는 시간이 길어지기 때문에 장애 상황에서도 계속 응답을 대기를 하다가 다른 장애로 전파 되는 경우가 있다.

maxPostSize 

tomcat을 사용시 post 로 너무 많은 데이터를 전송하게 되면 request 데이터가 초기화(null) 되는 현상이 발생한다.  post 방식으로 form 데이터를 전송할 시 form 데이터의 크기가 default 값인 2M를 초과할 시에는 별도로 설정을 해주어야 한다.

secure

SSLEnabled

sslProtocol

sslEnabledProtocols

ssl 설정 관련 옵션이다.

자세한 사항은 ssl 설명을 참고할 수 있다.

1.7 SSL/TLS 설정 가이드


더 다양한 옵션을 확인하고 싶으면 tomcat 공식 사이트에서 참고할 수 있다.

설치된 tomcat version에 맞게 설정해야 한다.

사이트 주소 : https://tomcat.apache.org/tomcat-8.0-doc/config/http.html



Tomcat cache 삭제


tomcat에 의해 웹어플리케이션이 배포되면 기본적으로 cache가 남게 되는데

웹어플리케이션 파일(매직인포설치경로\server)에 변경 사항이 생겼을경우 제대로 구동에 반영되지 않을 수 있다.

이때는 cache가 저장되는 폴더들의 하위 폴더와 파일들을 삭제하고 MagicInfo Server 서비스를 재시작하면 된다.

cache를 삭제했을때 tomcat이 제대로 구동이 안될수 있으니 삭제 전 반드시 해당 폴더들을 백업 후 삭제해야 한다.

폴더 경로 : tomcat\temp, tomcat\webapps, tomcat\work




tomcat log 확인 방법


tomcat 구동에 관련한 로그를 확인하려면 tomcat\logs 폴더 내 파일을 참고하면 된다.

log 내용을 바탕으로 tomcat 구동시의 문제를 파악하고 튜닝을 할 수 있다.




로그 파일 종류


파일명설명
catalina.YYYY-MM-DD.log서버의기동,정지, 서비스의개시, 정지정보(tomcat 자체에관한)
host-manager.logTomcat Host Manager Web app 로그 (가상호스트매니저)
manager.logTomcat Manager Web App 로그 (웹콘솔)
localhost.loghost( VirtualHost 같은) 한정한 로그
commons-daemon.log데몬 (백그라운드 서비스) 실행에 대한 로그
magicinfo*.logmagicinfo 내 각 제품별 로그



tomcat 모니터링 및 튜닝 방법


 (시간부족으로 다음에 적겠습니다)



magicinfo server의 동작이 느려지는 문제 등을 겪을 땐 

tomcat이 사용하고 있는 thread 등의 실행 상황을 파악하고, 서버 실행 상황에 맞게 튜닝할 수 있다.


톰캣 관리자를 이용한 모니터링

톰캣 관리자를 이용해 톰캣을 모니터링 할 수 있다.

서버의 상태와 요청 상태 정보를 제공하므로, 관리자가 문제를 해결할때 이 정보를 유용하게 활용할 수 있다.


JConsole



튜닝

스레드 덤프를 이용해 덤프를 분석하여 성능 저하의 원인을 파악하고 문제를 해결할 수 있다.


jstack


samurai


tda