Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Many PCs with Swing app to IMQ - JMSException on createConnection=[C4000]: Packet acknowledge failed  RSS feed

 
Richard Blaha
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java 1.6.0_24 Swing app created from Netbeans. Problem: JMSException on createConnection=[C4000]: Packet acknowledge failed.

We have a customer connecting from more than 150 PCs through Glassfish to a single Queue using JMS on Red Hat linux. We have encountered three major parameter setting issues. The first was: "to many files open" report back to the log from the SWING application. The number of PCs using the Swing app was limited to about 35. This was corrected making a setting change to the linux system. We went from ulimit -n of 1024 (default for linux) to several multiples of that. Problem 1 solved.

The second was very much like the error reported as a createConnection failure. We could not added more than about 50 PCs without a failure In that case we changed through the Admin Console the Maximum Connections in the connection Pool. On Red Hat linux the 'lsof' command helped us see the exact number of connections and how many connections each PC connection was making - the initial and minimum default number of 8 (in the connection pool) from the PC to the Queue plus 1 topic connection we had for information going back to the Swing app on the PC.

This third was this error itself. Making the change in the second problem only allowed us to add about 5 more PCs with the Swing app running. Apparently when the createConnection cannot send a Packet acknowledge it has made it further in the connection creation, but cannot quite make it there due to a limited number of threads available in that domain. This was quite tricky and the main reason for this post (as trial and error and hunt and peck was what helped steer us there). The output of running the imqcmd metrics for the cxn (connections) showed that the default 1000 setting was encroached upon. Way down in the Glassfish <application server/domains/domain1/imq/instances/imqbroker/props directory is a lone file 'config.properties'. A line should be added to the propeties to change the number of threads (you need to be 'root' to do so). We set ours to a little over twice as what that default was and this alleviated our problem.

imq.jms.max_threads=2048

This change helped make a significant difference and has allowed us to add many more PCs with the Swing app running. We also changed the Initial and Minimum Pool Size from the default of 8 down to 4. Each connection creates 2 threads and so reducing the number of minimum connections significantly reduces the number of threads per PC Swing app connection made to the IMQ setup with Glassfish. Further tuning of these four values ( ulimit in the linux OS, the Maximum Number of Pool Connections, the total number of allowed threads per domain, and the Initial and Minimum Number of Pool Connections should help us reach our target of more than 150 PCs connected to the IMQ in Glassfish.

I hope this is helpful to someone who comes behind. The effort to reach these solutions is almost two months of searching for some help, any help from the forums and other sources to find the setting of these parameters. There may be more we have not yet found, but these have helped us reach our goal.

>
 
Richard Blaha
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NOTE: This was with Glassfish v2.1.1
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!