Agent relays can cache downloaded artifacts. Caching artifacts in this way improves
performance because agents retrieve artifacts from agent relays instead of from the
server.
When you enable artifact caching on an agent relay, the agent relay maintains a local
CodeStation repository. This repository stores cached versions of artifacts that are on the
server CodeStation repository. By default, the first time an agent requests an artifact, the
agent relay retrieves the artifact, caches it in its CodeStation repository, and provides it
to the agent. The next time an agent requests the artifact, the relay checks if the cached
artifact is up to date. Then, the agent relay updates the cached artifact if necessary and
provides the artifact to the agent.
By default, agent relays cache only artifacts that one or more agents request. You can also
configure agent relays to cache all artifacts with a specified status. In this case, the agent
relays populate the cache with artifacts that have the specified status.
Caching artifacts improves performance if the server is a long distance from the agents. In
this case, caching artifacts on an agent relay that is close to the agents reduces the time
that it takes to copy artifacts to the agents. Caching artifacts also improves performance if
many agents retrieve artifacts from the server at the same time. In this case, caching the
artifacts transfers server load to the agent relays
About this task
If you did not configure agent relay artifact caching when you installed the agent relay,
you can also configure it by modifying its properties.
Procedure
- Open the
/agent-relay-install/conf/agentrelay.properties file.
- Control caching with the agentrelay.codestation.enable_replication
property:
- To enable caching, set the property to TRUE. An example true property
resembles this code: agentrelay.codestation.enable_replication=true.
- To disable caching set the property to FALSE. An example false property
resembles this code: agentrelay.codestation.enable_replication=false.
- To preload artifact versions that contain certain statuses, specify the statuses in the
agentrelay.codestation.geotags property. Separate statuses with commas. If you edit a status that contains a comma, the comma must be
escaped. A modified agentrelay.codestation.geotags property might resemble the
following code: agentrelay.codestation.geotags=Hello%2c World,Production
- Modify the cache size with the agentrelay.codestation.max_cache_size
property.
Note: You must specify the size of the cache in bytes.
An example parameter that sets the cache to 5 GB resembles
this code: agentrelay.codestation.max_cache_size=5368709120.