6 Replies Latest reply: Mar 4, 2014 4:32 AM by Philippe Saade RSS

    JDBC connection pool under stress test

    Philippe Saade

      Hi All,

       

      How can I estimate the max number of connection pools based on the following numbers:

       

      - Number of users = 200

      - Users are accessing simultaneously.

      - Each user create 2 connection pools

      - Average TPS = 5/s


      Regards,

      Philippe Saade

        • 1. Re: JDBC connection pool under stress test
          sridharsuravarapu

          The proper way to find out the max number of connections in your connection pool can be confirmed by doing a stress test of your application on WLS.

           

          Having said that the max you would ever need would be 200 * 2 = 400.

           

          Remember the max connections in a connection pool is per server, meaning if you deploy the pool to a cluster of say 2 managed servers, then wls would be able to open 2 times the max connections you have configured.

          • 2. Re: JDBC connection pool under stress test
            Joe Weinstein-Oracle

            Hi, I'll give you a better answer. First, you are asking how many connections to have in a pool,

            not how many pools. If you architect your application well, to get a connection only the instant

            it is needed, use it, then close it, always within some method scope, never holding a connection

            for future use, then regardless of the number of 'concurrent users', if your WebLogic server is

            going to allocate a maximum of 35 threads to run these users, then you would only need 35

            connections in the pool. As soon as one thread finishes it's call for a user, the connection

            is back in the pool for the next user being worked on by that thread.


            Why would each user need two connections?

            • 3. Re: JDBC connection pool under stress test
              Philippe Saade

              Thanks a lot sridharsuravarapu for your answer,

               

              I understand from you that if I have 200 users serving 2 connections / user , I would multiply the number of users by 2 ?
              and for cluster environment I'll distribute the 400 connections (200 on node1 and 200 on node2).

              But the number of 400 connection pool is not huge a little bit ?

               

              Regards,

              Philippe

              • 4. Re: JDBC connection pool under stress test
                Philippe Saade

                Hi Joe,

                 

                I really appreciate your answer, it clarified a lot of things for me.

                Indeed the question was how many connections for 200 concurrent users.

                After checking, each user will execute two queries and not necessary will open two connections... 

                 

                My question here:

                If 200 users allocate 35 threads , each thread will open a connection in the pool ?

                Here you mean by java thread related to the connection pool ? how can I filter the thread related to the connection pool ?

                 

                Regards,

                Philippe

                • 5. Re: JDBC connection pool under stress test
                  Joe Weinstein-Oracle

                  200 users will do nothing (I hope) with threads. A single WebLogic instance is a multithreaded

                  engine which allocates a finite number of threads actually devoted to executing application code.

                  If you have a servlet that 200 users are running, maybe only 50 of them will be actively running

                  in an execution thread at any time, and the rest may have their execution request on a queue.

                  So the pool may only need 50 connections.

                  • 6. Re: JDBC connection pool under stress test
                    Philippe Saade

                    Thanks again for you help.

                     

                    Regards,

                    Philippe