Setting the TCP/IP KeepAlive interval to be used by WebSphere MQ

Technote (FAQ)


Question

The method of setting the keep alive interval is different on each platform. What is the method for the most commonly used platforms?

Cause

You are seeing problems with hung channels. For example, the queue manager has "orphaned" instances of SVRCONN channels where the client has lost its connection. Or, a sender or receiver channel is in a RUNNING state even though the other end of the channel is no longer available.

Answer

  • Register the queue manager's interest in using the Keep Alive function

    NOTE: For a client channel, keepalive also has to be implemented by the client. It is NOT sufficient to just have KEEPALIVE on at the system level. See additional information under the "Clients" heading below.

      - AIX, HP, Linux, and Solaris:
      add KeepAlive=YES to the TCP stanza in /var/mqm/qm.ini:
          TCP:
          KeepAlive=Yes

      - Windows:
      use the WebSphere MQ Explorer to enable KeepAlive as described in technote 1190501.

      To enable keepalive for a client, you need to define the following registry key:
      HKLM\SOFTWARE\IBM\MQSeries\CurrentVersion\Configuration\TCP
      and define a string value of 'KeepAlive' set to 'Yes'

      This is the Windows equivalent of the /var/mqm/qm.ini file.
      The parameter takes effect immediately, and is a permanent change

      - i 5/OS (iSeries):
      Add the following entry to your queue manager configuration file (qm.ini in the IFS directory, /QIBM/UserData/mqm/qmgrs/ queue manager name):

      TCP:
      KeepAlive=yes

      - z/OS:
      issue the WebSphere MQ command:

        /cpf ALTER QMGR TCPKEEP(YES)

      where 'cpf' is the command prefix for the queue manager subsystem.


      - Clients:
      V6 clients use the qm.ini file or Windows registry. V7 clients, including those on the Windows platform, use the mqclient.ini file. For connections to z/OS queue managers, see technote 1232484 for more details.

      The WebSphere MQ V6 classes for Java and classes for JMS do not enable KeepAlive from the client side. They do not access the qm.ini file. However, the V7 Java/JMS classes will pick up the value of the:
      TCP:
      KeepAlive=
      stanza in the mqclient.ini file. Reference the V7 Client connections topic. The default value for KeepAlive that is used by the V7 Java/JMS classes is NO, which means that it must be explicitly turned on in the mqclient.ini file.

  • You can set the keepalive interval at a system-wide level:

      AIX:
      to query the value:
        no -a tcp_keepintvl
        no -a tcp_keepidle

      to set the value:
        no -o tcp_keepintvl=20
        no -o tcp_keepidle=120

      The interval is in half-seconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'no' commands to the /etc/rc.net script.

      HP-UX:

      to query the value:
      ndd -get /dev/tcp tcp_keepalive_interval

      to set the value:
      ndd -set /dev/tcp tcp_keepalive_interval <newValue>

      The interval is in milliseconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'ndd' command to the /etc/rc.config.d/nddconf file.

      The 'ndd' command in HP-UX 11.x replaced the 'nettune' command.

      i5/OS:
      Use CFGTCP option 3 (or CHGTCPA TCPKEEPALV(xxx)) to specify a time interval in minutes. You can specify a value in the range 1 through 40320 minutes; the default is 120.

      Linux:
      To set the value:
        write the number of seconds into: /proc/sys/net/ipv4/tcp_keepalive_time


      Solaris:
      to query the value:
      ndd -get /dev/tcp tcp_keepalive_interval

      to set the value:
      ndd -set /dev/tcp tcp_keepalive_interval 60000

      The interval is in milliseconds. The parameter takes effect immediately. If the machine is rebooted the parameter is reset to the default value. To make the change permanent, add the 'ndd' command to the /etc/init.d/inetinit script.

      Windows:

      Carefully modify the registry as described in technote 1190501.


      z/OS:
      Update your TCP/IP PROFILE data set and add or change the INTERVAL parameter in the TCPCONFIG section. The default is 2 hours.

  • You can set a per-channel keepalive interval to override the system default:

      - For non-z/OS platforms, use the Heartbeat interval (HBINT). The default 300 seconds.

      - For z/OS, use KeepAlive Interval (KAINT). The default is AUTO, which is converted to Negotiated HBINT + 60 seconds for a non-zero HBINT. With PK51598 applied to V6.0.0, or at V7 base, KAINT=AUTO for a SVRCONN means the default TCP INTERVAL will be used (rather than HBINT+60 as for other channels). This means you need to set KAINT to an integer, which should be greater than HBINT.

Related information

Support Pac MD0C: WebSphere MQ - Keeping Channels Up an

Product Alias/Synonym

WMQ MQ

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere MQ
Channels LU62 / TCP

Software version:

6.0, 6.0.2, 7.0, 7.0.1, 7.1, 7.5

Operating system(s):

AIX, HP-UX, IBM i, Linux, Solaris, Windows, z/OS

Reference #:

1216834

Modified date:

2011-10-07

Translate my page

Machine Translation

Content navigation