I had a question “We have have an intelligent workload balancer in front of our two queue managers. Sometimes most of the work goes to queue manager A, sometimes to queue manager B, sometimes it is balanced. What can we do so we get workload balancing?” The tough love answer is that MQ does not do workload balancing.
An intelligent router can route requests to a server depending on how busy the server is. This is good for requests that can run anywhere for example requests_1 can execute over here, and request_2 from the same user, can execute over there because no state information is held on the server.
With MQ, the “request” is the MQCONN, and this can be routed to a server depending on how busy a server is. All other MQ requests have to go to the same server as the MQCONN executed on. The router does not get involved in these other MQ requests.
If at start of day, Server A was doing no work, and Server B was busy, then the MQCONNs will be routed to Server A. Half an hour later the applications are putting messages to queues – on Server A – even though this server is now overloaded and Server B is idle. It stays connected to Server A until the application disconnects (perhaps a week later)
What can you do? To get around this, you can have the clients disconnect if they are do no work for a time – perhaps 15 minutes. Or if they are active, disconnect and reconnect – perhaps once an hour to a couple of times a day.
There are limits to how many connections a system can support. There are limits in the operating system, and limits with MQ. Having clients disconnect when they have been idle for a time, frees up resources and keeps you away from these limits.
You may say “We have workload balancing with clustering – we use the CLWLWGHT channel attribute”. This is workload routing not workload balancing. You cannot influence which system the message gets sent to depending on how busy the remote server is (and so balance the work). You can do “two for QMA, one for QMB, two for QMA, one for QMB etc”, even though Server A is overloaded.
This is why MQ does not do workload balancing!