Sunday, 24 June 2012

Configuring Coherence for Spaces Content Presenter PS4


Reason:
Coherence is becoming the strategic caching method for Webcenter. OOTB it is not enabled for the content presenter integration on top of PS4.
This was tested on PS4 with BundlePatch4 installed running on linux x86-64.

Steps:
Download the Jdeveloper project from George Maggessy’s blog. The approach on the original post is for WebCenter Portal.

For now we have a manual deployment process. This should be enhanced via Jdev deployment.

Copy content-coherence-cache-config.xml to your Spaces Customization Project in a new folder called APP-INF/classes

These folders should be created at the same level as META-INF.
Edit the deployment properties of the application and include the new folders in the deployment.
Redeploy the project against Spaces.
*Within the server this will copy the file to this location:
$MW_HOME/user_projects/applications/[your_domain]/custom.webcenter.spaces.fwk/APP-INF/classes
(it will create these folders and copy the file here, if you want a quick test, you can copy this file here)

Add the JVM startup parameter to your setDomainEnv.sh  ($DOMAIN_HOME/bin). Remember to do this for every machine.
Since it’s a big file I recommend you make edits in a separate file.

Search for this comment
# If you want to override the default Patch Classpath, Library Path and Path for this domain,

Add the following line below it.
. ${DOMAIN_HOME}/bin/setCustomProperties.sh

Now let’s create this file. In the bin folder directly.
nano setCustomProperties.sh

You can include entries depending on your environment. It is recommended to have a domain bin process to push all files to your TEST-UAT-PROD servers to ensure they always match.
For clustered solutions try the below. (if you are viewing this article you are most likely scaling and clustered anyway, in our case we had 4 nodes, modify this statement to reflect your managed server names and numbers)
COHERENCE_JAVA_PROPERTIES=" -Dtangosol.coherence.management=all"

if [ "${SERVER_NAME}" = "WC_Spaces1" ] ; then
    EXTRA_JAVA_PROPERTIES=" ${COHERENCE_JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES} "
elif [ "${SERVER_NAME}" = "WC_Spaces2" ] ; then
    EXTRA_JAVA_PROPERTIES=" ${COHERENCE_JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES} "
elif [ "${SERVER_NAME}" = "WC_Spaces3" ] ; then
    EXTRA_JAVA_PROPERTIES=" ${COHERENCE_JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES} "
elif [ "${SERVER_NAME}" = "WC_Spaces4" ] ; then
    EXTRA_JAVA_PROPERTIES=" ${COHERENCE_JAVA_PROPERTIES} ${EXTRA_JAVA_PROPERTIES} "
fi

export EXTRA_JAVA_PROPERTIES

You may save and close the file.
Remember to chmod 755 setCustomProperties.sh so the server can execute it.
(or lower depending on your security concerns)
If you encounter weird errors on Spaces startup, run this cmd:
Dos2unix setCustomProperties.sh
This should remove weird characters that can interfere with WLS.

We are finally ready to restart spaces.
Start WC_Spaces in WLS Console.
*If you are clustering I recommend you start 1 node only at this point.
Let’s walk before we run.

Next we want to confirm that after starting spaces the change is initialised.
*prerequisite: Setup xming for putty

First let’s look for the Spaces process once it has been restarted via WLS console.
ps -eaf | grep WC_Spaces
You can verify that the entry
-Dtangosol.coherence.management=all
Is shown in the JVM start parameters.

Get the first number from this cmd it’s the Spaces PID.
Then cd to the java location in that cmd as well.
Eg) cd /apps/oracle/java/jrockit-jdk1.6.0_26/bin/
Then type
Jconsole [PID]
*lookout for an upcoming post on jvisualvm and jconsole for more info on monitoring webcenter.

You can use this tool to monitor performance, and in this case check that coherence has been initialised against spaces. Click on the MBeans tab, coherence should show at the top.



Then you can proceed to load WebCenter spaces pages with content presenters. In general performance should improve and be measured against page load time with at least over 200-1000 concurrent test users. As you increase test users, continue to monitor UCM query responses.

If you still have performance issues, ensure your DB is doing the right thing. Is memory allocation within the DB correct for the total memory, is the DB shared? Are nightly stat run to optimize the DB?