JBOSS4 性能优化设置

1.%JBOSS_HOME%\server\default\deploy\jbossweb-tomcat55.sar\server.xml

修改server.xml文件

  <Connector port="8080" address="0.0.0.0"   

         maxThreads="250" maxHttpHeaderSize="8192"

         emptySessionPath="true" protocol="HTTP/1.1"

         enableLookups="false" redirectPort="8443" acceptCount="100"

         connectionTimeout="20000" disableUploadTimeout="true"

 />

修改后

  <Connector port="8080" address="0.0.0.0"   

         maxThreads="250" maxHttpHeaderSize="8192"

         emptySessionPath="true" protocol="HTTP/1.1"

         enableLookups="false" redirectPort="8443" acceptCount="100"

         connectionTimeout="20000" disableUploadTimeout="true"

                     compression="on" compressableMimeType="text/html,text/xml,text/plain,text/css,text/javascript,application/xhtml+xml,application/x-javascript,application/javascript,text/xhtml"  />

compression="on" compressableMimeType=""用来启用GZIP压缩,对传输数据的压缩功能,减少传输时间

2.

安全

    1、关闭jmx-console

        删除server/default/deploy/jmx-console.war和server/default/deploy/management

    2、关闭web-console和status统计

        修改server/default/deploy/jboss-web.deployer/ROOT.war/WEB-INF/web.xml,屏蔽status的servlet

    修改server/default/deploy/jboss-web.deployer/ROOT.war/index.html,屏蔽几个链接地址

3.

Jboss部署目录优化:

     去掉和应用无关的部署,加快jboss运行速度

bsh-deployer.xml

client-deployer-service.xml 

ear-deployer.xml

ejb-deployer.xml

http-invoker.sar

jboss-bean.deployer

jboss-ws4ee.sar

jms

jsr88-service.xml  

schedule-manager-service.xml

scheduler-service.xml

sqlexception-service.xml

uuid-key-generator.sar

4.

连接池大小

5.

hibernate二级缓存

6.

安装jbossNative

jboss的web container使用的 apache tomcat (http://www.apache.org)。 apache tomcat 有一个扩展包,使tomcat可以通过 java native interface 使用 apache portable runtime (APR),而APR则是大名顶顶的apache httpd 网络服务器的运行时环境。用了这个扩展之后,就使得tomcat可以借助于apache httpd的力量,性能得以提升,尤其是处理静态文件时效率更高。Jboss native,实际上就是tomcat的这个native的扩展,只不过被jboss又添进了一些为了和jboss更好协作而加进去的东西。
要安装jboss native, 按以下步骤进行


请到jboss的网站上下载,地址是 http://labs.jboss.com/jbossweb/downloads/jboss-native-archive.html, 依据服务器环境选择合适的版本。 目前我们用的版本是JBoss Native 2.0.4 Linux x86 。 
解压下载后的压缩包到某个目录,比如 jbossNative目录 
将jbossNative/bin/META-INF/bin/linux2/x86/openssl 复制到<jboss>/bin 
在<jboss>/bin目录里建一个文件夹,名为 native 
把jbossNative/bin/META-INF/lib/linux2/x86/ 目录下所有内容复制到上一步建好的<jboss>/bin/native目录下

(如果log提示找不到The Apache Tomcat Native library,可以尝试将dll放入jboss_home/bin目录,以及在启动脚本run.bat中做下面的修改)

REM Add bin/native to the PATH if present
if exist "%JBOSS_HOME%\bin\native" set PATH=%JBOSS_HOME%\bin;%JBOSS_HOME%\bin\native;%PATH%;
if exist "%JBOSS_HOME%\bin\native" set JAVA_OPTS=%JAVA_OPTS% -Djava.library.path="%PATH%"

 

原文地址:https://www.cnblogs.com/oisiv/p/1745405.html