When the number of connections is over 1000 in client progra

Posted by naomigom on 09-Feb-2012 01:35

When the number of connections is over 1000 in client program, Sonic MQ Broker is died.


When an error occurs is the log information and detail environment

==================================================================================

Broker configuration :
SMC > Edit Broker Properties > Advanced ==> Max Connections : Unlimited

MQ(7.6.2) install server info :
$ uname -a
SunOS SunFire280R 5.10 Generic_120011-14 sun4u sparc SUNW,Sun-Fire-280R
$ java -version
java version "1.6.0_24"
Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)
$ /usr/sbin/prtconf | grep "Memory size"
Memory size: 2048 Megabytes

Client progream configuration :
E:\MQ\workspace\SonicMQTest\bin>java -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)

==================================================================================

If you run the attached file, you will meet  the follow log.
==================================================================================

Client Program Log :
SonicMQ Connection create : 1
SonicMQ Connection create : 2
SonicMQ Connection create : 3
SonicMQ Connection create : 4
SonicMQ Connection create : 5
...
SonicMQ Connection create : 1053
SonicMQ Connection create : 1054
SonicMQ Connection create : 1055
SonicMQ Connection create : 1056
SonicMQ Connection create : 1057
SonicMQ Connection create : 1059
javax.jms.JMSException: An open connection has not been established
at progress.message.jimpl.JMSExceptionUtil.createJMSException(JMSExceptionUtil.java:42)
at progress.message.jimpl.Connection.<init>(Connection.java:765)
at progress.message.jclient.ConnectionFactory.createConnection(ConnectionFactory.java:2110)
at MaxConnectionTest.connect(MaxConnectionTest.java:22)
at MaxConnectionTest.main(MaxConnectionTest.java:85)
Caused by: [106] progress.message.client.ENotConnected: An open connection has not been established
at progress.message.zclient.Publication.buildException(Publication.java:205)
at progress.message.zclient.Publication.checkStatus(Publication.java:193)
at progress.message.zclient.Publication.join(Publication.java:150)
at progress.message.zclient.Session.publishInternal(Session.java:3281)
at progress.message.zclient.Session.requestInternal(Session.java:3410)
at progress.message.zclient.Session.request(Session.java:2544)
at progress.message.zclient.Connection.requestRoutingNodeName(Connection.java:1170)
at progress.message.zclient.Connection.performPostConnectOperations(Connection.java:1151)
at progress.message.zclient.Connection.connect(Connection.java:1576)
at progress.message.jimpl.Connection.<init>(Connection.java:650)
... 3 more

MQ Broker Log :
CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain
[12/02/09 14:49:05] (info) Open container boot file "/export/home/sonic/MQ/mySingleMobiledeskKR/MQ01/MQ7.6/container.xml"
[12/02/09 14:49:06] (info) Fetching the resources of container "mySingleMobiledeskKR.MQ01Container"
[12/02/09 14:49:06] (info) Cache opened in directory "/export/home/sonic/MQ/mySingleMobiledeskKR/MQ01/MQ7.6/mySingleMobiledeskKR.MQ01Container.cache"
[12/02/09 14:49:06] (info) Connecting with a connection timeout of 10 seconds
[12/02/09 14:50:09] (warning) Failed to refresh resources due to a connection timeout
[12/02/09 14:50:09] (warning) Using cached container configuration
[12/02/09 14:50:10] (info) CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain

[12/02/09 14:50:10] (info) The container working directory is "/export/home/sonic/MQ/mySingleMobiledeskKR/MQ01/MQ7.6"
CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain
[12/02/09 14:50:15] (config)

        Sonic Management
        Release 7.6.2 Build Number 184
        Copyright (c) 1999-2008 Progress Software Corporation.
        All rights reserved.

        Local host: SunFire280R (SunOS - 5.10)

        Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
        Sun Microsystems Inc. (home /usr/jdk/instances/jdk1.6.0/jre, version 1.6.0_24)
        Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

        Configured Arguments : -Xms256m -Xmx1024m -Xss128k
        Configured Properties: <none>

[12/02/09 14:50:15] (info) "mySingleMobiledeskKR.MQ01Container" starting...
[12/02/09 14:50:27] (warning) Management connect failure: java.net.ConnectException: Connection refused: tcp://mdmq01:2516
[12/02/09 14:50:27] (info) ...connect failed, retrying...
[12/02/09 14:50:27] (info) Loaded ID=AGENT
[12/02/09 14:50:41] (info) Management connection (re)established (Socket[addr=mdmq01/192.168.0.52,port=2516,localport=48845])
[12/02/09 14:50:44] (info) Loaded ID=MQ01
[12/02/09 14:50:44] ID=MQ01 (config)

        SonicMQ Enterprise Edition [Serial Number 4165758]
        Release 7.6.2 Build Number 182 Protocol P30
        Copyright (c) 1999-2008 Progress Software Corporation.
        All Rights Reserved.

        Broker "MQ01". Routing Node "MQ01".
        There is no limit on the number of concurrent connections.
        Security is disabled. Interbroker is disabled.
        Dynamic Routing is enabled. HTTP Direct is enabled.

[12/02/09 14:50:45] ID=MQ01 (info) Registering node "sonic.http" of "$RNN.sonic$http.$HTTP.undefinedroutingurl.9999" for routing node reverse lookup
[12/02/09 14:50:47] ID=MQ01 (info) Starting recovery...
[12/02/09 14:50:49] ID=MQ01 (info) Recovery complete.
[12/02/09 14:50:49] ID=MQ01 (info) Restoring queues ...
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SonicMQ.deadMessage" - Local Non-clustered Shared 1536 16384
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "TEST_MQ_SEND" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SonicMQ.routingQueue" - Local Non-clustered Shared 1536 1024
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SampleQ4" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SampleQ3" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "TEST_MQ_RECV" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SampleQ2" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "SampleQ1" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:49] ID=MQ01 (info) Starting queue "TEST_MQ" - Local Non-clustered Shared 15360 10000
[12/02/09 14:50:49] ID=MQ01 (info) TCP_ACCEPTOR: accepting connections on tcp://mdmq01:2506
[12/02/09 14:50:49] ID=MQ01 (info) SonicMQ Broker started
[12/02/09 14:50:49] (info) ...startup complete
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0xfc00b5e8, pid=5598, tid=2256
#
# JRE version: 6.0_24-b07
# Java VM: Java HotSpot(TM) Server VM (19.1-b02 mixed mode solaris-sparc )
# Problematic frame:
# j  java.net.URL.set(Ljava/lang/String;Ljava/lang/String;ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+0
#
# An error report file with more information is saved as:
# /export/home/sonic/MQ/mySingleMobiledeskKR/MQ01/MQ7.6/hs_err_pid5598.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
#
Abort - core dumped

DomainManager log:
CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain
[12/02/09 14:50:10] (info) Open container boot file "/export/home/sonic/MQ/mySingleMobiledeskKR/DomainManager/MQ7.6/container.xml"
[12/02/09 14:50:10] (info) Open Directory Service boot file "/export/home/sonic/MQ/mySingleMobiledeskKR/DomainManager/MQ7.6/ds.xml"
[12/02/09 14:50:10] (info) Fetching the resources of container "mySingleMobiledeskKR.DomainManager"
[12/02/09 14:50:10] (info) Cache opened in directory "/export/home/sonic/MQ/mySingleMobiledeskKR/DomainManager/MQ7.6/mySingleMobiledeskKR.DomainManager.cache"
[12/02/09 14:50:14] (info) CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain

[12/02/09 14:50:14] (info) The container working directory is "/export/home/sonic/MQ/mySingleMobiledeskKR/DomainManager/MQ7.6"
CompilerOracle: exclude progress/message/broker/AgentQueueDispatcher$DispatchThread.threadMain
[12/02/09 14:50:18] (config)

        Sonic Management
        Release 7.6.2 Build Number 184
        Copyright (c) 1999-2008 Progress Software Corporation.
        All rights reserved.

        Local host: SunFire280R (SunOS - 5.10)

        Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
        Sun Microsystems Inc. (home /usr/jdk/instances/jdk1.6.0/jre, version 1.6.0_24)
        Java HotSpot(TM) Server VM (build 19.1-b02, mixed mode)

        Configured Arguments : -Xms32m -Xmx256m
        Configured Properties: <none>

[12/02/09 14:50:18] (info) "mySingleMobiledeskKR.DomainManager" starting...
[12/02/09 14:50:30] (warning) Management connect failure: java.net.ConnectException: Connection refused: tcp://SunFire280R:2516
[12/02/09 14:50:30] (info) ...connect failed, retrying...
[12/02/09 14:50:30] (info) Loaded ID=AGENT
[12/02/09 14:50:31] (info) Loaded ID=DIRECTORY SERVICE
[12/02/09 14:50:34] (info) Loaded ID=AGENT MANAGER
[12/02/09 14:50:36] (info) Loaded ID=MgmtBroker
[12/02/09 14:50:36] ID=MgmtBroker (config)

        SonicMQ Enterprise Edition [Serial Number 4165758]
        Release 7.6.2 Build Number 182 Protocol P30
        Copyright (c) 1999-2008 Progress Software Corporation.
        All Rights Reserved.

        Broker "MgmtBroker". Routing Node "MgmtBroker".
        There is no limit on the number of concurrent connections.
        Security is disabled. Interbroker is disabled.
        Dynamic Routing is enabled. HTTP Direct is enabled.

[12/02/09 14:50:37] ID=MgmtBroker (info) Registering node "sonic.http" of "$RNN.sonic$http.$HTTP.undefinedroutingurl.9999" for routing node reverse lookup
[12/02/09 14:50:39] ID=MgmtBroker (info) Starting recovery...
[12/02/09 14:50:39] ID=MgmtBroker (info) Recovery complete.
[12/02/09 14:50:40] ID=MgmtBroker (info) Restoring queues ...
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SonicMQ.deadMessage" - Local Non-clustered Shared 1536 16384
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SampleQ4" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SonicMQ.routingQueue" - Local Non-clustered Shared 1536 1024
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SampleQ3" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SampleQ2" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:40] ID=MgmtBroker (info) Starting queue "SampleQ1" - Local Non-clustered Shared 1536 1000
[12/02/09 14:50:40] ID=MgmtBroker (info) TCP_ACCEPTOR: accepting connections on tcp://SunFire280R:2516
[12/02/09 14:50:40] ID=MgmtBroker (info) SonicMQ Broker started
[12/02/09 14:50:40] (info) ...startup complete
[12/02/09 14:50:41] (info) Management connection (re)established (Socket[addr=SunFire280R/192.168.0.52,port=2516,localport=48847])
Exception in thread "Task Scheduler" java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:640)
        at com.sonicsw.mf.framework.agent.TaskScheduler.run(TaskScheduler.java:184)
       
==================================================================================      

The above situation does not happen let me know if you need to set the value of MQ

Thanks in Advance.

MaxConnectionTest.java.zip

All Replies

Posted by rrudis on 09-Feb-2012 16:29

That is correct - you cannot connect an infinite number of clients to a broker.  As each connection consumes at least one thread in the broker (depending on the Acceptor type being connected to) you will eventually run out of memory (thread stack space) at some point.  You have a number of options:

1) Restrict the number of connections to the broker via the 'Max Connections' setting.

2) Use a 64-bit JVM that provides for more than a 2GB JVM process size.

3) Reduce the max heap setting.  This will allow for more memory in the JVM for thread stacks, and will provide the capability to create more connections that you are getting in your current test.  You will still run out of memory however at some point.

What is your goal?

This thread is closed