Author |
Message
|
wmbwmq |
Posted: Thu Apr 21, 2016 7:23 am Post subject: cluster loadbalancing to multiple instances in the same QMGR |
|
|
 Acolyte
Joined: 18 Jul 2011 Posts: 66
|
Pardon my ignorance here
Is there anyway to cluster load balance incoming messages between 2 queues in the same QMGR? I have 2 qmgrs in a cluster, one qmgr needs to host 2 instances of a queue(ex: BLAH1 and BLAH2 ). The other one will have just one instance(BLAH). I know it was not possible but not sure if in the latest version we can do some workaround? Example by hijacking pub/sub features etc byedirecting an alias BLAH in QMGR1 to split between BLAH1 and BLAH2. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2016 7:26 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
pub/sub doesn't load balance.
You will get every message in both queues.
Is there really some particular reason you need two queues?
Two applications can happily read from the same queue at once, and they will get messages as fast as they are available and can be processed. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
PaulClarke |
Posted: Thu Apr 21, 2016 7:33 am Post subject: |
|
|
 Grand Master
Joined: 17 Nov 2005 Posts: 1002 Location: New Zealand
|
Would you like to say a little about why you'd like to do this ?
Generally speaking I would have thought you'd be better off directing everything to a single queue but having multiple applications reading from that queue. Then you get automatic workload balancing for free. The next application ready to take a message will automatically get it just by going back to the MQGET call.
Other advantages include:
- You get greater efficiencies since MQ will try to keep one thread 'hot' rather that maximising the context switching as in your case.
- You can add more applications as needed if two are not enough to keep up with workload
- Administration is simpler since you have less queue definitions/backup points, less queues to monitor etc
Cheers,
Paul. _________________ Paul Clarke
MQGem Software
www.mqgem.com |
|
Back to top |
|
 |
wmbwmq |
Posted: Thu Apr 21, 2016 7:34 am Post subject: |
|
|
 Acolyte
Joined: 18 Jul 2011 Posts: 66
|
Thanks Jeff.
For various reasons it was decided to separate 2 instances of the applications at MQ level by having 2 queues.
The app is legacy , single threaded with known restrictions. (This will be temporary setup and we are in the process of replacing it with Java) |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2016 7:35 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Use two queue aliases that point to the same queue. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
wmbwmq |
Posted: Thu Apr 21, 2016 7:42 am Post subject: |
|
|
 Acolyte
Joined: 18 Jul 2011 Posts: 66
|
Thanks Paul and Jeff
alias thing wont work in our case as we need physical separation of queues.
So, the only option is to write a cluster workload exit? I am actually leaning more towards creating a new QMGR |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2016 7:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
wmbwmq wrote: |
alias thing wont work in our case as we need physical separation of queues |
Why? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
wmbwmq |
Posted: Thu Apr 21, 2016 7:57 am Post subject: |
|
|
 Acolyte
Joined: 18 Jul 2011 Posts: 66
|
the queue to which app1 connects need to be physically separate from the one to which app2 connects (in the same QMGR).
The thing is whenever both apps connected to the same local queue, we occasionally see issues , probably syncpoint related conflicts. |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Apr 21, 2016 8:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
wmbwmq wrote: |
the queue to which app1 connects need to be physically separate from the one to which app2 connects (in the same QMGR).
The thing is whenever both apps connected to the same local queue, we occasionally see issues , probably syncpoint related conflicts. |
You shouldn't have syncpoint issues between two handles on the same queue. That's a very odd thing.
If you wanted to take the performance hit, you might be able to create some kind of qalias or qremote or I forget what that is shared in the cluster, lives on another queue manager, and points back to the second queue in the first queue manager.
Then half your messages would go over to the second qmgr and then come back. But you would split messages across two queues. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
|