Tuning the Gateway to avoid out-of-memory conditions

The CICS® Transaction Gateway statistics provide information to help you avoid out-of-memory conditions.

You can use the statistics that are generated by CICS Transaction Gateway to establish whether the amount of available virtual storage being used by CICS Transaction Gateway might exceed the amount that is available to the CICS Transaction Gateway address space.

Gateway daemon storage requirements, with 31-bit Java

The numbers quoted are based upon observations with 31-bit SDK for z/OS®, Java™ Technology Edition, V7 (SR1), running with the default operating system thread stack size 256K.

Three factors affect the 31-bit virtual storage requirements of a Gateway daemon address space:
  • The maximum JVM heap size, SE_SHEAPMAX. The default value is 128 MB; this is sufficient for the default values of the thread parameters (100 connection manager, 100 worker threads). Larger heaps must be considered where IPIC connections are used, and the workload includes larger channel payloads. You should allow 300KB for each IPIC SENDSESSION.
  • The stack storage used by the Gateway daemon threads; plan for 128 KB per Connection Manager thread, and 1200 KB per worker thread. If EXCI is disabled, allow 650 KB per Worker thread.
  • The storage footprint required to run the Gateway daemon; this is approximately 70 MB per Gateway but it varies if you use additional functions such as XA, WLM health reporting, SMF recording, and SSL.

If a Gateway daemon attempts to create a new thread and the additional stack storage needed requires more virtual storage than is available to the address space, an out-of-memory condition is produced. This condition is likely to cause the Gateway daemon to shut down. Use the following calculation to avoid these out-of-memory conditions; it estimates the potential maximum virtual storage requirements of the Gateway daemon. The calculation gives a result in kilobytes.

When EXCI is enabled (by default):
70000 + (SE_SHEAPMAX / 1024) + (128 * CM_SMAX ) + (1200 * WT_SMAX )
When EXCI is disabled (environment variable CTG_EXCI_INIT=NO):
70000 + (SE_SHEAPMAX / 1024) + (128 * CM_SMAX ) + (650 * WT_SMAX )

When an application requires the use of very large numbers of connection manager and worker threads, and demands on memory usage are high, consider splitting the application across a number of LPARs, or across several machines. Servicing very large numbers of Java threads within a single JVM imposes significant performance overheads.

If you increase the JVM maximum heap size, ensure that you also increase the address space limit by the same amount. Increasing the JVM maximum heap size reduces the amount of memory that is available for the creation of worker threads and connection manager threads, and an out-of-memory condition might occur unless you have increased the address space limit by the same amount.

A small saving per thread can be made by using the minimum operating system thread stack size of 128k (-j-Xmso=128K via CTGSTART_OPTS).

Gateway daemon storage requirements, with 64-bit Java

The Gateway daemon memory requirements when running under 64-bit SDK for z/OS, Java Technology Edition, V7 are very different from 31-bit. For more information, see Benefits of using a 64-bit Gateway.

31-bit storage tuning

This information applies to 31-bit storage tuning, when you run the Gateway daemon for z/OS with 31- or 64-bit Java. However, this is most relevant if you are use 31-bit Java. The 31-bit virtual storage used by a Gateway daemon address space, that is reported by the SE_CELOAL statistic, cannot exceed the available 31-bit storage. Precisely how much 31-bit storage is available, and how to tune the 31-bit storage for a Gateway daemon system depends upon whether a specific limit is imposed, for example; REGION=500M, or if the Gateway daemon is set to use the maximum available, for example; REGION=0M.

Running with a 31-bit storage constraint

Running a Gateway daemon with an upper limit on 31-bit storage set, that is with a non-zero REGION parameter, the amount of 31-bit storage that is currently used by the Gateway daemon, statistic SE_CELOAL, must not approach the available limit, SE_SELIM. When these two statistics become too near in value, OutOfMemoryExceptions might occur that cause the Gateway daemon to fail.

In this case, statistic SE_C31MAX provides a dynamic indication of the limit of the available 31-bit storage. Therefore, you can use SE_C31MAX as a guide for increasing REGION size, and it represents the largest size that REGION can achieve. However, SE_C31MAX is a dynamic value, and is at a lowest value during peak workload. You should adopt this lowest value as guidance if your goal is to maximize the 31-bit storage usage in a single Gateway daemon.

Typically, when REGION is set to a non-zero value you will observe the following relation between the SE resource group statistics:
SE_CELOAL < SE_SELIM < SE_C31MAX
These three statistics identify:
  • How close the Gateway daemon is to the configured 31-bit storage constraint, SE_CELOAL vs SE_SELIM.
  • By how much the Gateway daemon 31-bit storage constraint can be increased, SE_SELIM vs SE_C31MAX.

Running without a 31-bit storage constraint

Running a Gateway daemon with no upper limit on 31-bit storage set, for example; REGION=0M, the amount of 31-bit storage that is currently used by the Gateway daemon, statistic SE_CELOAL, must not approach the limit of 31-bit storage, SE_C31MAX. When these two statistics become too near in value, OutOfMemoryExceptions might occur that cause the Gateway daemon to fail.

In this case, statistic SE_C31MAX provides the only accurate upper limit of the amount of 31-bit storage that is currently used by the Gateway daemon, statistic SE_CELOAL. This is because when REGION=0M is used, the SE_SELIM value does not account for ELSQA storage, which varies dynamically in relation to workload.

Typically, when REGION is set to zero, REGION=0M, then you can observe the following relation between SE resource group statistics:
SE_CELOAL < SE_C31MAX < SE_SELIM
Observing statistics SE_CELOAL and SE_C31MAX can help you to:
  • Evaluate the potential for increasing numbers of thread or heap size in a particular Gateway daemon.
  • Move to a configuration with a constraint on 31-bit virtual storage.
The lowest value of SE_C31MAX, observed at peak workload, represents the highest value which you might impose as a constraint on 31-bit virtual storage for a Gateway daemon. The maximum value of SE_CELOAL, observed at peak workload, represents the lowest value which you might impose as a constraint on virtual 31-bit storage for a Gateway daemon.

Information Information

Feedback


Timestamp icon Last updated: Wednesday, 27 August 2014


https://ut-ilnx-r4.hursley.ibm.com/tgzos_latest/help/topic/com.ibm.cics.tg.zos.doc//performance/topics/f0200040.html