> What is the difference between these two, if any? Seems to me they both
> accomplish the same thing (allowing one side of a channel to see that the
> network is down and thus being able to go Inactive). The only thing I can
> guess is that Keep Alive applies only to TCP while Heartbeat will work
for
> other transmission protocols as well as TCP.

Keepalive and channel Heartbeats do tend to serve similar functions (and
actually work in a similar way), but there are some differences between
them.

Both work by periodically sending data over an otherwise inactive channel.
The difference is that Keepalive is performed by TCP/IP 'under the covers'
as out-of-band data which MQ is never aware of, and Heartbeats are sent as
actual data flows. As you pointed out, this does mean that Keepalive is
only available for TCP/IP based channels.

Of the two, Keepalive is usually more reliable at detecting network
problems since it is always active, even if a channel is in a state where
Heartbeats may not normally be sent, such as at the end of a batch of
messages when a sender is waiting for confirmation of receipt from the
partner. Heartbeats, however, offer some advantages which Keepalive cannot.
They will allow the receiver MCA to periodically wake up and see if it has
been told to stop mode(quiesce). It also gives an otherwise inactive
receiver the opportunity to free any resources it's not used in some time
(close target queues, free buffers, etc.).

One problem with Keepalive, is that on most platforms, it's only possible
to configure one Keepalive interval for ALL TCP/IP connections on the
system. This means that if you wanted, say, a 5 minute timeout for your
channels, you will inherit the same timeout for every TCP/IP connection one
that system which uses Keepalive (e.g. telnet, ftp, etc.). The lower
timeout causes extra network traffic as it needs to send additional
keepalive packets for each connection which has not seen any activity for
the duration of the keepalive timer. The default Keepalive timer on most
systems is two hours.

In recent times, it's become possible to specify Keepalive times for
individual connections on z/OS. On this platform, we now have (in V5.3.0)
the KAINT channel attribute, which allows you to specify an individual
keepalive timer for any given channel.

If you opt to use both Heartbeats and Keepalive, then it's most logical to
ensure your Keepalive timer is longer than the HBINT for a channel,
otherwise an inactive channel will be sending both Heartbeats and Keepalive
packets.

Neil Johnston.
WebSphere MQ for z/OS Development.
Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to