ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » multiple connections to one qmgr, 3000+ fails

Post new topic  Reply to topic
 multiple connections to one qmgr, 3000+ fails « View previous topic :: View next topic » 
Author Message
sangminli
PostPosted: Mon Aug 16, 2010 7:14 am    Post subject: multiple connections to one qmgr, 3000+ fails Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

Hi, I have one simple test java program, which only generates connection to qmgr, then disconnect. When the number of connections increase to near 4000, the qmgr refuse the connections.
the java code is as:
Code:
import com.ibm.mq.*;

class Test{
   public static void main(String[] args) throws MQException, ClassNotFoundException{
      try{
         for (int i = 0; i < 5000; i ++){
            MQEnvironment.hostname = "127.0.0.1";
            MQEnvironment.channel = "SYSTEM.DEF.SVRCONN";
            MQEnvironment.port = 1414;
            MQQueueManager qMgr = new MQQueueManager("MMSGD1Q1");
            qMgr.disconnect();
            System.out.println(i + " connections done!");
         }
      }catch (MQException mqe){
         mqe.printStackTrace();
      }
   }


And the errors are like:
all the above connections are done ok..
...
3936 connections done!
3937 connections done!
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:212)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11._createManagedConnection(MQClientManagedConnectionFactoryJ11.java:318)
at com.ibm.mq.MQClientManagedConnectionFactoryJ11.createManagedConnection(MQClientManagedConnectionFactoryJ11.java:338)
at com.ibm.mq.StoredManagedConnection.<init>(StoredManagedConnection.java:84)
at com.ibm.mq.MQSimpleConnectionManager.allocateConnection(MQSimpleConnectionManager.java:168)
at com.ibm.mq.MQQueueManagerFactory.obtainBaseMQQueueManager(MQQueueManagerFactory.java:772)
at com.ibm.mq.MQQueueManagerFactory.procure(MQQueueManagerFactory.java:697)
at com.ibm.mq.MQQueueManagerFactory.constructQueueManager(MQQueueManagerFactory.java:657)
at com.ibm.mq.MQQueueManagerFactory.createQueueManager(MQQueueManagerFactory.java:153)
at com.ibm.mq.MQQueueManager.<init>(MQQueueManager.java:451)
at Test.main(Test.java:10)
Caused by: com.ibm.mqservices.MQInternalException: MQJE001: An MQException occurred: Completion Code 2, Reason 2059
MQJE011: Socket connection attempt refused
at com.ibm.mq.MQInternalCommunications.createSocketConnection(MQInternalCommunications.java:2316)
at com.ibm.mq.MQv6InternalCommunications$1.run(MQv6InternalCommunications.java:157)
at java.security.AccessController.doPrivileged(Native Method)
at com.ibm.mq.MQv6InternalCommunications.initialize(MQv6InternalCommunications.java:154)
at com.ibm.mq.MQv6InternalCommunications.<init>(MQv6InternalCommunications.java:102)
at com.ibm.mq.MQSESSIONClient.MQCONNX(MQSESSIONClient.java:1337)
at com.ibm.mq.MQSESSIONClient.MQCONN(MQSESSIONClient.java:1246)
at com.ibm.mq.MQManagedConnectionJ11.<init>(MQManagedConnectionJ11.java:184)
... 10 more


Anyone has any ideas on why the connections are refused?
I am using MQ V7 on Windows XP.
Back to top
View user's profile Send private message MSN Messenger
zpat
PostPosted: Mon Aug 16, 2010 7:18 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Max channels reached?
Back to top
View user's profile Send private message
Vitor
PostPosted: Mon Aug 16, 2010 7:18 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

zpat wrote:
Max channels reached?




or max server resources. Bit of a hard limit for that though.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Aug 16, 2010 3:41 pm    Post subject: Reply with quote

Jedi Knight

Joined: 25 Mar 2003
Posts: 2538
Location: Melbourne, Australia

Quote:
When the number of connections increase to near 4000, the qmgr refuse the connections.


Actually it looks like the MQ client classes are unable to open a TCP socket to the queue manager. Check the client error log (C:\P F\IBM\WebSphere MQ\errors\AMQERR01.LOG) for further diagnostics, such as a winsock error code. You are probably hitting a Windows system resource limitation.
_________________
Glenn
Back to top
View user's profile Send private message
sangminli
PostPosted: Mon Aug 16, 2010 4:16 pm    Post subject: Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

zpat wrote:
Max channels reached?

propably not.. i increase both the max channel and max active channels to 5000. and as you see, i disconnect from the qmgr everytime before i connect the next time.
Back to top
View user's profile Send private message MSN Messenger
sangminli
PostPosted: Mon Aug 16, 2010 4:31 pm    Post subject: Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

gbaddeley wrote:
Quote:
When the number of connections increase to near 4000, the qmgr refuse the connections.


Actually it looks like the MQ client classes are unable to open a TCP socket to the queue manager. Check the client error log (C:\P F\IBM\WebSphere MQ\errors\AMQERR01.LOG) for further diagnostics, such as a winsock error code. You are probably hitting a Windows system resource limitation.


there is no errors in the client error log or in the qmgr error log or in the system event log..
Back to top
View user's profile Send private message MSN Messenger
sangminli
PostPosted: Mon Aug 16, 2010 4:33 pm    Post subject: Reply with quote

Voyager

Joined: 26 Aug 2008
Posts: 75
Location: Hangzhou, China

Vitor wrote:
zpat wrote:
Max channels reached?




or max server resources. Bit of a hard limit for that though.


yes, it is probable some system resource gets to the limit. but sometimes it can only go to 1900+, then connection refused.
Back to top
View user's profile Send private message MSN Messenger
fjb_saper
PostPosted: Mon Aug 16, 2010 7:52 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

sangminli wrote:
zpat wrote:
Max channels reached?

propably not.. i increase both the max channel and max active channels to 5000. and as you see, i disconnect from the qmgr everytime before i connect the next time.

Yes but you do it way to fast. There is, I believe, some kind of hardware socket caching mechanism, which really means you have a lot more open than you believe.... Thus hitting a possible hardware limit...

Connections, especially if reuse so close and so often, should be pooled.

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » multiple connections to one qmgr, 3000+ fails
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.