6 Replies Latest reply on Apr 24, 2008 3:26 PM by Peter Johnson

    connection pool configuration ?

    Mike La Budde Newbie

      I have a question regarding the interaction between <min-pool-size/> and <idle-timeout-minutes/> properties.

      The JBossJCAPooling documentation says:

      Should closing idle connections cause the pool to fall below the min-pool-size, new/fresh connections are created.


      Doesn't this create unnecessary churning of connections (out w/ idle in w/ new)?

      Here's my situation:

      I have these properties set at 10 for min-pool-size and 2 for idle-timeout-minutes. On average, I see 15 connections from each app server to the db server.

      This is what I'm seeing on my app servers: all db connections seem to get closed within about 5 minutes. New connections are created, about 4 per minute.

      If I understand properly the MRU strategy used by the connection pool manager, then I do not understand why I am seeing this behavior.

      Any help/thoughts would be greatly appreciated!

      TIA,

      Mike L. (aka patzerbud)

        • 1. Re: connection pool configuration ?
          Mike La Budde Newbie

          Any thoughts on this? Anyone?

          Thanks,

          Mike (aka patzerbud)

          • 2. Re: connection pool configuration ?
            Peter Johnson Master

            Are you saying that after 5 minutes the number of connections falls below 10?

            From my understanding, it should work like this. When you first bring up the app server, there are no connections. The first app that needs a connection causes 10 (min-pool-size) connections to be created. If additional connections are needed, up to max-pool-size connections will be created. If more than min-pool-size connections are made, and any of them are idle for more than idle-timeout-minutes, then they are closed, but there will always be at least min-pool-size connections.

            • 3. Re: connection pool configuration ?
              Mike La Budde Newbie

               

              Are you saying that after 5 minutes the number of connections falls below 10?


              Perhaps, and No. Let me try to clarify what I was trying to say in my previous post:

              It only takes about five minutes for all existing connections to the database to be closed and replaced with new ones (the PIDs on the db server verify this). What I suspect is happening is this: connection #10 of 10 (the LRU) has exceeded idle-timeout-minutes so it gets closed leaving only 9 connections in the pool. A different thread notices the number of connections has fallen below the min-pool-size and creates a new one.

              This was supposed to be my first question: Why doesn't one hand no what the other is doing? Why have one thread close an "idle" connection if that will cause the number of connections to fall below the specified min-pool-size? The quote in my original post referenced the - to me - confusing section of the documentation that led me to question this. To me the documentation implies that this is what is going on.

              Secondly, in my environment ALL connections get closed & replaced and this only takes about 5 minutes. We have approx. 300 simultaneous users accessing the system w/ an auto-refresh configured to take place every 3 minutes. In other words we see about 100 hits per minute. With this kind of activity - why would we see the top n connections get recycled? Shouldn't some of the connections be used over & over and not be idle? This is based on my understanding of the MRU strategy used to dole out connections from the pool.

              Thanks.

              • 4. Re: connection pool configuration ?
                Peter Johnson Master

                You are right, and I would not believe it if I had not seen it myself. After 15 minutes (what I have idle connection timeout set to) all 10 of my connections are closed and reopened and ps posgesql is showing 10 new process ids. I agree that this cannot be correct. Perhaps you should open a JIRA.

                • 5. Re: connection pool configuration ?
                  Mike La Budde Newbie

                  Anyone else looked into this?

                  Any additional thoughts?

                  How do I log/create a Jira issue for this?

                  TIA,

                  Mike (aka patzerbud)

                  • 6. Re: connection pool configuration ?
                    Peter Johnson Master

                    You can find JIRA at http://jira.jboss.com.

                    I image you would want to submit the JIRA for project JBAS.

                    You can log into JIRA with the same user name and password that you use for this forum.