Message channels move traffic across networks that charge latency per round trip. Sending one message per TCP interaction wastes capacity on a link between London and Sydney; batching groups multiple messages into fewer protocol exchanges. BATCHSZ on an IBM MQ channel definition tells the sender how many messages to accumulate before pushing a batch to the partner, subject to BATCHINT time limits and MAXMSGL per message. Operators tuning overnight batch feeds often raise BATCHSZ; operators tuning interactive traffic may lower it. This tutorial explains the attribute, how batching interacts with BATCHINT and channel states, tuning trade-offs, and mistakes such as maximizing BATCHSZ on low-volume routes where messages wait unnecessarily in the batch buffer.
When an SDR instance is RUNNING and messages wait on the XMITQ, the channel agent dequeues messages up to BATCHSZ count. If BATCHINT expires first with fewer messages, it sends a partial batch. The partner RCVR accepts the batch and issues local puts. Larger BATCHSZ means fewer network turns for the same message count—especially valuable when RTT is tens or hundreds of milliseconds. On a fast LAN with tiny messages, extreme BATCHSZ may add delay before the first message leaves because the agent waits for a full batch that never arrives during low traffic.
| Attribute | Unit | Effect |
|---|---|---|
| BATCHSZ | Message count | Upper bound on messages per batch |
| BATCHINT | Milliseconds | Send batch when timer fires even if not full |
| MAXMSGL | Bytes | Max size of each message in batch |
1234567DEFINE CHANNEL('QM1.TO.QM2') CHLTYPE(SDR) TRPTYPE(TCP) + CONNAME('qm2.corp(1414)') XMITQ('XMIT.QM2') + BATCHSZ(50) BATCHINT(100) MAXMSGL(4194304) ALTER CHANNEL('QM1.TO.QM2') CHLTYPE(SDR) BATCHSZ(100) DISPLAY CHANNEL('QM1.TO.QM2') BATCHSZ BATCHINT * Partner RCVR — align batch attributes ALTER CHANNEL('QM1.TO.QM2') CHLTYPE(RCVR) BATCHSZ(50) BATCHINT(100)
BATCHSZ(50) with BATCHINT(100) means “up to fifty messages, or whatever is ready after about 100 ms, whichever comes first”—simplified explanation for beginners. Platform defaults exist; do not assume defaults suit your WAN. Change one attribute at a time in test and measure XMITQ drain rate and end-to-end latency percentiles.
BATCHSZ is how many toy boxes you put in one crate before the truck leaves. If the crate is not full but the clock rings (BATCHINT), you send the crate anyway so the last box is not waiting all day.
High BATCHSZ improves megabytes per second on busy links because protocol overhead is amortized. The last message in a batch waits for earlier messages to fill the batch or for BATCHINT—adding tail latency. Real-time payment routes may use BATCHSZ 10 and BATCHINT 50; bulk replication may use BATCHSZ 500 and BATCHINT 500. There is no universal best value—only measurement on your path.
Persistent messages on the XMITQ survive queue manager restart; batching does not weaken persistence. Channel agents still commit batches according to MQ protocol rules. Slow batching under high BATCHSZ during a backlog can make CURDEPTH drop in bursts rather than smoothly—monitoring tools should use rates, not only snapshots.
BATCHSZ is how many letters you put in one envelope before mailing, instead of mailing each letter separately.
BATCHSZ 100, BATCHINT 5000, one message per second arrives. Describe batch behavior.
Why measure latency and throughput when changing BATCHSZ?
Can one message larger than MAXMSGL ride in a batch? Explain.
1. BATCHSZ limits:
2. BATCHINT works with BATCHSZ by:
3. Each message in a batch must respect:
4. Higher BATCHSZ on WAN often: