IBM Support

Configuring the WebContainer and database connection pool sizes for a WebSphere Commerce server

Question & Answer


Question

How do I configure the WebContainer pool and the database connection pool sizes for a WebSphere Commerce server?

Answer

The WebContainer pool and the database connection pool are two configurable WebSphere Application Server components that can have a important impact in the performance and stability of your WebSphere Commerce site.
The information is organized into the following sections:




WebContainer Thread Pool

The size of the WebContainer thread pool determines the number of web container threads that can run concurrently in the WebSphere Commerce JVM. See the WebSphere Application Server considerations page for details about the appropriate configuration for your site.



Configuring the WebContainer thread pool using the WebSphere Administrative Console

Follow these steps to configure the WebContainer thread pool using the WebSphere Administrative console:

  1. Login to the WebSphere Application Server administrative console.
  2. Click Servers > Application Servers.
  3. Select your server.
  4. Under "Additional Properties" click Thread Pools.
  5. Select the WebContainer thread pool.
  6. This page will display the minimum and maximum sizes for the WebContainer Thread Pool.
    Ensure that "Allow thread allocation beyond maximum thread size" check box is clear.
  7. Use this page to update the values if required.
  8. If you are using a clustered environment, repeat these steps for all the servers in your cluster.


Determining the WebContainer thread pool sizes using the configuration files

Follow these steps to determine the configured sizes for the WebContainer thread pool using the xml configuration files.

  1. Locate the server.xml file under this location:


    WAS_installdir
    /profiles/profile_name/config/cells/cell_name/nodes/node_name/servers/WAS_server_name/server.xml


    WAS_userdir/
    profiles/profile_name/config/cells/cell_name/nodes/node_name/servers/WAS_server_name/server.xml
  2. Open server.xml in a text editor
  3. An entry similar to the following will show the configured values for the WebContainer thread pool.
    <threadPools xmi:id="ThreadPool_1186161170688" minimumSize="25" maximumSize="25" inactivityTimeout="3500" isGrowable="false" name="WebContainer"/>
  4. Ensure isGrowable is set to false.

If you are required to update the configuration, do not update server.xml directly. Instead, use the WebSphere Administrative Console.



Database Connection Pool

Maximum Connection Pool Size

When determining the maximum size of the database connection pool, consider the following issues:

  • The total number of connections that the WebSphere Commerce cluster can open to the database should not overwhelm your database.
  • In order to prevent deadlocks, there should be connections available for all the threads that might require one. It is not only the web container that uses database connections. The following equation can help you determine the maximum number of database connections you should allow:

    DataSource Connection Pool Size >=
    (# Of WebContainer Threads)
    + (# Of WC Scheduler Threads)
    + 1 (for WC Key Manager)
    + 1 (for WC Auditing)
    + (# of Parallel and Serial MQ listener threads)
    + (# of non-WebContainer Threads used by Custom Code)

    In order to satisfy the rule that all the threads have connections available, you might need to either increase the number of database connections or reduce the number of WebContainer and other threads.

Minimum Connection Pool Size

The default value of the minimum connection pool size is 5 .This value is appropriate to most configurations. If you have a firewall configured between the WebSphere Application Server nodes and the database, you should follow the technote on How to configure WebSphere data source parameters when a firewall is present and configure the firewall to ensure it doesn't interfere with the connections.

For more information see the WebSphere Application Server considerations page of the WebSphere Commerce Version 6.0 Information Center for details about the appropriate configuration for your site.



Configuring the database connection pool using the WebSphere Administrative Console

Follow these steps to configure the WebContainer thread pool using the WebSphere Administrative console:

  1. Login to the WebSphere Application Server administrative console.
  2. Click Resources > JDBC Providers.
  3. Select your server.
  4. Select the JDBC provider for WebSphere Commerce.
    instance_name - WebSphere Commerce JDBC Provider
  5. Under "Additional Properties" click Data sources.
  6. Select the data source for WebSphere Commerce.
    WebSphere Commerce {database_type} DataSource instance_name
  7. Under "Additional Properties" click Connection Pool properties.
  8. This page displays the connection pool properties for the data source.
  9. Use this page to update the values if required.


Determining the database connection pool sizes using the configuration files

Follow these steps to determine the configured sizes for the database connection pool using the xml configuration files:

  1. Locate the resources.xml file under this location:


    WAS_installdir
    /profiles/profile_name/config/cells/cell_name/nodes/node_name/servers/WAS_server_name/resources.xml


    WAS_userdir/
    profiles/profile_name/config/cells/cell_name/nodes/node_name/servers/WAS_server_name/resources.xml
  2. Open resources.xml in a text editor
  3. A node named connectionPool shows the connection pool properties. Ensure this node belongs to the Commerce DataSource.

    <factories xmi:type="resources.jdbc:DataSource" xmi:id="DataSource_1186161738750" name="WebSphere Commerce Oracle DataSource demo" jndiName="jdbc/WebSphere Commerce Oracle DataSource demo" description="WebSphere Commerce Oracle DataSource demo" authMechanismPreference="BASIC_PASSWORD" authDataAlias="WC_demo - authDataAlias" relationalResourceAdapter="builtin_rra" statementCacheSize="50" datasourceHelperClassname="com.ibm.websphere.rsadapter.Oracle10gDataStoreHelper">
     ...
     
    <connectionPool xmi:id="ConnectionPool_1186161741031" connectionTimeout="180" maxConnections="55" minConnections="0" reapTime="180" unusedTimeout="1800" agedTimeout="1800" purgePolicy="EntirePool"/>
       ...
    </factories>

If you are required to update the configuration, do not update resources.xml directly. Instead, use the WebSphere Administrative Console.



Recommended starting values for the WebContainer and database connection pool sizes

The following table lists recommended starting values for configuring the WebContainer and database connection pool sizes. The optimal configuration in your system might be different. Finding the best configuration for your environment can only be done by completing a performance tuning exercise.


Minimum
Maximum
WebContainer
25
25
Database Pool
0
55

The values were determined following these considerations:
  • The WebContainer minimum and maximum sizes are configured to be the same to avoid the overhead of creating and destroying threads.
  • A value of 25 for the WebContainer is usually enough to allow high throughput and concurrency without overloading the server.
  • The database pool is configured to ensure there will be enough connections available for all the WebContainer threads.
  • The minimum value of the database pool is set to 0 to prevent firewall related problems and avoiding
    maintaining unused connections.

[{"Product":{"code":"SSYSYL","label":"WebSphere Commerce Enterprise"},"Business Unit":{"code":"BU012","label":"WCE"},"Component":"Configuration","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF012","label":"IBM i"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;6.0","Edition":"Enterprise"},{"Product":{"code":"SSZMJX","label":"WebSphere Commerce - Express"},"Business Unit":{"code":"BU012","label":"WCE"},"Component":"Configuration","Platform":[{"code":"","label":"i5\/OS"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"7.0;6.0","Edition":"Express"},{"Product":{"code":"SSPK6A","label":"WebSphere Commerce Professional"},"Business Unit":{"code":"BU012","label":"WCE"},"Component":"Configuration","Platform":[{"code":"PF002","label":"AIX"},{"code":"","label":"i5\/OS"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;6.0","Edition":"Professional Edition"}]

Document Information

Modified date:
16 June 2018

UID

swg21358336