Professional Documents
Culture Documents
x Tuning/Slimming
Introduction
Slimming
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
In server/<node>/deployers/ 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
deployers/ejb3.deployer/jboss-ejb3-deployer.jar
and deployers/ejb3.deployer/META-INF/ejb3-deployers-jboss-beans.xml,
ejb2-container-jboss-beans.xml
ejb2-timer-service.xml (Note that EJB3 deployments may fail without this service. See this forum post)
Remove JUDDI
In server/<node>/deploy/ remove:
juddi-service.sar
uuid-key-generator.sar
messaging-roles.properties
messaging-users.properties
In server/<node>/deploy/ remove:
messaging
jms-ra.rar
quartz-ra.rar (this is just JMS resource to the Quartz scheduler)
In server/<node>/deployers/ remove:
messaging-definitions-jboss-beans.xml
everything about jms (maybe optionnal because profile web and default use
the same standardjboss.xml file and profile web have no JMS support)
<property name="com.arjuna.ats.jta.recovery.XAResourceRecovery.JBMESSAGING1"
value="org.jboss.jms.server.recovery.MessagingXAResourceRecovery;java:/DefaultJMSProvider"/>
</properties>
mail-service.xml
mail-ra.rar
schedule-manager-service.xml
scheduler-service.xml
Remove Hypersonic DB
In server/<node>/deploy/ remove:
hsqldb-ds.xml
bsh.deployer
hdscanner-jboss-beans.xml
Remove JBossWS
In server/<node>/conf remove:
jax-ws-catalog.xml
In server/<node>/conf/props/ remove:
jbossws-roles.properties
jbossws-users.properties
In server/<node>/deploy/ remove:
jbossws.sar
jbossws-console.war
In server/<node>/deployers/ remove
jbossws.deployer
Remove Seam
In server/<node>/deployers/ remove
seam.deployer
webbeans.deployer
In server/<node>/deploy/ remove:
admin-console.war - takes too much resources in JBoss 5.x, remove it even if you use Seam
Remove IIOP/Corba
In server/<node>/conf/ remove
"jacorb.properties
In server/<node>/deploy/ remove:
iiop-service.xml
In server/<node>/deployers/ejb3.deployer/META-INF remove
ejb3-iiop-deployers-jboss-beans.xml
In server/<node>/lib remove
jacorb.jar
java.naming.factory.initial=org.jboss.iiop.naming.ORBInitialContextFactory
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
xnio.deployer - not used in JBoss 5.x default configuration for JBoss remoting anyway
In server/<node>/deploy/ remove:
In server/<node>/deployers/ remove:
hibernate-deployer-jboss-beans.xml - deployment of HAr archives only, you can still use Hibernate in EJBs
after you remove this
Also, feel free to remove the corresponding .jars for the services slimmed above from jboss/
common/lib.
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
Pooled Invoker
JRMP Invoker
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
Note: There may be other invokers bound to different ports. If you don't need them you may
remove them. Otherwise secure them if they are reachable by folks you don't fully trust.
Remove Clustering
In server/<node> remove:
deploy-hasingleton/
farm/
In server/<node>/deploy remove:
cluster/
To eliminate an otherwise harmless error message in the logs about a missing farm
directory, 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>
<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>
The above describes a complete elimination of clustering features. Finer grained elimination
of features can be accomplished by not completely deleting server/<node>/deploy/cluster
but rather only deleting some of the deployments therein. For example, doing all of the
above but leaving
server/<node>/deploy/cluster/jboss-cache-manager.sar and
server/<node>/deploy/cluster/jgroups-channelfactory.sar
Tuning
There's one very simple change that you could do to bring down the memory used by JBoss
AS 5.1.0. By default, JBoss AS5 has some debug level MBeans (which are in most cases
meant for JBoss server developer's use) enabled. 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>
to:
<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>
Notice the commented out the "annotation" element in that section. More details can be
found in this JIRA https://jira.jboss.org/browse/JBAS-6987. This fix has been done in JBoss
AS 6.0 series.
http://community.jboss.org/message/555231#555231
http://community.jboss.org/message/566236#566236