How to estimate number of Database Connection Pool

XMLWordPrintable

    • 0
    • 2

      Summary

      Currently, there is no straightforward information on how to estimate the amount of connection required by Bamboo.

      1. From Atlassian's documentation

      Example: How to estimate the number of db connections

      The following formula gives a rough estimate of the number of database connections that will be required:

      (Concurrent users)/5 + (Busy remote agents)/5 + (Local agents)*1.1 + (Amount of concurrent change detections)
      

      For example, an instance with:

      • 5 concurrent users
      • 30 busy remote (or elastic) agents
      • 30 busy local agents
      • 60 plans with repository polling set to 60 second intervals (assume 3 seconds per change detection)
         
        would require 1 + 6 + 33 + 3 = 43 connections.

      Bamboo ships with a pre-configured connection limit, however this can be modified by editing the following value in your bamboo.cfg.xml file:

      <bamboo-home>/bamboo.cfg.xml
      <property name="hibernate.c3p0.max_size">100</property>
      

      Please, refer to Database connection pool size for further information.

      2. Based on Atlassian's documentation

      2.1. How to get some values from Bamboo's database

      Concurrent users

      Assuming the worst case scenario in which is the amount of users from Bamboo internal directory and External users available to Bamboo.

      /* Get users from Bamboo internal directory */
      select count (*) 
        from users;
      
      /* Get external users (JIRA/Crowd/Active Directory) */
      select count (*)
        from external_entities;
      
      Remote agents or Elastic agents
      /* Get Remote agents */
      select count (*) 
        from queue 
       where agent_type = 'REMOTE'
      

      Bamboo reads the Elastic "Region" set up under "Bamboo administration >> Overview >> Elastic Bamboo >> Configuration" from "<bamboo-home>/xml-data/configuration/administration.xml"

      <bamboo-home>/xml-data/configuration/administration.xml
      <region>US_EAST_1</region>
      

      And use this value to get the Elastic agents available by running the following query:

      /* Get Elastic agents */
       select *
        from elastic_image 
       where region = 'US_EAST_1'
      
      Local agents
      /* Get Local agents */
      select count (*) 
        from queue 
       where agent_type = 'LOCAL'
      
      'Repository polling' or 'Scheduled'
      select  B.FULL_KEY as PLAN_KEY, 
              B.TITLE as BRANCH,
              VL.XML_DEFINITION_DATA as REPOSITORY,
              BD.XML_DEFINITION_DATA as TRIGGER_TYPE
         from VCS_LOCATION as VL
         join PLAN_VCS_LOCATION as PVL 
              on PVL.VCS_LOCATION_ID = VL.VCS_LOCATION_ID
         join BUILD as B 
              on PVL.PLAN_ID = B.BUILD_ID
         join BUILD_DEFINITION as BD
              on B.BUILD_ID = BD.BUILD_ID
        where
              BD.XML_DEFINITION_DATA like '%Repository polling%'
           or
              BD.XML_DEFINITION_DATA like '%Scheduled%'
      

      As a response from the query above, you will have under "TRIGGER_TYPE" column something similar to the following XML structure.

      TRIGGER_TYPE
      <!-- Repository polling -->
      <buildStrategy>
      	<config>
              <item>
      			<key>repository.change.poll.pollingPeriod</key>
      			<value>VALUE</value>
              </item>
      	</config>
      </buildStrategy>
      
      <!-- Scheduled -->
      <buildStrategy>
      	<config>
              <item>
      			<key>repository.change.poll.cronExpression</key>
      			<value>0 0 0 ? * *</value>
              </item>
      	</config>
      </buildStrategy>
      

      3. Informartion in Bamboo Support Zip

      When generating Bamboo Support Zip under "Bamboo Administration >> System >> Atlassian Support Tools >> Support Zip >> Create" we can find the following information:

      Bamboo Support Zip >> application-config >> application.xml
      <statistics-information>
          <index-time>929</index-time>
          <number-of-plans>725</number-of-plans>
          <number-of-results>92730</number-of-results>
      </statistics-information>
      ...
      <max-local-agents>-1</max-local-agents>
      <max-remote-agents>0</max-remote-agents>
      <max-users>0</max-users>
      <max-plans>10</max-plans>
      

      4. Expected

      Since the Bamboo Support Zip is a tool to provide information about users' instances, the same should provide either

      • the amount of database connection poll required by the instance
      • the parameters required by the formula above presented

            Assignee:
            Unassigned
            Reporter:
            Rafael Sperafico (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: