Channel Batching

Channel batching is how IBM MQ moves many messages across the network in fewer trips. Without batching, each message might behave like a separate courier drive across town—fine on localhost, expensive on a hundred-millisecond WAN. Sender channels group messages up to BATCHSZ and send the group when the batch is full or BATCHINT milliseconds elapse. Receiver channels unpack batches and put messages to target queues. Beginners tune BATCHSZ once and wonder why latency jumped; experts pair BATCHSZ with BATCHINT, message size, TLS, and HBINT for the link profile. This tutorial explains the batching lifecycle, throughput versus latency tradeoffs, when to increase or decrease batch sizes, interaction with MAXMSGL, multi-channel parallelism, monitoring, and how channel batching differs from the dedicated BATCHSZ attribute reference page.

How a Batch Is Built

The sender channel agent reads messages from the transmission queue. It accumulates messages until either the count reaches BATCHSZ or the timer reaches BATCHINT—whichever comes first. Then it sends the batch over TCP (often inside TLS). The partner receiver channel agent acknowledges and processes messages individually onto local queues. Large messages count as one toward BATCHSZ but consume more bytes in BYTSC—byte throughput may limit before message count fills the batch.

Batching controls compared
ControlWhat it limitsRaise for throughput?
BATCHSZMax messages per batch
BATCHINTMax wait before partial send
Message sizeBytes per batch payload
TLS record sizeEncryption overhead

Throughput Versus Latency

High BATCHSZ with long BATCHINT maximizes messages per round trip—ideal for overnight bulk replication between data centers. Low BATCHSZ with short BATCHINT sends smaller groups quickly—better for interactive flows sharing a channel with batch traffic only if queues are separated. Mixed workloads on one channel without separation force a compromise that satisfies neither team; split channels and XMITQs where budgets allow.

WAN Versus LAN Profiles

  • LAN (under five ms RTT): moderate BATCHSZ (20–50), short BATCHINT—often defaults suffice.
  • Continental WAN (50–150 ms): higher BATCHSZ (50–200), tune BATCHINT to avoid starving small batches.
  • Satellite or high-loss links: batching helps but reliability tuning (DISCINT, retry) matters more—test with loss simulation.

MAXMSGL and Large Messages

MAXMSGL caps each message. A batch of ten messages each two megabytes is twenty megabytes on the wire—ensure network and channel limits support it. One oversized message can fill a batch alone, making BATCHSZ irrelevant for count—monitor byte rates on DISPLAY CHSTATUS BYTSC.

Multiple Channels

Parallel sender channels from different transmission queues to the same partner increase aggregate throughput when the partner allows multiple sessions. Each channel batches independently. Do not create twenty channels without partner agreement—some systems cap instances. Balance channel count with operational complexity.

Monitoring Batching Effectiveness

Compare channel MSGS rate to sum of transmission queue dequeue rates. Low MSGS with high byte rate implies large messages. Flat throughput after raising BATCHSZ may mean disk or remote put limit, not batching. Capture before-and-after latency percentiles when changing BATCHINT for customer-facing flows.

Tutorial: Tune a WAN Channel

shell
1
2
3
4
5
6
7
8
* Baseline DISPLAY CHSTATUS('TO.HUB') MSGS BYTSC * High RTT link — trial values (adjust per IBM limits): ALTER CHANNEL('TO.HUB') CHLTYPE(SDR) BATCHSZ(100) BATCHINT(50) * Stop and start channel after ALTER STOP CHANNEL('TO.HUB') START CHANNEL('TO.HUB') * Re-measure MSGS/sec and application p99 latency * If latency unacceptable: lower BATCHSZ or BATCHINT

Explainer: School Bus Versus Taxi

Batching is waiting for the school bus with thirty kids instead of thirty taxi trips. Everyone shares one ride—cheaper and faster for the school—but the last kid picked up waits for the bus to fill or for the driver's timer.

Explain Like I'm Five

Channel batching is putting many marbles in one tube slide instead of one marble at a time. The slide trip happens once for the whole bunch, which is faster, but your marble might wait until enough marbles gather at the top.

Practice Exercises

Exercise 1

Explain why raising BATCHSZ alone can hurt latency for small urgent messages.

Exercise 2

Propose BATCHSZ/BATCHINT for bulk overnight sync versus real-time alerts.

Exercise 3

Read BATCHSZ tutorial and list three ALTER CHANNEL follow-up checks after change.

Frequently Asked Questions

Frequently Asked Questions

Test Your Knowledge

Test Your Knowledge

1. Channel batching primarily improves:

  • WAN throughput
  • LDAP speed
  • RACF profiles
  • JCL throughput

2. BATCHINT is measured in:

  • Milliseconds
  • Messages
  • Megabytes
  • Queue handles

3. Larger BATCHSZ often:

  • Increases batching delay for last messages
  • Removes TLS
  • Deletes queues
  • Lowers MAXMSGL

4. Batching happens on:

  • Sender channel agent
  • Only DLQ
  • Topic object
  • Listener only
Published
Read time19 min
AuthorMainframeMaster
Verified: IBM MQ 9.3 documentation