Prefer local

With the Prefer local policy, the selection made by the WLM plug-in not only depends on the running cluster members, but also on the system where the request comes from. The WLM plug-in will only select cluster members on the same system as the client, unless all local cluster members are unavailable.

This client might also be a Java virtual machine not running in WebSphere, such as a J2EE client application, or a stand-alone Java program accessing EJBs. For a J2EE client application, the Prefer local policy has no influence on the request distribution because the client runs on a remote workstation.

In the case of a Java program running on the same machine as WebSphere and using the WebSphere JRE and its ORB, the Prefer local policies will dispatch requests among EJB containers running on the same node. EJB WLM requires the WebSphere ORB and its WLM plug-in. If non-WebSphere ORBs are used, then the Java client will not be able to participate in EJB WLM.

Important: Whatever the server selection policy, process affinity and transaction affinity will always override the selection policy.

As you can see in Figure 6-12, EJB requests are distributed across the available cluster members on the local node, app1w, in a repetitive order. Remember, both EJB1a and EJB1b have the same server weight value of 2.

Figure 6-12 Web client calling EJBs - Prefer local policy enabled

The output listing in Example 6-6 shows a similar behavior for our J2EE client application, which is run from node app1w. EJB requests are distributed over the available cluster members on the local node, app1w, in a repetitive order because both EJB1a and EJB1b have the same server weight value of 2.

Example 6-6 J2EE client calling EJBs - Prefer local policy enabled

<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 31
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 15
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 16
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 16
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1a, beanServerProcessId=2088, beanNodeName=app1w}
Execution time: 0
<==============================>
<Session Bean>
---> {beanServerName=EJB1b, beanServerProcessId=2324, beanNodeName=app1w}
Execution time: 0
<==============================>

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.