How to enable Agent dependency caching in Bamboo Data Center
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This article explains how to configure your reverse proxy to cache content for your Bamboo Agents, enhancing performance and reducing the load on your Bamboo server.
Environment
- Bamboo Data Center
- Bamboo Agents (Remote, Ephemeral)
- Reverse Proxy or Load Balancer with content caching
Diagnosis
Bamboo Data Center supports proxy functionality for caching Agent dependencies. This feature can reduce Agents' startup time by enabling content caching on your reverse proxy. Once you activate this on the proxy side, Bamboo will confirm the change by displaying information in the agent log file.
You'll see the following INFO
message in the <BAMBOO_AGENT_HOME>/atlassian-bamboo-agent.log file when content caching is enabled:
INFO [WrapperSimpleAppMain] [ClasspathBuilder] Content caching is enabled for high performance bootstrap.
In case content caching is disabled, you'll see the following WARN
message:
WARN [WrapperSimpleAppMain] [ClasspathBuilder] Content caching is not enabled. This can cause performance impact on servers with high-tier licenses.
The dependencies being discussed are the JAR files that the Agent must download from the server during startup. To speed up the Agent's startup time, it’s possible to cache plugin information at the proxy level. This means you won’t need to make any changes on the Bamboo side; all adjustments will be made at the reverse proxy level. Importantly, you don’t need to specify which items should be cached; Bamboo will handle that for you once content caching is enabled.
This should work with most reverse proxies that support content caching. In this article, you'll find instructions to enable agent dependency caching specifically for Apache HTTP Server and NGINX.
Solution
Testing Agent dependency caching
The following cURL command will help you test whether caching is successful even before starting up an agent. You don't need to have an agent installed for the purpose of this test.
$ curl -I --http1.1 http://<BAMBOO_BASE_URL>/agentServer/bootstrap/content-cache-test
You should see X-Cache-Status HIT. Similar to the following:
HTTP/1.1 200
Server: nginx
Date: Wed, 18 Dec 2024 06:35:18 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 5002
Connection: keep-alive
Strict-Transport-Security: max-age=31536000
Referrer-Policy: no-referrer-when-downgrade
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
X-Seraph-LoginReason: AUTHENTICATED_FAILED
Last-Modified: Wed, 18 Dec 2024 06:25:22 GMT
Cache-Control: public, max-age=30
X-Cache-Status: HIT
This means the entity was fresh, and was served from cache. If you see MISS then the entity was fetched from the upstream server and was not served from cache.