Author |
Message
|
MarvinReyes |
Posted: Mon Nov 26, 2012 7:40 am Post subject: How to use MQ handles |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
Hi everyone,
Can someone help me on how to use the MQ handles in a queue manager?
I am having an error on the queue manager(Unable to obtain enough storage) and have also consulted on the available answers, but what I got is to set the Max handle to a higher value.
I don't know why they came up to this solution and how it will affect the queue manager, MQ objects, server and etc.
It is important for me to get the effects since the queue manager has connections to different client servers.
Thank you for all that will answer. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Nov 26, 2012 7:44 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
You could search google for 'mq+handles' to find out what a handle is.
Exactly what error are you getting? Post the error message here.
If the error mentions handles or maximum handles, there is a queue manager attribute by that name that you can alter.
If it's memory that you lack, then you need to configure the o/s to provide it. _________________ 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 |
|
 |
MarvinReyes |
Posted: Mon Nov 26, 2012 7:53 am Post subject: |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
Thank you for your prompt response.
the error that i got is:
----- amqrsrva.c : 439 --------------------------------------------------------
11/17/12 01:06:49
AMQ6037: WebSphere MQ was unable to obtain enough storage.
EXPLANATION:
The product is unable to obtain enough storage. The product's error recording
routine may have been called.
ACTION:
Stop the product and restart it. If this does not resolve the problem see if a
problem has been recorded. If a problem has been recorded, use the standard
facilities supplied with your system to record the problem identifier, and to
save the generated output files. Contact your IBM support center. Do not
discard these files until the problem has been resolved.
-----------------------------------------------------------
I searched on google on how to resolve the error and got the answer on this link: http://www-01.ibm.com/support/docview.wss?uid=swg21180627.
It is not even explained how it can help the queue manager and how it may affect the other MQ objects once it has been implemented.
Additionaly, I am using MQ version 5.3. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Nov 26, 2012 8:12 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
When citing a URL, please don't include the end-of-sentence dot. This renders the URL invalid.
Did you follow the suggestion and increase MAXHANDS?
Quote: |
Resolving the problem
Increase the number of handles allowed by the queue manager.
Example: ALTER QMGR MAXHANDS(999999) |
Handles are words in virtual storage that are used by the qmgr to associate an application with the objects the app opens.
There are a variety of MAXimum attributes in mq. Each attempts to prevent errant applications from causing the qmgr to fail. _________________ 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 |
|
 |
MarvinReyes |
Posted: Mon Nov 26, 2012 8:32 am Post subject: |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
apologies for the invalid URL...
I have not used or tried increasing the max handle of the queue manager since I have not yet determined what possible effects it might give on the queue manager and it's objects.
I am really not knowledgeable concerning the MQ handle.
How does the Max handle affect the queue manager?
Does a certain process consume a specific handle in the queue manager?
How can I check how much handle does a process use? |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Nov 26, 2012 8:39 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
The URL you cited says this:
Quote: |
Additional information
MAXHANDS(integer)
The maximum number of open handles that any one task can have at the same time. This is a value in the range zero through 999 999 999. |
Task means an application program. One handle is used for the application connection to the qmgr, and one additional handle for each object the application opens.
What is the current MAXHANDS value? Use the MQSC command:
DISPLAY QMGR MAXHANDS _________________ 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 |
|
 |
MarvinReyes |
Posted: Mon Nov 26, 2012 9:09 am Post subject: |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
Thank you for the clarification.
Are you aware of the possible effects when we increase the max handles value for the queue manager? |
|
Back to top |
|
 |
mqjeff |
Posted: Mon Nov 26, 2012 10:11 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You should examine the source code of the relevant application and determine if it is creating a loop somewhere that is opening a queue or a topic each time through.
If the current maxhands is anywhere greater than around 10, 99% of all applications should be just fine. This error strongly suggests an incorrectly coded application. |
|
Back to top |
|
 |
bruce2359 |
Posted: Mon Nov 26, 2012 10:39 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
MarvinReyes wrote: |
Are you aware of the possible effects when we increase the max handles value for the queue manager? |
If your current setting of MAXHANDS is too low, then the desired effect of increasing it would be to allow well-behaved apps to use more handles.
As Jeff mentioned above, if you have an app that is misbehaving (continuously acquiring handles without releasing them), then increasing MAXHANDS would likely not solve the insufficient handle problem for you.
So, is this a new problem with a new (or recently modified) application? _________________ 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 |
|
 |
MarvinReyes |
Posted: Tue Nov 27, 2012 9:37 am Post subject: |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
We appreciate the inputs provided. Thank you.
Here is the current situation that we are facing:
We have a Queue Manager Running on a UNIX Machine (AIX/Version 5/Release 3)
Queue Manager Max handle value = 256
There are around 40 Client connections that are connecting to the Queue Manager and are running on different Platforms(Windows&UNIX)
on average, we are geting 86 to 95 current handles and 102 as the highest for the queue manager.
based on what Jeff said earlier, we are exceeding the 11% safe zone for the current handles of all the applications connecting to the queue manager.
Does this mean, this is the reason behind the error we are currently experiencing on the queue manager?
We are currently monitoring the current handles of the queue manager using the command: echo "dis qstatus(*) type(handle) all" | runmqsc [Queue Manager] | grep PID | wc -l
Is the command we are using is correct and accurate in getting the current handles being used by the queue manager? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Nov 27, 2012 9:46 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Maxhands is *per* application process.
What you have is 256 handles for each individual process.
The reason you are experiencing the error is because some *individual* process is attempting to request 257 handles.
It could be that one of your applications is in fact an Application Server that has been configured to support enough instances of queue consumers and servers that it has a legitimate reason to need 257 or more handles from a single process....
But it's at least as likely that it's a badly coded application that is opening a queue each time it wants to put or get a message, and then not closing that queue. |
|
Back to top |
|
 |
MarvinReyes |
Posted: Thu Nov 29, 2012 12:08 am Post subject: |
|
|
Newbie
Joined: 26 Nov 2012 Posts: 9
|
Thank you for the input and information that you are sharing on this thread. This is really helping me alot in understanding how MQ handles work.
As I understand, the max handle of 256 is for each process that are running on the queue manager. Therefore if a process is running, the available handle for it is 256. and if there are more than one process that are running, each of these processes have a max handle of 256 each, correct?
And if we are experiencing some errors, it means that a single process is exceeding the set max handle allowed for a process?
In this sense, I think I need to see which application is doing this, correct?
The problem is, how can I do this?
Is there an AIX MQ command or a way that I can use to get the current handles being used by a single process? |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Nov 29, 2012 5:48 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
MarvinReyes wrote: |
Is there an AIX MQ command or a way that I can use to get the current handles being used by a single process? |
Search here and google for the MQSC command DISPLAY CONN TYPE(HANDLE) _________________ 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 |
|
 |
mqjeff |
Posted: Thu Nov 29, 2012 5:51 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Also, you would expect that the application would also be receiving an error when it tried to open a new handle, and it had exceeded maxhands.
So you could also ask your application teams if they are experiencing any unexplained MQ error messages....
But if the cause is a badly coded application, it's also possible that the badly coded application merely ignores this issue... |
|
Back to top |
|
 |
bruce2359 |
Posted: Thu Nov 29, 2012 6:23 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
mqjeff wrote: |
But if the cause is a badly coded application, it's also possible that the badly coded application merely ignores this issue... |
To further explain:
Each and every mq call returns a ReasonCode and CompletionCode that describes if the call worked or not; and if not, why not.
Most apps I've seen have been coded to test the ReasonCode for popular and expected reasons; and ignore the others. _________________ 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 |
|
 |
|