Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.
Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.
Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.
Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.
Alto ventos est coeptis utque fecit. Phoebe sine circumfuso arce. Tanto aliis. Matutinis cornua origo formaeque animal mundo. Chaos: fabricator. Natura mundo caesa addidit.
Cuncta habendum meis omni ille formaeque emicuit septemque et. Lege fecit aethere porrexerat gentes horrifer formas.
3. 스레드 풀(thread pool) 설정
– 클라이언트의 요청을 처리하는 스레드 수 설정. 기본 값은 200이며 그 이상의 요청이 있을 경우 “connection refused” 메시지를 리턴한다.
– $CATALINA_HOME/conf/server.xml 파일에서 <Connector />의 속성을 수정한다.
– 만약 maxThreads 값이 최대 값인 750을 넘을 경우 두 대의 Tomcat을 이용해 클러스터링 구성을 하는 것이 좋다. 하나의 Tomcat에 maxThreads=1000을 설정하지 말고 두 개의 Tomcat에 각각 maxThreads=500 설정을 하라는 뜻이다.
(*) 잘 모르겠으면 대충 설정하지 말고 Tomcat을 기본값으로 운영하면서 숫자를 조금씩 조정해야 함.
– compression=”500″은 500 bytes 이상의 파일만 압축하라는 뜻이다.
– 닥치고 압축하려면 compression=”on”으로 설정한다.
(*) HTTP compression: 서버에서 파일을 압축한 뒤 클라이언트로 전송하는 기능임. Tomcat의 고유한 기능이 아니라 HTTP 스펙에 있는 기능임.
5. 데이터베이스 성능 튜닝
– NamedQuery를 쓴다면 애플리케이션 초기화할 때 모두 로드할 것.
(*) JDBC를 사용한다면 try…catch…finally를 사용하여 반드시 DB connection을 close 할 것.
여기서 눈여겨 볼 사항이 <property name=”poolPingQuery” value=”select 1″/> 이다.
기존에 validationQuery 대신 poolPingQuery로 사용 하고 있다.
다음은 각 pool 과 관련된 속성 값 설명이다.
<property name="poolMaximumActiveConnections" value="20"/>
: 동시 활성화 할 커넥션 수
<property name="poolMaximumIdleConnections" value="20"/>
: 유휴상태의 커넥션 수
<property name="poolMaximumCheckoutTime" value="20000"/>
: 커넥션 요청 후 획득까지 기다리는 시간
<property name="poolPingEnabled" value="true"/>
: 커넥션 ping 테스트
<property name="poolPingQuery" value="select 1"/>
: 커넥션이 살아 있는지 확인할 쿼리
<property name="poolPingConnectionsNotUsedFor" value="43200"/>
: 커넥션이 얼마 동안 유휴상태면 닫히는지 판단하는 시간
<property name="poolTimeToWait" value="30000"/>
: 사용 불가능한 커넥션 기다리는 시간
<property name="poolPingConnectionsOlderThan" value="43200"/>
: 어떤 커넥션이 닫힐 상태인지 판단하는 기준시간