Performance Tuning Agents

The default settings for the AnthillPro agents tend to work well for many customers. However, in extreme cases (such as huge artifact set size, huge number of changelog entries, etc.) these tuning options may help.

worker-args.conf Available Changes

The worker-args.conf file is available in the %AGENT_HOME%\bin directory. This file lists additional JAVA_OPTS that are passed to the agent startup.

Heap Size Adjustment

  • -Xmx###$
    • Adjusts maximum heap size.
      • ### is a number
      • $ is either k, m, or g for kilobytes, megabytes, or gigabytes respectively.
        • 256MB is the default size for the agent-worker. If the machine hardware allows it, this size can be increased if one is experiencing OOM errors on the agent (which could lead to timeouts). Possible reasons why this might need changed are listed in the intro statement at the top of the page. We can see the possibility of needing to raise this value to 2048m.

AnthillPro Agent Properties

AnthillPro has a number of properties automatically set by the system. A number of the properties are used in conjunction with integrations, and are automatically set during configuration or at runtime. Most users will not need to modify the AnthillPro properties once they are set. The following properties are for overriding settings that AnthillPro automatically sets on agents:

Property List

Please note than in 3.8.x versions most of these properties are managed on the Agents --> [Agent] --> Codestation page!


Property Description Anthill Description
codestation.authToken Specify an alternate authentication to username and password. Mainly used by AnthillPro agents
codestation.cache.dir Location of the agent Codestation cache. Default is the agent's %USERPROFILE%\.codestation directory. Location of the Codestation cache directory in the Agent's filesystem (default: ~/.codestation/cache).
codestation.cache.timeToLive Number of days to keep something in the cache. Default is 3 days. Use the Codestation Time-to-live feature to determine how long unused artifacts remain in the cache (default: 3 days).
codestation.fallbackToOffline Attempt to get artifacts from local cache if server is offline if true.
codestation.force Download artifacts from the server even if they exist in local cache if true.
codestation.includeDirsAndSymlinks Include empty directories and symlinks when publishing or resolving artifacts if true.
codestation.includeGroup Include group when publishing or resolving artifacts.
codestation.includeOwner Include owner when publishing or resolving artifacts.
codestation.includePermissions Include permissions when publishing or resolving artifacts if true.
codestation.nativeCopyCommand Specify the native copy command to use.
codestation.noCache Control over agent Codestation caching. Don't use Codestation cache; resolve artifacts directly to the Agent.
codestation.noCheckCertificate Don't check SSL certificate is signed by a recognized authority
codestation.noPrune Disable pruning of the primary cache
codestation.noVerify Skip artifact verification if true
codestation.offline Run in offline mode if true.
codestation.password Set login password
codestation.preserveTimeStamps AnthillPro will preserve file time stamps when transferring artifacts between the server and agents using the resolve and deliver artifact steps if true.
codestation.protocolVersion Set codestation protocol (NOT RECOMMENDED)
codestation.repo.dir Specify a repository directory.
codestation.secondaryCache.dir Location of secondary cache. Default is not enabled. Secondary cache can improve performance when located on a network share.
codestation.server Set AnthillPro Server
codestation.suppress.bom Control over whether .bom bill of materials files should be created when artifacts are resolved. Default is true. In scenarios where the cleanup is never performed, the BOM files are unnecessary.
codestation.useNativeCopy Use a native copy command if true.
codestation.user Set login user
codestation.verbose Run in verbose mode if true.
lab.manager.<configuration> Identifies an agent as the agent installed in the <configuration> on VMware Lab Manager.

Property Scope Level

PROPERTY SCOPE
codestation properties file CLI UI Codestation Tab Server Settings "Misc." Tab Step
codestation.authtoken .
codestation.cache.dir . . .
codestation.cache.timeToLive . . .
codestation.fallbackToOffline . .
codestation.force . .
codestation.includeDirsAndSymlinks . . .
codestation.includeGroup . . .
codestation.includeOwner . . .
codestation.includePermissions . . . .
codestation.nativeCopyCommand . . .
codestation.noCache . . . .
codestation.noCheckCertificate . .
codestation.noPrune . .
codestation.noVerify . . . .
codestation.offline . .
codestation.password . .
codestation.preserveTimestamps . .
codestation.protocolVersion . .
codestation.repo.dir .
codestation.secondaryCache.dir . . .
codestation.server . .
codestation.suppress.boms . . . .
codestation.useNativeCopy . . .
codestation.user . .
codestation.verbose .

Dynamic Environment Variables

Agent Environment Variables (not to be confused with AnthillPro Environment Properties) are set at the time of agent installation, and are stored on the central server. The agent-installation reads the environment variables of the machine the agent is being installed on and then sets the variables. Once set, AnthillPro does not check for changes in the machine's environment variables. However, you can configure the agent to dynamically set the environment variables every time the agent restarts. When dynamically setting the variables, the agent needs two files in the /bin directory: one named env.properties and one named either setenv.bat (for Windows) or setenv.sh (for UNIX-like systems). The setenv shell script is responsible for dynamically generating the environment variables in a format that AnthillPro can use, as well as writing out the env.properties file. The env.properties file includes all the variables in a pattern similar to DYNAMIC_ENV_VAR=value.

When the agent is restarted, it will first look for the setenv script. If the script is found, it will be executed to update (or write out) the env.properties file. Then, the new variables in the env.properties file will be delivered to the AnthillPro server.

Prerequisites

  • Access the agent's /bin directory.
  • Ability to write a shell script that can generate the environment variables in the proper format.

Add Files to Agent's /bin Directory

  1. Stop the agent.
  2. Create setenv file. In a text editor, create the setenv.bat file if the agent is running on Windows or setenv.sh file if the agent is running on a UNIX-like system. Save it to the agent's /bin directory.
    1. You will need to have the shell script read the environment variables and then writes them out to the env.properties file. The script should be similar to this example below:
    2. echo DYNAMIC_ENV_VAR=value > env.properites
      1. Note that the env.properties cannot reference other environment variables such as PATH=%PATH%;..., etc.
      2. AnthillPro requires the variables to be set using this exact pattern.
  3. Restart the agent. Upon restart, the variables will be updated. To update the environment variables in the future, simply restart the agent again.

Notes on Using SETENV

You MUST properly escape your strings, else they will be truncated when the agent runs the script. An example of the issue is listed below.

Unescaped Strings (env.properties)

PATH=Z:\APPS\Java\jdk1.7.0_10\jre\bin\server\..;Z:\APPS\AnthillPro\agent\bin;C:\Windows\system32;

The agent in the UI would show: PATH=Z:APPSJavajdk1.7.0_10jrebinserver..;Z:APPSAnthillProagentbin;C:Windowssystem32;

Escaped Strings (env properties)

PATH=Z:\\APPS\\Java\\jdk1.7.0_10\\jre\\bin\\server\\..;Z:\\APPS\\AnthillPro\\agent\\bin;C:\\Windows\\system32;

The agent UI would show the correct values.