1 Reply Latest reply on Jan 6, 2014 5:37 AM by Andy Taylor

    EAP6.1 and too many HornetQ-client-factory-threads

    synclpz Novice

      Hi guys, I can't deal with thread-pool limiting in EAP6.1 for HornetQ's client side (connection factories).

       

      We have an application (runs on EAP) which uses several JMS queues for service orchestration by sending a message to an appropriate queue. It is done via looking up a JmsXA connectionfactory, then getting session, creating producer and sending a message to a designated queue. Then it does close() on everything and waits for another request to send a message. After some time (or some high-load) it appears to be that there are many (thousands!) of HornetQ-client-factory-threads created, so we managed to limit it via configuring connection factories with limited thread pools. But it did not help. Any ideas?

       

      Here's the configuration of HornetQ server inside EAP:

       

                  <hornetq-server>
                      <persistence-enabled>true</persistence-enabled>
                      <thread-pool-max-size>600</thread-pool-max-size> <!-- we also limited server pool, preventively, it worked. jstack says 600 server threads -->
                      <cluster-password>password</cluster-password>
                      <journal-type>NIO</journal-type>
                      <journal-file-size>102400</journal-file-size>
                      <journal-min-files>2</journal-min-files>
      
      
                      <connectors>
                          <netty-connector name="netty" socket-binding="messaging"/>
                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                          </netty-connector>
                          <in-vm-connector name="in-vm" server-id="0"/>
                      </connectors>
      
      
                      <acceptors>
                          <netty-acceptor name="netty" socket-binding="messaging"/>
                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                              <param key="batch-delay" value="50"/>
                              <param key="direct-deliver" value="false"/>
                          </netty-acceptor>
                          <in-vm-acceptor name="in-vm" server-id="0"/>
                      </acceptors>
      
      
                      <broadcast-groups>
                          <broadcast-group name="bg-group1">
                              <socket-binding>messaging-group</socket-binding>
                              <broadcast-period>5000</broadcast-period>
                              <connector-ref>
                                  netty
                              </connector-ref>
                         </broadcast-group>
                      </broadcast-groups>
      
      
                      <discovery-groups>
                          <discovery-group name="dg-group1">
                              <socket-binding>messaging-group</socket-binding>
                              <refresh-timeout>10000</refresh-timeout>
                          </discovery-group>
                      </discovery-groups>
      
      
                      <cluster-connections>
                          <cluster-connection name="sy-cluster">
                              <address>jms</address>
                              <connector-ref>netty</connector-ref>
                              <discovery-group-ref discovery-group-name="dg-group1"/>
                          </cluster-connection>
                      </cluster-connections>
      
      
                      <security-settings>
                          <security-setting match="#">
                              <permission type="send" roles="guest"/>
                              <permission type="consume" roles="guest"/>
                              <permission type="createNonDurableQueue" roles="guest"/>
                              <permission type="deleteNonDurableQueue" roles="guest"/>
                          </security-setting>
                      </security-settings>
      
      
                      <address-settings>
                          <address-setting match="#">
                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                              <redelivery-delay>10000</redelivery-delay>
                              <max-size-bytes>104857600</max-size-bytes>
                              <address-full-policy>BLOCK</address-full-policy>
                              <message-counter-history-day-limit>10</message-counter-history-day-limit>
                              <redistribution-delay>1000</redistribution-delay>
                          </address-setting>
                      </address-settings>
      
      
                      <jms-connection-factories>
                          <connection-factory name="InVmConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="in-vm"/>
                              </connectors>
                              <entries>
                                  <entry name="java:/ConnectionFactory"/>
                              </entries>
                              <use-global-pools>false</use-global-pools>
                              <scheduled-thread-pool-max-size>10</scheduled-thread-pool-max-size>
                              <thread-pool-max-size>600</thread-pool-max-size> <!-- this does not work, `jstack 4305 | grep -e '^".*HornetQ-client' | wc -l` produces 2901 threads! -->
                          </connection-factory>
                          <connection-factory name="RemoteConnectionFactory">
                              <connectors>
                                  <connector-ref connector-name="netty"/>
                              </connectors>
                              <entries>
                                  <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                              </entries>
                          </connection-factory>
                          <pooled-connection-factory name="hornetq-ra">
                              <transaction mode="xa"/>
                              <connectors>
                                  <connector-ref connector-name="in-vm"/>
                              </connectors>
                              <entries>
                                  <entry name="java:/JmsXA"/>
                              </entries>
                              <use-global-pools>false</use-global-pools>
                              <scheduled-thread-pool-max-size>10</scheduled-thread-pool-max-size>
                              <thread-pool-max-size>600</thread-pool-max-size><!-- this does not work, `jstack 4305 | grep -e '^".*HornetQ-client' | wc -l` produces 2901 threads! -->
                          </pooled-connection-factory>
                      </jms-connection-factories>
      </hornetq-server>
      
      

       

      Message was edited by: synclpz