Version 36

    Includes versions 4.2.x, EAP 4.2, EAP 4.3

     

    Introduction

     

    This guide is organized as a series of subtopics.  Meaning each subtopic assumes that you have done nothing else and focuses on one single service.  It is a work in progress.

     

    Each topic has a version tag at the top.  This version tells you the version the topic was written/tested with.  It does not mean that it is only useful for that version, only that it has not been revised or tested with later versions.  "and later" means the topic is generic enough to not be very version dependent.  Where a topic has been tested or revised for multiple versions, they are each listed.  Sub-headers or boldfaced type are used to denote divergence between two covered versions.  Where two versions are significantly different a seperate topic is used i.e. "... from JBossAS 4.0.5".

     

    Also Please note that the previous Slimming and Tuning Document for 3.x.x also has sections that apply to 4.0.x.

     

    Slimming Tips

     

    1. Remove WebServices, if not in use

     

    Description: WebServices is a standardized way of integrating Web-based applications using the XML, SOAP, WSDL and UDDI open standards over an Internet protocol backbone.

     

    Heap Savings ~8%(3513 kbytes)

     

    2. Remove Quartz if not in Use

     

    Description: Quartz is a job scheduler

     

    Heap Savings ~2%(734 kbytes)

     

    3. Remove JBossMQ if not in use.  JBossMQ is in 4.0.x, 4.2.x, and EAP 4.2

     

    Description:  JBossMQ is the default JMS provider in 4.0.x, 4.2.x, and EAP 4.2.  It provides messaging services to the container, including MDBs(Message Driven Beans)

     

    Heap Savings ~10%(3849 kbytes)

     

    4. Remove the EJB 2.1 TimerService, if not in use?

     

    Description:  The EJB 2.1 TimerService is used to crate EJB Timer Beans.  This will asynchronously launch beans at defined times.

     

     

    5. Remove EJB3, if not in Use

     

    Description:  EJB3 is the default EJB implementation in 4.0.x, 4.2.x, EAP 4.2 and EAP 4.3.  Usually you would only remove this if you are using just EJB2.1 and don't intend on using ejb3.

     

    Heap Savings ~9%(3243 kbytes)

     

    6. Remove the HTTPInvoker(which lets you tunnel RMI over HTTP), when not in use

     

    Description:  The HTTPInvoker deployment allows for clients to tunnel RMI over http for use with remote procedure calls.  EJB3 does not use this for calls over http, it uses remoting directly. This is the old style detached invoker.  The old style detatched invokers have been replaced with the unified invoker(a detatched invoker that acts as an adapter to remoting).

     

    Heap Savings ~2%(367 kbytes)

     

    7. Turn off JDBC Connection Close Checking when moving to production

     

    Description:  When moving a system into production, hopefully all the database connection leaks have been found.  When testing the system, JBoss can tell you when you are leaking connection.  When you move into production, you should turn off this feature, given that you have found and fixed all of the db connection leaks.

     

    8. Turn off the BeanShell Deployer, unless you are using BeanShell scripts in your deployment.

     

    Description:  JBoss can run BeanShell Scripts in it's deployments.  This subdeployer allows that integration.

     

     

    9. Turn the Deployment Scanner down or off altogether

     

    Description:  As a general rule, you should probably not use hot-deploy in production(I would recommend turning it off).  Changes in a production node should should coincide with a restart of the application server.  Hot deploy works most of the time, but every once in while there are some issues.  If clustering a rolling outage should be the best approach.  This tip tells you how to turn your deployment scanner down or off altogether.  This will save the cpu cycles that jboss would have used to scan for new files in the deploy directory.

     

    10. Remove the Farm Service  (replicated deployments)

     

    Description:  The farm service is used to push components to different Application servers in the same cluster.  The use of the farm service is not recommended.  Due to several bugs and limitations, most users develop their own mechanism to distribute new components to their servers. Note: Please note that EAP 4.2 and EAP 4.3 uses clustering by default and the farm service is active.  The Default EAP 4.2, 4.3 configuration is called "production", which is a clustering configuration with farm activated.

     

    Heap Savings ~1%(198 kbytes)

     

    11.  Remove the mail service if it is not being used

     

    Description: The mail service is used to enable the application server to send/receive emails.  If you are not using the mail service you can disable it.

     

    Heap Savings ~2%(624 kbytes)

     

    12.  DO NOT USE HYPERSONIC DB(HSQL) DB in production.(it is the default shipped with the container)

     

    Description: Do not use Hypersonic(HSQL) db in production.  Please use another datasource.  Steps to change your datasource are described here and are also linked to this tip.

     

    13.  Remove JBoss UDDI

     

    Description: UDDI is a registry that is an XML-based standard for describing, publishing, and finding Web services.

     

    Heap Savings ~8%(2205 kbytes)

     

    14.  Remove the Management Interface

     

    Description: JBoss comes with a management interface.  Most just use the jmx-console.  This can be disabled, if you are not using it.

     

    Heap Savings ~6%(1464 kbytes)

     

    15.  Remove the HA-Singleton service

     

    Description:  The HA-Singleton service is in the all and the production server configurations.  It is usually only enabled in clustered systems.  If you are in a clustered situation and you are not using JBossMQ, you can remove JBossMQ component as shown in 3. above and you can also remove the HASingleton Service.  The only component deployed by default as an HA-singleton is JBossMQ.  If you are using 4.3, which includes JBoss Messaging instead of JBossMQ, you can also remove this service.

     

    Heap Savings ~1%(364 kbytes)

     

    16.  Remove the IIOP Service

     

    If you are not using IIOP(Jacorb), then you can disable this component.

     

    Heap Savings ~5%(1204 kbytes)

     

    17.  Remove the JSR-88 Service

     

    JSR-88 defines a contract between a tool provider and a platform that enables tools from multiple vendors to configure, deploy and manage applications on any J2EE product platform. The tool provider typically supplies software tools and an integrated development environment (IDE) for developing and assembly of J2EE application modules. The J2EE platform provides application management functions that deploy, undeploy, start, stop, and otherwise manage J2EE applications.

     

    Heap Savings ~2%(599 kbytes)

     

    18.  Remove the JBoss SNMP Agent

     

    The SNMP service used to intercept JMX notifications emitted by MBeans, convert them to SNMP traps and send them to SNMP managers. In this respect the snmp-adaptor acts as an SNMP agent.

     

    Heap Savings ~2%(572 kbytes)

     

    Tuning Tips

    1. Change your thread stack size in your jvm to 128k

     

    Description: Each thread in java creates a native thread using process space(not heap space).  A high thread stack size can cause much more memory to be allocated than needs to be.  It is best to use 128k, unless you get StackOverflow exceptions, then it should be raised to 256k