1.修改<jboss>/bin/run.conf中的AVA_OPTS,去掉+XX:AggressiveHeap,修改Xss。现在的JAVA_OPTS为:
-Xms520m -Xmx900m -Xss128k -XX:+UseParallelGC -XX:+UseParallelOldGC
(注:参数 -XX:+UseParallelGC -XX:+UseParallelOldGC 这两个让服务并行回收内存空间)
修改完为:
rem Sun JVM memory allocation pool parameters. Modify as appropriate.
set JAVA_OPTS=%JAVA_OPTS% -Xms256m -Xmx640m -Xss128k -XX:+UseParallelGC -XX:+UseParallelOldGC
2.修改<jboss>/server/default/deploy/jbossweb-tomcat55.sar/service.xml
将maxThreads根据目前的访问量由默认的250降为75,并使用jboss 4默认未写在标准service.xml里面而jboss 3写入了的2个参数: maxSparseThreads=55,minSparseThreads=25。
修改完后为:
<Connector port="80" address="${jboss.bind.address}"
maxThreads="75" maxSparseThreads="55" minSparseThreads="25"
strategy="ms" maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true"/>
3.修改了<jboss>/docs/examples/jca/oracle-ds.xml将最大连接数有150降为50.
完整的配置文件内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- $Id: oracle-ds.xml,v 1.6 2004/09/15 14:37:40 loubyansky Exp $ -->
<!-- ==================================================================== -->
<!-- Datasource config for Oracle originally from Steven Coy -->
<!-- ==================================================================== -->
<datasources>
<local-tx-datasource>
<jndi-name>OracleDS</jndi-name>
<connection-url>jdbc:oracle:thin:@youroraclehost:1521:yoursid</connection-url>
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
<!--
<user-name>x</user-name>
<password>y</password>
-->
<security-domain>EncryptDBPassword</security-domain>
<min-pool-size>10</min-pool-size>
<max-pool-size>15</max-pool-size>
<exception-sorter-classname>
org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
</exception-sorter-class-name>
<metadata>
<type-mapping>Oracle9i</type-mapping>
</metadata>
</local-tx-datasource>
</datasources>
4.去掉了一些不用的服务。