Wednesday, October 10, 2012

Setting memory parameters for servers in Fusion Applications

Please note the Fusion Applications A-Team Blog has moved.  This blog posting has been migrated to: http://www.ateam-oracle.com/setting-memory-parameters-for-servers-in-fusion-applications/


Note: The following article applies to Fusion Apps Release 4 (11.1.4 or RUP3) or lower. The procedure has changed in Release 5 (11.1.5 or RUP4) and I'll update the post soon with details.

Setting memory parameters for Admin and Managed servers of various domains in Fusion Applications can be, let us say, a little daunting.

As you might be aware, to change memory setting for a particular weblogic server instance, you need to modify fusionapps_start_params.properties file. 

Simple? Well, things get a little complicated from here on...

Depending on the offerings you choose to install, there can be 6-9 domains. Each of these domains can have managed servers distributed over various machines. On top of that, you can choose to enable local configuration in which case your admin servers' configuration resides on shared storage and managed servers' configuration resides on local storage. Each of these domain homes has its own copy of fusionapps_start_params.properties which specify the memory settings for various weblogic servers. Moreover, depending on the install type a domain could be main or non-main in which case you have to change the right property within the right file.

If all that were not enough, there is a provision to add platform specific settings! Right now, other than AIX-powerpc, all other platforms share the memory settings for default platform, but it may change in future.

While all this may look complicated and intimidating, it is actually relatively simple once you understand how it all works.

1. You send the request to start a server of a particular domain to the node manager running on that host.

2.  The node manager knows home directory of the domain on that server. It reads this information from <FA_BASE>/fusionapps/wlserver_10.3/common/nodemanager/<Hostname>/nodemanager.domains file

3. Node manager calls startManagedWeblogic located in DOMAIN_HOME/bin directory which sets off chained calls to setDomainEnv.sh, setFusionAppsDomainEnv.sh etc. to set up environment variables. All these files are located in DOMAIN_HOME/bin directory.

4. For memory settings, the most important ones to know are fusionapps_start_params.properties and the file which reads it to se the memory arguments - setFusionAppsDomainEnv.sh

5. Look at setFusionAppsDomainEnv.sh, and review the following 2 key functions:

lookupDomainNameAndType()
{
        # Looks up name of current domain
        lookupValueInternal fusion.default.domain.name CURRENT_DOMAIN_NAME
        # Looks up type of current domain
        lookupValueInternal fusion.default.domain.type CURRENT_DOMAIN_TYPE
}
 

lookupMinMaxMemory()
{ 
    # Looks up min max memory size for the current cluster
    CURRENT_MINMAXMEMORY=""
    export CURRENT_MINMAXMEMORY
    # Lookup default based on Platform-type.
    lookupValueInternal fusion.${CURRENT_DOMAIN_NAME}.${SVR_GRP}.${PLATFORM_TYPE}.minmaxmemory.${CURRENT_DOMAIN_TYPE} CURRENT_MINMAXMEMORY
    if [ "X${CURRENT_MINMAXMEMORY}" = "X" ] ; then
          # Lookup default of minmaxmemory if no Platform-type value could be found
          echo "Warning: Value not found for fusion.${CURRENT_DOMAIN_NAME}.${SVR_GRP}.${PLATFORM_TYPE}.minmaxmemory.${CURRENT_DOMAIN_TYPE}. Looking up default."
          lookupValueInternal fusion.${CURRENT_DOMAIN_NAME}.${SVR_GRP}.default.minmaxmemory.${CURRENT_DOMAIN_TYPE} CURRENT_MINMAXMEMORY
          if [ "X${CURRENT_MINMAXMEMORY}" = "X" ] ; then
                # Lookup default based on domain type.
                echo "Warning: Value not found for fusion.${CURRENT_DOMAIN_NAME}.${SVR_GRP}.default.minmaxmemory.${CURRENT_DOMAIN_TYPE}. Looking up default."
                lookupValueInternal fusion.default.default.default.minmaxmemory.${CURRENT_DOMAIN_TYPE} CURRENT_MINMAXMEMORY
          fi
    fi
    echo "Effective min/max memory for ${SVR_GRP}: ${CURRENT_MINMAXMEMORY}"
}


6. The first function reads the value of property fusion.default.domain.name from fusionapps_start_params.properties file. This property specifies the name of the domain for which memory values have to be read. It also reads the value of property fusion.default.domain.type. This property can have one of 2 values - main and nonmain.

7. The second function is the one which actually reads and set memory arguments for a particular server. It uses the values derived from previous function to lookup a particular line in fusionapps_start_params.properties file.

So now that we know how the values are derived, we can figure out which file to modify. The file that you need to modify is:

<CONFIG_HOME>/domains/<HOST_NAME>/<CURRENT_DOMAIN_NAME>/bin/fusionapps_start_params.properties

Where

CONFIG_HOME => 

a. For AdminServer -> Shared config home
b. For Managed Servers -> Shared config home, if "Enable local application configuration" was not chosen during provisioning. Otherwise, Local config home.

HOST_NAME =>

Hostname of the machine where the server is deployed

CURRENT_DOMAIN_NAME =>

Name of the domain in which the server is deployed. e.g. CommonDomain, SCMDomain etc.


The property you need to modify is:

fusion.${CURRENT_DOMAIN_NAME}.${SVR_GRP}.${PLATFORM_TYPE}.minmaxmemory.${CURRENT_DOMAIN_TYPE}

Where

CURRENT_DOMAIN_NAME =>

The domain to which the managed server belongs

SVR_GRP =>

a. For AdminServer -> AdminServer
b. For Managed Server -> Cluster to which Managed Server is deployed

PLATFORM_TYPE =>

Currently, it can either be AIX-powerpc or default

CURRENT_DOMAIN_TYPE =>

main or nonmain depending on the value of fusion.default.domain.type in the relevant fusionapps_start_params.properties file


You can now set the initial memory allocated to a server and the maximum allowable memory by modifying the -Xms and -Xmx values.

Note: Since the local configuration directory is local to a particular host, you have to be logged in to that host to make the change. Changes to files in shared configuration directory can be made from any host provided you get the path right.


To make sure you understand it, here are a few exercises. 

Let us say you have followed Enterprise Deployment Guide (EDG) to setup your environment on Linux platform. In this case, you chose to "Enabled Local Application Configuration" and have the following directory structure:



























































Also, you have deployed CommonDomain, HCMDomain, SCMDomain and BIDomain on fahost01.mycompany.com; and CRMDomain, FinancialsDomain and ICDomain on fahost02.mycompany.com. 

In this example, CommonDomain, CRMDomain and ICDomain are installed as main and rest are deployed as nonmain.

Which file and property within that file will you modify if you have to change memory settings for:

1. AdminServer in CommonDomain

2. AdminServer in CRMDomain

3. HomePageServer_1 in CommonDomain

4. FinancialCommonServer_1 in FinancialsDomain

5. soa_server1 in SCMDomain

6. CRMCommonServer_1 in CRMDomain


Scroll down for answers.


.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.



Answers:

1.  AdminServer in CommonDomain:

File: /u01/oracle/config/domains/fahost01.mycompany.com/CommonDomain/bin/fusionapps_start_params.properties

Property: fusion.CommonDomain.AdminServer.default.minmaxmemory.main

2. AdminServer in CRMDomain:

File: /u01/oracle/config/domains/fahost02.mycompany.com/CRMDomain/bin/fusionapps_start_params.properties

Property: fusion.CRMDomain.AdminServer.default.minmaxmemory.main

3. HomePageServer_1 in CommonDomain:

File: /u02/local/oracle/config/domains/fahost01.mycompany.com/CommonDomain/bin/fusionapps_start_params.properties
Property: fusion.CommonDomain.HomePageCluster.default.minmaxmemory.main
4. FinancialCommonServer_1 in FinancialsDomain:

File: /u02/local/oracle/config/domains/fahost02.mycompany.com/FinancialsDomain/bin/fusionapps_start_params.properties
Property: fusion.FinancialDomain.FinancialCommonCluster.default.minmaxmemory.nonmain

5. soa_server1 in SCMDomain:

File: /u02/local/oracle/config/domains/fahost01.mycompany.com/SCMDomain/bin/fusionapps_start_params.properties
Property: fusion.SCMDomain.SCM_SOACluster.default.minmaxmemory.nonmain
6. CRMCommonServer_1 in CRMDomain:

File: /u02/local/oracle/config/domains/fahost02.mycompany.com/CRMDomain/bin/fusionapps_start_params.properties
Property: fusion.CRMDomain.CRMCommonCluster.default.minmaxmemory.main


If you got all 6 correct, you are all set. If you got 5 correct, I'll give you the benefit of doubt. 

If you got 4 or less right, please drop a comment and I'll try to make the post better and easier to follow.

3 comments:

  1. Can you share RUP4 steps..?

    ReplyDelete
  2. Hi A-Team,

    It is mentioned above that "Note: The following article applies to Fusion Apps Release 4 (11.1.4 or RUP3) or lower. The procedure has changed in Release 5 (11.1.5 or RUP4) and I'll update the post soon with details.
    "

    Please share the procedure for RUP4. We have recently upgraded and need to know more on this.
    TIA

    ReplyDelete