JBoss AS的调优与瘦身(二)
版权声明:原创作品,如需转载,请与作者联系。否则将追究法律责任。 |
瘦身
l 移除server/slim/deploy/mail-service.xml
当不使用缓存失效服务的时候 (一般在集群配置里作为CMP选择一个beans用与失效缓存)
l 移除 server/slim/deloy/cache-invalidation-service.xml
当不使用J2EE客户端部署服务的时候(这不是一个很有益的J2EE规格必须服务,对于EAR application-client.xml描述符)
l 移除 server/slim/deploy/client-deployer-service.xml
当不使用集成HAR部署和Hibernate会话管理服务的时候
l 移除server/slim/deploy/hibernate-deployer-service.xml (HAR support)
l 移除server/slim/lib/jboss-hibernate.jar (HAR support)
l 移除server/slim/lib/hibernate2.jar (Hibernate itself)
l 移除server/slim/lib/cglib-full-2.0.1.jar (used by Hibernate to create proxies of POJOs)
l 移除server/slim/lib/odmg-3.0.jar (由hibernate使用的一些傻瓜试的对象-关系映射行为是从一些傻瓜式的委员会来的[goofy committee]http://www.service-architecture.com/database/articles/odmg_3_0.html
不使用 Hypersonic的时候 (在生产环境里你可能不使用这个)
注意在默认配置里 JBossMQ使用 DefaultDS名字同样被部署,用于为Hypersonic映射. 在配置上对于其他选择的更多信息,见 JBoss MQ Persistence Wiki pages .
l 移除server/slim/deploy/hsqldb-ds.xml
l 移除server/slim/lib/hsqldb-plugin.jar
l 移除server/slim/lib/hsqldb.jar
l 移除the entire server/slim/deploy/jms directory
l 移除server/slim/lib/jbossmq.jar
不使用 HTTPInvoker的时候 (从RMI到HTTP的隧道)
l 移除the entire server/slim/deploy/http-invoker.sar 文件夹
不使用 XA 数据源的使用 (分布式 and/or 可恢复的事务)
l 移除server/slim/deploy/jboss-xa-jdbc.rar
如果你不需要JMX-Console 然后删除它
l 移除server/slim/deploy/jmx-console.war
如果你不需要制造JMX调用RMI (警告the shutdown.sh 是否这样做)
l 移除server/slim/deploy/jmx-invoker-adaptor-server.sar
l 移除server/slim/deploy/jmx-adaptor-plugin.jar
如果你不需要web-console
l 移除server/slim/deploy/management/web-console.war
如果你不需要JMX的JSR-77扩充
l 移除server/slim/deploy/management/console-mgr.sar
如果你需要web-console 或者 jsr-77 扩充的其中之一
l 移除server/slim/deploy/management directory entirely
如果你不使用控制台/email监控警报
l 移除server/slim/deploy/monitoring-service.xml
l 移除server/slim/lib/jboss-monitoring.jar
如果你不通过Properties Service使用富资源编辑器(JMX)或者装载properties到系统properties 里。
l 移除server/slim/deploy/properties-service.xml
l 移除server/slim/lib/properties-plugin.jar
此scheduler-service.xml是一个例子,除非你在它的里面放入自己的东西
l 移除server/slim/deploy/scheduler-service.xml
如果你不适用JBoss调度管理 (允许你安排请求依赖MBeans)
l 移除server/slim/deploy/schedule-manager-service.xml
l 移除server/slim/lib/scheduler-plugin* (scheduler-plugin.jar, scheduler-plugin-example.jar)
如果你不需要供应商特定的sql异常援助[handing] (just leave it, really)
l 移除server/slim/deploy/sqlexception-service.xml
如果你既没有使用客户端事务管理,也没有缓存连接(我们缓存连接来代替池,例如就JAAS->DB User 来说—-使用这个意味着你是个坏人,需要被拍击[using this means you are a bad person and need to be smacked]) .
l 移除server/slim/deploy/user-service.xml
如果你不使用JBoss的UUID key生成 (大多情况下用于CMP主键生成,但是我们的数据库也同样支持的很好)
l 移除server/slim/deploy/uuid-key-generator.sar
l 移除server/slim/lib/autonumber-plugin.jar
user-service.xml 是一个例子 – 除非你在它里面做一些事情 (你自己的mbeans),你可以移除它.
l 移除server/slim/deploy/user-service.xml
如果你使用通过HTTP直接连接Tomcat而不是通过Apache/mod_jk:
l 使用vi编辑器打开server/slim/deploy/jbossweb-tomcat50.sar/server.xml
l 移除/注释下面的XML 片段:
<!-- A AJP 1.3 Connector on port 8009 --> <Connector port="8009" address="${jboss.bind.address}" enableLookups="false" redirectPort="8443" debug="0" protocol="AJP/1.3"/> l 使用vi编辑server/slim/deploy/jbossweb-tomcat50.sar/server.xml 文件
l 移除/注释下面的XML片段:
<!-- A HTTP/1.1 Connector on port 8080 --> <Connector port="8080" address="${jboss.bind.address}" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true"/> l 使用vi打开编辑 server/slim/conf/jboss-service.xml文件
l 移除/注释下面的XML片段从这
从这个
<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"> MBean 下面
<attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute> 和
<!-- EAR 部署,如果你不使用Web分层,删除-->
<mbean code="org.jboss.deployment.EARDeployer"name="jboss.j2ee:service=EARDeployer"> </mbean> 如果你不需要可以部署JMS队列
l 使用vi打开 server/slim/conf/jboss-service.xml 文件
l 移除/注释下面的XML片段从这
从这个
<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain" > Mbean下面
<attribute name="JMSService">jboss.mq:service=DestinationManager</attribute> 如果你不需要使用CORBA/IIOP
l 使用vi打开编辑 server/slim/conf/jboss-service.xml文件
l 移除/注释下面的XML片段从这
从这个
<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"> MBean 下面
<attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute> 如果你删除user-transaction-service.xml
l Vi编辑 server/slim/conf/jboss-service.xml 文件
l 移除/注释下面的XML片段从这
从这个
<mbean code="org.jboss.management.j2ee.LocalJBossServerDomain"> MBean 下面
<attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute> 如果你不需要JSR-77支持 (尝试做JBoss, Weblogic 和 Websphere支持一些基于同类的JMX监控)你可以删除/注释server/slim/conf/jboss-service.xml文件关于JSR-77的全部片段:
<!-- ==================================================================== --> <!-- JSR-77 Single JBoss Server Management Domain --> <!-- ==================================================================== --> <mbean code="org.jboss.management.j2ee.LocalJBossServerDomain" name="jboss.management.local:j2eeType=J2EEDomain,name=Manager"> <attribute name="MainDeployer">jboss.system:service=MainDeployer</attribute> <attribute name="SARDeployer">jboss.system:service=ServiceDeployer</attribute> <!-- <attribute name="EARDeployer">jboss.j2ee:service=EARDeployer</attribute>--> <attribute name="EJBDeployer">jboss.ejb:service=EJBDeployer</attribute> <attribute name="RARDeployer">jboss.jca:service=RARDeployer</attribute> <attribute name="CMDeployer">jboss.jca:service=ConnectionFactoryDeployer</attribute> <attribute name="WARDeployer">jboss.web:service=WebServer</attribute> <attribute name="MailService">jboss:service=Mail</attribute> <!-- <attribute name="JMSService">jboss.mq:service=DestinationManager</attribute>--> <attribute name="JNDIService">jboss:service=Naming</attribute> <attribute name="JTAService">jboss:service=TransactionManager</attribute> <!-- <attribute name="UserTransactionService">jboss:service=ClientUserTransaction</attribute> <attribute name="RMI_IIOPService">jboss:service=CorbaORB</attribute>--> </mbean> 如果你不需要client-side事务管理 (记住,使用这个那意味着你是一个坏人)
l 使用vi编辑 server/slim/conf/jboss-service.xml文件
l 移除/注释下面的XML片段
<!-- | UserTransaction support. --> <mbean code="org.jboss.tm.usertx.server.ClientUserTransactionService" name="jboss:service=ClientUserTransaction" xmbean-dd="resource:xmdesc/ClientUserTransaction-xmbean.xml"> <depends> <mbean code="org.jboss.invocation.jrmp.server.JRMPProxyFactory" name="jboss:service=proxyFactory,target=ClientUserTransactionFactory"> <attribute name="InvokerName" |


