Java Object Cache in a clustered WebCenter Portal (Spaces) environment

This article was originally written by Yannick Ongena, reviewed and updated by Lyudmil Pelov.

Introduction

With WebCenter Spaces, it is highly recommended to configure the Java Object Cache (JOC). The JOC is used to increase performance and more information can be obtained by reviewing the following section of the Enterprise Deployment Guide.

In a clustered environment, the JOC is responsible for caching and synchronizing java objects between the managed servers in a cluster. The JOC has a distributor per machine that will distribute the java objects to the other machines in the cluster; or alternatively JOC can work independently in a local cache only.

The WebCenter Portal documentation defines that the configuration of each JOC instance for each Portal Managed Server is done by executing a specific python based script (configure-joc.py). However, depending on the topology of the cluster, the configuration (file) that is generated from the script, may contribute to producing an issue with stuck threads! It is important to understand that whenever a cluster has more than one WebCenter Portal Managed Server installed on the same (physical) machine, a manual modification to the auto-generated JOC configuration file may have to be done. The reason is that the script will create one JOC distributor per managed server. However, each machine should have only one distributor. Basically, all WebCenter Portal Managed Servers on the same machine should use the same JOC configuration (e.g. distributor).

Main Article

For example, suppose we have a topology where WebCenter Portal is configured in a cluster of 2 machines and each machine has 2 managed servers as shown in following diagram:

joc_001

When executing the python script, which creates the JOC configuration and enables the distribution, the resultant will produce 4 different JOC configuration files. The configuration file (javacache.xml) for each managed server instance can be found under the [domain-home]/config/servers/[Server-Name] directory.

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>

<cache-configuration xmlns="http://www.oracle.com/oracle/ias/cache/configuration11" max-objects="5000" max-size="10" private="false" cache-dump-path="jocdump" system="false" clean-interval="60">
    <communicationService enabled="true">
        <v2 ssl-config-file=".sslConfig" init-retry="300" init-retry-delay="2000" enable-ssl="false" auto-recover="false">
            <packet-distributor enable-router="false" startable="true" dedicated-coordinator="false">
                <listener-address host="host1" port="9988" ssl="true"/>
                <distributor-location host="host1" port="9988" ssl="true"/>
                <distributor-location host="host2" port="9988" ssl="true"/>
                <distributor-location host="host1" port="9987" ssl="true"/>
                <distributor-location host="host2" port="9987" ssl="true"/>
            </packet-distributor>
        </v2>
    </communicationService>
    <diskCache size="10" ping-interval="60"/>
    <logging override-parent="false" location="javacache.log" default-level="SEVERE"/>
    <dms enabled="false"/>
</cache-configuration>

Notice that in this example, the configuration file lists a different listener-address. However, this configuration also lists 4 distributorsThe additional 2 (for this example) entries has been determined to cause stuck threads. These stuck threads can cause your managed servers to crash.

The correct configuration for this example cluster topology should be:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<cache-configuration xmlns="http://www.oracle.com/oracle/ias/cache/configuration11" max-objects="5000" max-size="10" private="false" cache-dump-path="jocdump" system="false" clean-interval="60">
   <communicationService enabled="true">
     <v2 ssl-config-file=".sslConfig" init-retry="300" init-retry-delay="2000" enable-ssl="false" auto-recover="false">
	<packet-distributor enable-router="false" startable="true" dedicated-coordinator="false">
	    <listener-address host="host1" port="9988" ssl="true" />
	    <distributor-location host="host1" port="9988" ssl="true" />
	    <distributor-location host="host2" port="9988" ssl="true" />
	</packet-distributor>
      </v2>
   </communicationService>
  <diskCache size="10" ping-interval="60" />
  <logging override-parent="false" location="javacache.log" default-level="SEVERE" />
  <dms enabled="false" />
</cache-configuration>

There should be no difference between the javacache.xml from WC_Spaces1 and WC_Spaces2. WC_Spaces3 and WC_Spaces4. All instances of WebCenter Spaces should use the same configurations with the exception of the listener address: host2 listening to host1 and vice versa.

JOC can also work as a local cache only.  In some situations were firewalls are very restrictive, it is recommended to utilize the local cache approach. To configure this option, remove the distributor-location from the configuration file as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cache-configuration xmlns="http://www.oracle.com/oracle/ias/cache/configuration11" max-objects="5000" max-size="10" private="false" cache-dump-path="jocdump" system="false" clean-interval="60">
    <communicationService enabled=“true">
        <v2 ssl-config-file=".sslConfig" init-retry="300" init-retry-delay="2000" enable-ssl="false" auto-recover="false">
            <packet-distributor enable-router="false" startable="true" dedicated-coordinator="false">
                <listener-address host="host1" port="9988" ssl="true"/>
            </packet-distributor>
        </v2>
    </communicationService>
    <diskCache size="10" ping-interval="60"/>
    <logging override-parent="false" location="javacache.log" default-level="SEVERE"/>
    <dms enabled="false"/>
</cache-configuration>

For more information about each of the JOC parameters, take a look in the following documentation: https://docs.oracle.com/cd/B14099_19/web.1012/b14012/objcache.htm. Further information can be found in the Oracle Fusion Middleware High Availability Guide in the Configuring the Distributed Java Object Cache section.

 

Add Your Comment