server.xml
--
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
<!-- Security listener. Documentation at /docs/config/listeners.html -->
<Listener className="org.apache.catalina.security.SecurityListener" checkedOsUsers="root" /> root 사용자로 start 하지 못하게 함
<!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -->
<Listener className="org.apache.catalina.core.JasperListener" />
<!-- Prevent memory leaks due to use of particular java/javax APIs-->
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" /> 메모리 leak detector
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<!-- Global JNDI resources
Documentation at /docs/jndi-resources-howto.html
-->
<GlobalNamingResources>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users
-->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080"
protocol="org.apache.coyote.http11.Http11Protocol" BIO 사용
acceptCount="30" back log를 30으로 제안
enableLookups="false" DNS 사용 금지.
compression="off" 압축 금지 (REST 사용 및 Mobile 고려)
connectionTimeout="10000" Connection time out 10초
maxConnections="8192"
maxKeepAliveRequests="1"
maxThreads="100"
tcpNoDelay="true"
redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost"
appBase="webapps" <!-- /bin/apps/ -->
unpackWARs="true"
autoDeploy="false">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
<Resource name="jdbc/TestDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="javauser" password="javadude" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/javatest"/>
애플리케이션 배포를 쉽게 하기 위해서, 위의 Context.xml은 war/META-INF/context.xml을 사용하는게 좋음
'성능과 튜닝 > WAS 튜닝' 카테고리의 다른 글
Apache Tomcat Tuning (아파치 톰캣 튜닝 가이드) (12) | 2013.09.05 |
---|---|
Apache Tomcat Tuning (0) | 2013.03.13 |
WAS의 Thread수 산정과 Instance 산정 가이드 (0) | 2009.04.09 |