-
Type:
Suggestion
-
Resolution: Fixed
-
Component/s: Performance
-
36
Problem Definition
Bamboo startup might take several minutes to complete due to the plan cache initialization process. This process runs with an X number of threads where X equals the number of available processors. You can identify the number of threads it's using by searching for the following information in the logs:
2021-04-19 16:48:12,802 INFO [localhost-startStop-1] [ImmutablePlanCacheServiceImpl] Plan cache initialising... 2021-04-19 16:48:12,802 INFO [localhost-startStop-1] [ImmutablePlanCacheServiceImpl] Plan cache is being enabled 2021-04-19 16:48:12,806 INFO [localhost-startStop-1] [ImmutablePlanCacheServiceImpl] Initialising plan cache with 16 threads.
The fact this process is using several threads helps but may not be enough to have it complete in a timely fashion. This may still take several minutes to complete despite using multiple threads.
Suggested Solution
The plan cache initialization process is a database-heavy process. It fetches all of the plans inside the database and load them into cache. This is necessary to ensure Bamboo starts functioning properly and is capable of triggering builds, and etc. This is why the process must finish before the application is up & running. This isn't entirely necessary for plans that have been disabled, or that don't have any triggers, for example.
Is it possible to enhance this process so that we only try to load plans that are really necessary into cache in an attempt to reduce the amount of time spent on startup and resources that are needed to initialize the cache?