JBoss 5.x Tuning/Slimming
Introduction
Slimming is very application specific, so this is by no means a universal document. If you have documented the process for slimming other services for JBoss 5.x please add to them here.
Slimming
Remove EJB3 services
In server /<node>/deploy/remove:
- ejb3-connectors-jboss-beans.xml
- ejb3-container-jboss-beans.xml
- ejb3-interceptors-aop.xml
- ejb3-timerservice-jboss-beans.xml
- profile-service-secured.jar - Note : this folder is not in Jboss EAP 5.1.0
remove:
- jboss-ejb3-endpoint-deployer.jar
- ejb3-deployers-jboss-beans.xml --> Note : this file is in Jboss EAP 5.1.0 but not Jboss AS 5.1.0
- Do not remove
- deployers/ejb3.deployer/jboss-ejb3-deployer.jar
- deployers/ejb3.deployer/META-INF/ejb3-deployers-jboss-beans.xml,
Remove EJB2 services
In server/<node>/deploy/remove:
- ejb2-container-jboss-beans.xml
- ejb2-timer-service.xml (Note that EJB3 deployments may fail without this service. See )
Remove JUDDI
In server/<node>/deploy/remove:
- juddi-service.sar
Remove Key Generator
In server/<node>/deploy/remove:
- uuid-key-generator.sar
Remove JMS (Java Message Service)
In server/<node>/conf/props/remove:
- messaging-roles.properties
- messaging-users.properties
remove:
- messaging
- jms-ra.rar
- quartz-ra.rar (this is just JMS resource to the Quartz scheduler)
remove:
- messaging-definitions-jboss-beans.xml
remove (comment out):
- everything about jms (maybe optionnal because profile web and default use the same standardjboss.xml file and profile web have no JMS support)
remove (comment out):
<property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"
value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;
java:/DefaultJMSProvider"/>
</properties>
Remove JBoss Mail
In server/<node>/deploy/remove:
- mail-service.xml
- mail-ra.rar
Remove JBoss Scheduling
In server/<node>/deploy/remove:
- schedule-manager-service.xml
- scheduler-service.xml
Remove Hypersonic DB
In server/<node>/deploy/remove:
- hsqldb-ds.xml
Remove Bsh Deployer
In server/<node>/deployers/remove:
- bsh.deployer
Turn off hot deployment
In server/<node>/deploy/remove:
- hdscanner-jboss-beans.xml
Remove JBossWS
remove:
- jax-ws-catalog.xml
remove:
- jbossws-roles.properties
- jbossws-users.properties
remove:
- jbossws.sar
- jbossws-console.war
remove:
- jbossws.deployer
Remove Seam
In server/<node>/deployers/remove:
- seam.deployer
- webbeans.deployer
remove:
- admin-console.war - takes too much resources in JBoss 5.x, remove it even if you use Seam
Remove IIOP/Corba
remove:
- jacorb.properties
remove:
- iiop-service.xml
remove:
- ejb3-iiop-deployers-jboss-beans.xml
remove:
- jacorb.jar
replace the line :
java.naming.factory.initial=org.jboss.iiop.naming.ORBInitialContextFactory
with this new line
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
Remove other services
In server/<node>/deployers/remove:
- xnio.deployer - not used in JBoss 5.x default configuration for JBooss remoting anyway
remove:
- jboss-xa-jdbc.rar - if you do not use XA datasources
- jmx-remoting.sar - remote (RMI) acces to JMX, you can still access JMX by jmx-console
- jmx-console.war - if you do not use JMX console
- profileservice-secured.jar - secured remote access to profileservice
- sqlexception-service.xml - pretty useless in JBoss 5.x
- xnio-provider.jar - not used in JBoss 5.x default configuration for JBooss remoting
remove:
- hibernate-deployer-jboss-beans.xml - deployment of HAr archives only, you can still use Hibernate in EJBs after you remove this
Remove Unused Invokers
It depends, which invoker you would like to use: jrmp, pooled, unified, http.The best way is to chose one and disable the others.
TODO: how to switch invokers (such as switching JMX from JRMP to HTTP).
HTTP Invokers
- If you want to remove the HTTP invokers (which are used if you 'tunnel' your requests through HTTP) simply remove the according deployments/directories from the $JBOSS_HOME/server/<profile>/deploy/ directory.
- Please be aware that HTTP invokers are something different than the Tomcat HTTP Connector (the HTTP invokers need the HTTP connector but the HTTP connector does not need the HTTP invokers).
- HTTP Invoker for JNDI, EJB and JMX
- Simply remove the http-invoker.sar (web, default, standard) or httpha-invoker.sar (all, production) directory from your configuration all together.
- If using a clustered configuration, then remove httpha-invoker.sar
- HTTP Invoker for JMS
- Remove the /deploy/jms/jbossmq-httpil.sar directory completely.
JMX Invoker
- If you want to remove the JMX invoker, remove $JBOSS_HOME/server/<profile>/deploy/jmx-invoker-service.xml.
- By removing the JMX invoker you will not be able to perform a remote shutdown or any sort of programmatic remote management. You will not be able to use twiddle and shutdown scripts!
- The JMX invoker depends on the JRMP invoker. You can remove the JMX invoker and keep the JRMP invoker, but you can't remove the JRMP invoker without removing the JMX invoker also.
- The legacy Web Management Console depends on the jmx-invoker service. You can remove the $JBOSS_HOME/server/<profile>/deploy/management directory in order to clean up deployment errors from this dependency. This Web Console is deprecated by the Admin Console as of EAP 5 and is maintained for legacy purposes only.
- Securing the JMX Invoker
- Rather than remove the jmx invoker, you can also secure it by uncommenting the line in jmx-invoker-service.xml that looks like: <!-- <interceptor code="org.jboss.jmx.connector.invoker.AuthenticationInterceptor" securityDomain="java:/jaas/jmx-console"/> -->
- This will require authentication to use the JMX invoker service, but the password will still be unencrypted. You can implement a simple hashing method as shown in the security guide.
Pooled Invoker
- This provides a socket connection pool for remote EJB calls.
- If you want to remove the Pooled invoker, in server/<node>/deploy/legacy-invokers-service.xml remove (comment out): PooledInvoker
JRMP Invoker
- The org.jboss.invocation.jrmp.server.JRMPInvoker class is an MBean service that provides the RMI/JRMP implementation of the Invoker interface. The JRMPInvoker exports itself as an RMI server so that when it is used as the Invoker in a remote client, the JRMPInvoker stub is sent to the client instead and invocations use the RMI/JRMP protocol.
- If you want to remove the JRMP invoker, in server/<node>/deploy/legacy-invokers-service.xml remove (comment out): JRMPInvoker
- You also have to disable jmx-invoker-service.xml. See above.
IIOP Invoker
- JBoss IIOP supports CORBA/IIOP access to enterprise beans deployed in a JBoss Application Server, as defined by the EJB specification.
- If you want to remove the IIOP invoker, in server/<node>/conf/standardjboss.xml remove (comment out): invoker-proxy-binding iiop
Remove Clustering
remove:
- deploy-hasingleton/
- farm/
remove:
- cluster/
in server/<node>/conf/bootstrap/profile.xml
edit the "BootstrapProfileFactory" bean and delete or comment out the following:
<!-- Optional list of URIs that will be kept in sync across the cluster.
Requires deploy/cluster/farm-deployment-jboss-beans.xml to be
deployed as well.
-->
<property name="farmURIs">
<list elementClass="java.net.URI">
<value>${jboss.server.home.url}farm</value>
</list>
</property>
- turn off clustering:
<attribute name="Clustered">false</attribute>
- delete or comment out the dependency on the JGroups channel factory
<depends optional-attribute-name="ChannelFactoryName">
jboss.jgroups:service=ChannelFactory</depends>
- server/<node>/deploy/cluster/jboss-cache-manager.sar and
- server/<node>/deploy/cluster/jgroups-channelfactory.sar
Tuning
Reduce memory usage:
These MBeans are too much in number and are known to increase memory usage.
What you can do is, change the following from
JBOSS_HOME/server/< servername>/conf/bootstrap/deployers.xml:
<bean name="Deployers">
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX(name=jboss.deployment:
service=DeployersImpl,
exposedInterface=org.jboss.deployers.plugins.deployers.DeployersImplMBean.class,
registerDirectly=true)
</annotation>
<constructor>
<parameter>
<inject bean="jboss.kernel:service=KernelController"/>
</parameter>
</constructor>
<!-- Accept any implementor of deployer -->
<incallback method="addDeployer"/>
<uncallback method="removeDeployer"/>
<property name="mgtObjectCreator">
<inject bean="ManagedObjectCreator"/>
</property>
</bean>
<bean name="Deployers">
<!-- Uncomment the following @org.jboss.aop.microcontainer.aspects.jmx.JMX to enable
registering MC beans as MBeans.
These MBeans provide debug level information about which deployers were selected for
processing the deployment and what attachments were added to the deployment.
More details
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=155074&start=10#4233874
-->
<!--
<annotation>@org.jboss.aop.microcontainer.aspects.jmx.JMX
(name="jboss.deployment:service=DeployersImpl",
exposedInterface=org.jboss.deployers.plugins.deployers.DeployersImplMBean.class,
registerDirectly=true)
</annotation>
-->
<constructor>
<parameter>
<inject bean="jboss.kernel:service=KernelController"/>
</parameter>
</constructor>
<!-- Accept any implementor of deployer -->
<incallback method="addDeployer"/>
<uncallback method="removeDeployer"/>
<property name="mgtObjectCreator">
<inject bean="ManagedObjectCreator"/>
</property>
</bean>

