How to tune the EJB Stateless Session Beans (SLSB) pool size in EAP 7 / 6
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.x
- 6.x
Issue
- Similar to EAP5 (
slsb-strict-max-pool) is there any similar feature available in EAP6 to tune the EJBs Stateless Session Bean Pool ?
Resolution
-
Define a new pool in the ejb3 subsystem [1].
-
Associate the EJB with the pool via annotations [2] or
"$EJB_JAR/META-INF/jboss-ejb3.xml"[3]
[1]
<subsystem xmlns="urn:jboss:domain:ejb3:1.3">
<session-bean>
<stateless>
<bean-instance-pool-ref pool-name="NewPool"/>
</stateless>
...
</session-bean>
<pools>
<bean-instance-pools>
<strict-max-pool name="NewPool" max-pool-size="20" instance-acquisition-timeout="5" instance-acquisition-timeout-unit="MINUTES"/>
...
</bean-instance-pools>
</pools>
...
[2]
@Stateless
@org.jboss.ejb3.annotation.Pool(value="NewPool")
public class MyBean....
[3]
<jboss xmlns="http://java.sun.com/xml/ns/javaee" xmlns:p="urn:ejb-pool:1.0">
....
<assembly-descriptor>
<p:pool>
<ejb-name>MyBean</ejb-name>
<p:bean-instance-pool-ref>NewPool</p:bean-instance-pool-ref>
</p:pool>
</assembly-descriptor>
</jboss>
Related Solutions
- How to tune the ejb3 subsystem in JBoss EAP 6
- How to enable and view ejb invocation & pool statistics in JBoss EAP 6/7
SBR
Components
Category
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.