4 Replies Latest reply on Sep 10, 2008 1:22 PM by Kumar Jaya

    JBoss JMXConsole ManagedConnection Pool Question

    Kumar Jaya Newbie

      I am using JBoss 4.2.2 with EJB3.0 and Hibernate. I use MSSQL as my back end and I have configured mssql-ds.xml for minimum and maximum connections in the pools to be as follows...

      <min-pool-size>100</min-pool-size>
      <max-pool-size>200</max-pool-size>..

      From this I believe that the maximum connections that my DataBase should create for this client is 200. I dont know the exact meaning of this tag though. But when I ran my system for some time where it processes 200000 messages I went to the JMX Console by clicking the link

      name=MSSQLDB,service=ManagedConnectionPool

      and I was surprised to find the column value connection created count to be 796!!!!

      ConnectionCreatedCount int R 796

      Is there something going wrong anywhere??

      Regards


        • 1. Re: JBoss JMXConsole ManagedConnection Pool Question
          Peter Johnson Master

          This is the number of connections created over time, not the number of currently active connections - that should never go over 200 based on you settings.

          Example: your app opens a connection and 100 connections are created. Then the app asks for more connections. At some point the app reaches 200 connections. Then everyone goes to lunch and the number of connections drops down to 100. Everyone comes back from lunch and the app is busy and you again have 200 connections. Total connections create at this point is 300.

          One other point - if there is no app activity, and the connection timeout happens, the existing 100 connections will be dropped and 100 new connections opened (there was another post about this - a search for "postgresql connection" should turn it up). Thus even in a system that is not doing anything you can see the total number of connections created increase.

          • 2. Re: JBoss JMXConsole ManagedConnection Pool Question
            Kumar Jaya Newbie

            Thanks Peter. So you mean to say that the connection created count is the total number of connections created by the datasource anew that also includes connections that were created because some connections were closed on timeout.

            One other question. Can I assume that my DB connection usage is erratic when the Connection Created Count is higher than my maxmimum count set by me ??

            Regards

            • 3. Re: JBoss JMXConsole ManagedConnection Pool Question
              Peter Johnson Master

              Erratic? Possibly. I doubt that you would ever be in a situation where 200 connections get used and are in use continually. You would have to monitor the in use connection count for a period of time to determine the exact usage pattern.

              If you want to only ever create 200 connections, then set min and max to the same. Then as long as you don't run into the timeout situation I mentioned earlier, there should be a total of 200 connections created over time.

              • 4. Re: JBoss JMXConsole ManagedConnection Pool Question
                Kumar Jaya Newbie

                Yes, I will do that. Thanks for the replies...

                Regards