PerformanceTuningEJB3MDBs

 

There are many factors when tuning mdbs in ejb3, but the 3 that are the biggest are:

 

1. Number of jms sessions for the MDB, which dictates how many threads may be running at any one time.

This is the number of sessions that you can have open at one time.  Each invocation of the bean will require a session.  This can be configured in the message driven annotation with the activation configuration.

@MessageDriven(name = "EJBExecutorMDB", activationConfig = {

        @ActivationConfigProperty(propertyName = "maxSession", propertyValue = "4")})

 

2. Number of instances of the mdb.

the default is defined by this in the ejb3-interceptors-aop.xml file in the deploy directory. Look for "Message Driven Beans" this is the defaults for all Message drive beans.

 

You can change the maxsize of the pool to get more instances. You can change the max size to something really big, like you have done with your sessions.

 

These two things will change the cpu usage for your system. I would experiment with these settings to see how much you can boost the cpu. There is still one bottleneck that you can look at, if you cant get the cpu usage up with these settings.

 

Ok there is one more thing that can affect how fast messages are moved through the system. The connector has two facets to it. A thread(s) that reads the message(s) off the socket and then hands the message off to one of the threads in the threadpool mentioned in 1. You can push the number of numAcceptThreads up also. You need to modify your remoting configuration.