Pure-Java Versus Native Socket Reader Implementations

Communications In a Cluster 3-5 ■ Accessing non-clustered objects deployed to another clustered server instance on a different machine. ■ Replicating HTTP session states and stateful session EJB states between a primary and secondary server instance. ■ Accessing clustered objects that reside on a remote server instance. This generally occurs only in a multi-tier cluster architecture, such as the one described in Section 9.3, Recommended Multi-Tier Architecture. Proper socket configuration is crucial to the performance of a WebLogic Server cluster. Two factors determine the efficiency of socket communications in WebLogic Server: ■ Whether the server instance host system uses a native or a pure-Java socket reader implementation. ■ For systems that use pure-Java socket readers, whether the server instance is configured to use enough socket reader threads.

3.1.3.1 Pure-Java Versus Native Socket Reader Implementations

Although the pure-Java implementation of socket reader threads is a reliable and portable method of peer-to-peer communication, it does not provide the best performance for heavy-duty socket usage in a WebLogic Server cluster. With pure-Java socket readers, threads must actively poll all opened sockets to determine if they contain data to read. In other words, socket reader threads are always busy polling sockets, even if the sockets have no data to read. This unnecessary overhead can reduce performance. The performance issue is magnified when a server instance has more open sockets than it has socket reader threads—each reader thread must poll more than one open socket. When the socket reader encounters an inactive socket, it waits for a timeout before servicing another. During this timeout period, an active socket may go unread while the socket reader polls inactive sockets, as shown in Figure 3–1 . Figure 3–1 Pure-Java Socket Reader Threads Poll Inactive Sockets For best socket performance, configure the WebLogic Server host machine to use the native socket reader implementation for your operating system, rather than the pure-Java implementation. Native socket readers use far more efficient techniques to determine if there is data to read on a socket. With a native socket reader implementation, reader threads do not need to poll inactive sockets—they service only active sockets, and they are immediately notified via an interrupt when a given socket becomes active. Note: The use of IP sockets in WebLogic Server extends beyond the cluster scenario—all RMI communication takes place using sockets, for example, when a remote Java client application accesses a remote object. 3-6 Using Clusters for Oracle WebLogic Server For instructions on how to configure the WebLogic Server host machine to use the native socket reader implementation for your operating system, see Section 10.2.18.1.1, Configure Native IP Sockets Readers on Machines that Host Server Instances.

3.1.3.2 Configuring Reader Threads for Java Socket Implementation