Author |
Message
|
masteringmq |
Posted: Thu Nov 13, 2008 5:51 am Post subject: Batch size |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
I was going through websphere mq explorer and I came across a beautiful looking attribute and it's called batch size. This beautiful attribute by default has a value of 50. I can imagine that 50 messages must be sent to the destination queue before a commit can take place. Otherwise MQ will end the batch and this is done if the associated transmission queue is empty. How do I check the commit status?. I imagine using
dis qs(QM1.RQST) UNCOM
Please advice. I imagine harder and even with two messages in QM1.RQST my application can still grab the messages. Please advice. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 13, 2008 6:03 am Post subject: Re: Batch size |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
I can imagine that 50 messages must be sent to the destination queue before a commit can take place. Otherwise MQ will end the batch and this is done if the associated transmission queue is empty. |
You can imagine that but not quite what the documentation says. The batch size is the maximum number of messages that will be sent over the channel. Hence if 2 messages arrive the MCA won't wait for another 48 but will send the 2 in a single batch. If 52 turn up, 50 will go in one batch, 2 in another.
masteringmq wrote: |
How do I check the commit status?. I imagine using
dis qs(QM1.RQST) UNCOM
|
That shows uncommitted messages on the target queue & has nothing with transmission.
masteringmq wrote: |
I imagine harder and even with two messages in QM1.RQST my application can still grab the messages. Please advice. |
It depends on what queue QM1.RQST is. If it's a transmission queue (as you seem to be discussing such queues) your application doesn't go anywhere near it.
Don't imagine. Read, take some training and experiment.
Then imagine.  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
masteringmq |
Posted: Thu Nov 13, 2008 6:41 am Post subject: |
|
|
Master
Joined: 20 Oct 2008 Posts: 200
|
I have been doing it all the while using batch size 50. So I had an imagination suppose thousands of messages are transmitted on the channel now how do I get the consumer to grab many messages as a single batch. Then if the message size is 4 MB per message. If the batch size is 100. 100 x 4 MB = 400 MB.
But I can set the BATCHINT attribute to a couple of seconds. Please advice.
Last edited by masteringmq on Thu Nov 13, 2008 6:58 am; edited 1 time in total |
|
Back to top |
|
 |
Vitor |
Posted: Thu Nov 13, 2008 6:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
masteringmq wrote: |
how do I get the consumer to grab many messages as a single batch. |
You don't. The consumer grabs one message at a time from the target queue; the transmission of messages is nothing to do with the end application, as I indicated in my last post.
There has been much discussion of batch size & throughput on the forum and you'll find a search profitable. It's one of those questions where there is no "right" answer, no one-batch-size-fits-all setting.
There is a school of thought, which you'll find represented in postings here, which says you should segrigate large messages (and "large" is another disputed word") and smaller messages in the same way you might segrigate real time request/reply from non time-critical updates. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Nov 13, 2008 9:54 am Post subject: Re: Batch size |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Vitor wrote: |
masteringmq wrote: |
I can imagine that 50 messages must be sent to the destination queue before a commit can take place. Otherwise MQ will end the batch and this is done if the associated transmission queue is empty. |
You can imagine that but not quite what the documentation says. The batch size is the maximum number of messages that will be sent over the channel. Hence if 2 messages arrive the MCA won't wait for another 48 but will send the 2 in a single batch. If 52 turn up, 50 will go in one batch, 2 in another.
|
If 2 messages show up and the batch size is 50, the MCA will wait for however long BATCHINT is set to. If more than 50 show up than BATCHINT does not come into play. The channel moves the batches as fast as it can in that case. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
JosephGramig |
Posted: Thu Nov 13, 2008 12:35 pm Post subject: |
|
|
 Grand Master
Joined: 09 Feb 2006 Posts: 1244 Location: Gold Coast of Florida, USA
|
If BATCHINT is 0 (the default), whichever comes first:
- XMITQ is empty
- BATCHSIZE is reached
- BATCHINT is reached
The channel sends the batch. If you size your max MSG size, BATCHSIZE and BATCHINT large enough, you can create a great pickle for yourself.
Word to the wise, don't mess with it. |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Nov 13, 2008 1:14 pm Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
Quote: |
If you size your max MSG size, BATCHSIZE and BATCHINT large enough you can create a great pickle for yourself. |
As with most settings, having some goal in mind helps.
Network throughput can be maximized when batches of messages are sent/received vs. many single messages. There is handshaking between channel ends pre- and post-batch.
This (BATCHSIZE) needs to be balanced off against how long to wait for the last message that will comprise the batch (BATCHINTERVAL). Should the sending MCA wait 1 second, 1 minute, ...? Or not wait at all.
Message size impacts network flow, but not something sysadmins can effectively manage with our channel settings. Programmers create messages of whatever size they desire. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
|