IBM Support

Setting the WebSphere Application Server WebContainer to synchronous mode

Technote (troubleshooting)


Problem(Abstract)

The WebContainers use of asynchronous data transfer may use a large number of buffers in native memory to write an application response. This predominately occurs when large application responses are being transferred (for example a PDF, large images, the dmgr updating the nodeagents, ,etc) but may also occur with normal size application responses. If the amount of native memory used by this is too large, we can enable synchronous mode which will reduce the amount of memory used to store responses.

Cause

A new feature was added to the WebContainer to allow the sending of response data asynchronously as a performance enhancement. Unfortunately, this can require the allocation of enough native memory buffers to hold the entire response data being transferred (java.nio.DirectByteBuffer's).

Depending on the size of the applications responses and the user load, this may require a large amount of memory (large native memory footprint). If the connection to the users is slow, then the data will take longer to transfer and the response needs to be kept in native memory until the transfer has been completed, compounding the problem.
This feature is in WebSphere Application Server 6.0.2.19 and above, 6.1.0.7 and above and all levels of 7.0.


Environment

WebSphere Application Server 6.0.2.21 and higher, 6.1.0.11 and higher, all 7.0, 8.0, 8.5, and 8.55

Diagnosing the problem

IBM Support will be able to tell you if you are seeing an issue with native memory, and may recommend setting the WebContainer thread pool to use synchronous writes for response data to reduce the native memory footprint.

Resolving the problem

A Java property can be set which will force the data transfer to be synchronous rather than asynchronous. Since the asynchronous transfer is generally faster, at least for small files, the use of synchronous transfer may result in a performance impact. This performance impact will be different for each application and user load, but would be far outweighed by the performance impact of the extra memory used by all of the buffers allocated by the asynchronous transfer algorithm.

This property was added in later 6.0.2 and 6.1 Application Server Fix Packs, so you may need to upgrade your Application Server installation before setting the property.

  1. Check if your Application Server installation is at least at 6.0.2.21 or 6.1.0.11 or any level of 7.0 and higher, depending on which version of WebSphere Application Server you are on. If not, please install one of the Fix Packs to get your installation up to that level or more recent.

  2. Set the channelwritetype property to use synchronous data transfer (sync):

    For an application server
    In the Admin Console:
    Servers -> Application Servers -> serverName -> Web Container Settings -> Web Container -> Custom Properties:
    Press New:
    Add the following pair:
      Name: com.ibm.ws.webcontainer.channelwritetype
      Value: sync
    Press OK, and then save the configuration.

    The application server must be recycled to pick up the property.

    For a deployment manager
    Start an interactive wsadmin session:
    <dmgr-profile-root>\bin>wsadmin -lang jacl

    Copy the following block of lines, then paste them all at once at the wsadmin> prompt:
    set dmgr [$AdminConfig getid /Server:dmgr/]
    set webcontainer [$AdminConfig list WebContainer $dmgr]
    $AdminConfig create Property $webcontainer {{name com.ibm.ws.webcontainer.channelwritetype} {value sync}} properties
    $AdminConfig show $webcontainer
    $AdminConfig save

    The deployment manager must be recycled to pick up the property.


    To remove the setting from the deployment manager
    Start an interactive wsadmin session:
    <dmgr-profile-root>\bin>wsadmin -lang jacl

    Copy the following block of lines, then paste them all at once at the wsadmin> prompt:
    set dmgr [$AdminConfig getid /Server:dmgr/]
    set allproperty [$AdminConfig list Property $dmgr]
    foreach prop $allproperty {
      set propName [$AdminConfig showAttribute $prop name]
      if {$propName == "com.ibm.ws.webcontainer.channelwritetype"} {
        $AdminConfig remove $prop
        $AdminConfig save
      }
    }

    The deployment manager must be recycled to pick up the removed property.

Document information

More support for: WebSphere Application Server
Out of Memory

Software version: 6.0.2.21, 6.1.0.11, 7.0, 8.0, 8.5, 8.5.5, 9.0

Operating system(s): AIX, HP-UX, Linux, Solaris, Windows

Reference #: 1317658

Modified date: 17 September 2008


Translate this page: