BEA Logo BEA WebLogic Commerce Server Release 3.1.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   WebLogic Commerce Server Doc Home   |   Tuning Guide   |   Previous Topic   |   Next Topic   |  

Performance Tuning Guide

 

When you first install BEA WebLogic Commerce Server and Personalization Server, it is configured to support Web-site developers and administrators. For example some caching mechanisms are disabled so developers can see the results of their modifications immediately.

When you are ready to make your Web site available to customers, refer to WebLogic Server Performance Tuning Guide for information about tuning WebLogic Server.

Then, for information about tuning WebLogic Commerce Server and Personalization Server performance, refer to the following topics in this document:

 


Adjust the Intervals for Checking JSP and Servlet Modifications

By default, each time a Web browser requests a JSP, Commerce Server checks for any modifications to the JSP source file. Likewise, each time Commerce Server sends a request to a servlet, it checks for any modifications to the servlet class files.

For your production Web site, you can decrease the amount of time in which Commerce Server serves JSPs and processes requests to servlets by increasing the intervals at which the server checks for modifications.

Although Commerce Server performs faster with higher values for the modification-check intervals, the higher values reduce sensitivity to changes in your source files. For example, you can set the server to check for JSP modifications every 10 minutes. After you change a JSP, it will take up to 10 minutes for the server to see the modifications.

This section includes the following topics:

About the Page-Check Intervals Properties

Two properties determine the interval at which WebLogic Server checks to see if JSP files have changed and need recompiling:

About the Reload-Servlet Interval Property

The weblogic.servlet.reloadCheckSecs context parameter in a web app's deployment descriptor (web.xml file) specifies the interval in seconds that the web app checks for modified servlet classes.

The following excerpt from WL_COMMERCE_HOME\server\webapps\web-inf\web.xml shows the weblogic.servlet.reloadCheckSecs context parameter in boldface text with the default value:

<context-param>
<param-name>weblogic.servlet.reloadCheckSecs</param-name>
<param-value>600</param-value>
</context-param>

To Adjust the Intervals

To determine the optimal page-check and reload-servlet intervals for your production Web site do the following:

  1. Establish performance baselines by testing Commerce Server performance with all three intervals set to -1 (which specifies that the server never checks for modifications).

  2. Test the performance with the intervals set to various numbers of seconds. For example, set the intervals to 600 seconds (10 minutes) and test the performance. Then set the intervals to 900 seconds and test the performance.

  3. Choose intervals that provide the best performance while checking for modifications to JSP files and servlet classes at a satisfactory rate.

For More Information

For more information about configuring JSP and servlet options for WebLogic Server, see the following topics on the WebLogic Server documentation Web site:

 


Adjust Database Connections Available at Startup

To optimize the database pool performance for your production web site, open $WL_COMMERCE_HOME/weblogic.properties and modify the values for the following weblogic.jdbc.connectionPool.commercePool properties:

For example:

weblogic.jdbc.connectionPool.commercePool=\
url=jdbc:oracle:thin:@server:port:instance,\
driver=oracle.jdbc.driver.OracleDriver,\
loginDelaySecs=0,\
initialCapacity=maxCapacity,\
maxCapacity=20,\
capacityIncrement=1,\
allowShrinking=false,\
shrinkPeriodMins=15,\
testConnsOnReserve=false,\
props=user=user;password=pwd,\
refreshMinutes=5

For More Information

For more information on database connection pools, see "Creating and Using Connection Pools" on the WebLogic Server documentation Web site and "Setting Up Connection Pools" under "Creating and Managing Content" in Personalization Server User's Guide.

 


Set the Reload Policy for Rules

You can determine the frequency with which Personalization Server checks for changes to rules by doing the following:

  1. Open $WL_COMMERCE_HOME/lib/rulesservice.jar.

  2. In ejb-jar.xml (which is in rulesservice.jar), modify the value for rulesetReloadInterval. The value expresses the number of milliseconds that Personalization Server waits before checking for changes to rules. For example:

    <env-entry>
    <env-entry-name>rulesetReloadInterval</env-entry-name>
    <env-entry-type>java.lang.String</env-entry-type>
    <env-entry-value>300000</env-entry-value>
    </env-entry>

Personalization Server performs faster with a higher value for the reload interval, however, the higher reload value reduces sensitivity to rule changes.

If you shut down and restart your production servers when you make changes to your site, you can boost performance by setting the reload policy in ejb-jar.xml (which is in rulesservice.jar) to reloadNever. For example:

<env-entry>
<env-entry-name>rulesetReloadPolicy</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>
reloadNever</env-entry-value>
</env-entry>

If you set the reload policy to reloadNever, Personalization Server does not recognize changes to rules until you restart the server.

For More Information

For more information about rules, see "Creating and Managing Rules" in Personalization Server User's Guide.

 


Adjust Caching

To adjust caching for production Web site, complete the following tasks:

Adjust and Use the Session and Global Caches

In a clustered environment, you can improve scalability and performance by minimizing the use of HttpSession objects. (HttpSession is part of the JDK session-tracking mechanism, which servlets use to maintain state about a series of requests from the same user.)

To minimize using HttpSession, each server in the WebLogic Commerce Server and Personalization Server cluster provides the following caches:

This section discusses the following topics:

For More Information

For more information about how WebLogic Commerce Server and Personalization server process HTTP requests, refer to "Foundation Classes and Utilities" in Personalization Server Developer's Guide. For more information about HttpSession, see http://java.sun.com/products/servlet/2.2/javadoc/javax/servlet/http/HttpSession.html. For more information about WebLogic Server clusters, see Using WebLogic Server Clusters.

Enabling the Caches

To enable the session and global caches, add the following properties to $WL_COMMERCE_HOME/weblogiccommerce.properties:

_sessionCache.ttl=900000
_sessionCache.capacity=10000
_sessionCache.enabled=true

_globalCache.ttl=600000
_globalCache.capacity=1000
_globalCache.enabled=true

The ttl (time to live) property determines the number of milliseconds that the server maintains the cache. The capacity property determines the maximum number of objects in the cache. (Both session and global are in-memory caches.) The enabled property determines whether the cache is activated. A false value deactivates the cache and obviates the ttl and capacity properties; true activates it.

You can increase or decrease values for ttl and capacity based on the amount of available memory and the level of performance you desire.

Note: Each server in a cluster maintains its own set of caches, each of which must be configured separately by modifying the server's weblogiccommerce.properties file. Because the session and global caches are not replicated across servers in the cluster, if a server fails, the data in its caches is inaccessible. For guidelines about which types of data to place in the session and global caches, see Guidelines for Placing Data in HttpSession, Session Cache, or Global Cache.

JSP Tags for Accessing HttpSession and the Session and Global Caches

Use the following JSP tags from the FlowManager tag library to place, retrieve, and remove data from HttpSession as well as the session and global caches:

For information about these tags, refer to "JSP Tag Library Reference" in Personalization Server Developer's Guide.

An API for Accessing HttpSession and the Session and Global Caches

Use the following methods of the com.beasys.commerce.foundation.flow.helper.FlowManagerHelper API to place, retrieve, and remove data from HttpSession and the session and global caches:

For information about these methods, refer to the documentation for com.beasys.commerce.foundation.flow.helper.FlowManagerHelper in WebLogic Personalization Server Javadoc.

Guidelines for Placing Data in HttpSession, Session Cache, or Global Cache

In general, place only the following in HttpSession:

Place any information that multiple users require (either within the same application or across multiple applications) in the global cache.

Place all other session-related information in the session cache.

Adjust Caching for Content Management

To optimize content-management performance for your production Web site, configure Personalization Server as follows:

For More Information

For more information about content management, see "Creating and Managing Content" in Personalization Server User's Guide.

For more information about JSP tags for content management, see "JSP Tag Library Reference" in Personalization Server Developer's Guide.

Enable Property Caching

The WebLogic Server Configurable Entity and Entity Property Manager provide several in-memory caches that you can enable for WebLogic Commerce Server and Personalization Server. The caches decrease the amount of time needed to access user, group, and other properties, but introduce the possibility of stale data.

This section discusses the following topics:

Property Caching in a Clustered Environment

With property caching enabled in a clustered environment, each server in a cluster maintains its own cache; the cache is not replicated on other servers. In this environment, when properties that are stored in the defaultPropertyCache, entityPropertyCache, directPropertyManager, or ldapPropertyCache change on one server, they may not change on another server in a timely fashion.

In most cases, immediate or quick access to properties on another server is not necessary: user sessions are pinned to a single server, and even with caching enabled, users immediately see changes they make to their own settings on the server.

However, if a server fails and loses the data in its caches, modifications to properties may be lost, depending on the longevity of the property cache. In addition, if an administrator changes a user's properties, the user may not see the changes during her session if she and the administrator are pinned to different servers in the cluster.

You can mitigate these situations by specifying a small ttl (time-to-live) setting when you enable the caches. The small ttl setting provides performance gains by caching data, but the short-lived caches increase the rate at which property changes are replicated across servers.

If you require multiple servers in a cluster to have immediate access to modified properties, disable property caching by adding the entries described in To Enable Property Caching and specifying false for the unifiedProfileTypeCache.enabled value.

To Enable Property Caching

To enable property caching, add the following entries to WL_COMMERCE_HOME\weblogiccommerce.properties, adjusting the values based on the number of properties in your property sets and the frequency with which you want the data updated:

Note: These entries enable in-memory caching. Caches that grow exceedingly large may degrade performance.

For More Information

For more information about property sets, see "Creating and Managing Property Sets" in Personalization Server User's Guide.

For more information about JSP tags for managing property sets, see "JSP Tag Library Reference" in Personalization Server Developer's Guide.

Enable Group Caching

In systems with a deep group hierarchies, you can improve performance using group caching, which precalculates group membership information and stores the calculation results in a new database table, WLCS_USER_GROUP_CACHE. Any queries that are submitted while group caching is recalculating data return the old, previously committed data.

With group caching, you exchange faster performance for the risk of stale or inconsistent data. To balance performance with data consistency, you can configure the interval at which the caching mechanism recalculates and updates the table.

This section contains the following topics:

Group Caching in a Clustered Environment

To improve performance of group caching in a cluster, you can establish one cache as the master. The server with the master cache periodically updates its WLCS_USER_GROUP_CACHE table. All other servers in the cluster read this master table; they do not update the table or maintain their own copy. For information on setting up a master cache, refer to To Enable and Configure the Group Cache.

To Set Up the Group-Cache Table

To set up the table for group caching, issue the following SQL commands:

CREATE TABLE WLCS_USER_GROUP_CACHE ( USER_NAME VARCHAR2(100) NOT NULL,

GROUP_NAME VARCHAR2(100) NOT NULL );

ALTER TABLE WLCS_USER_GROUP_CACHE

ADD CONSTRAINT WLCS_USER_GROUP_CACHE_INDEX PRIMARY KEY ( USER_NAME,

GROUP_NAME );

To Enable and Configure the Group Cache

To enable the group cache, add all of the following lines to $WL_COMMERCE_HOME/weblogic.properties:

In a clustered environment, to create a master cache, specify weblogic.system.startupArgs.GroupCache=updateDb=true for one server and weblogic.system.startupArgs.GroupCache=updateDb=false for all other servers in the cluster.

To configure the number of seconds that the server waits before calculating and updating the table, change the value for following WebLogic Server property:
weblogic.security.realm.cache.group.ttl.positive

Note: You do not need to specify the size of the group cache.The depth of the group hiearchies determines the size of the group cache table.

To Access Data in the Group Cache Table

To access data in the group cache table, use any of the following:

For more information about these methods, refer to WebLogic Personalization Server Javadoc.

 


Adjust Portal and Portlet Settings While Load Testing

If you are testing the performance of the portal framework, do the following:

For More Information

For more information about managing portals, see "Creating and Managing Portals" in Personalization Server User's Guide.

For more information about developing portlets, see "Developing Portlets" in Personalization Server Developer's Guide.

 


Display Metadata, Sort and Query Explicit Metadata

If you used the BulkLoader to load document metadata into the reference implementation document database, you can improve document management performance when retrieving documents by doing the following:

For More Information

For more information about content management, see "Creating and Managing Content" in Personalization Server User's Guide.

 


Use LDAP for Authentication Only

For improved performance, use LDAP for authentication only; do not use it to retrieve user and group properties. Instead of retrieving properties from LDAP servers, configure your system to use properties stored in the RDBMS by minimizing the number of properties registered for retrieval from LDAP in the user management tools.

For More Information

For more information about changing LDAP settings, see "Using Other Realms" under "Creating and Managing Users" in Personalization Server User's Guide.

 


Use the DocumentManager EJB

Always use a DocumentManager EJB instead of Document EJB. Document EJBs are deprecated.