TeamCity 4.0 Help

TeamCity Startup Properties

Various aspects of TeamCity behavior can be customized through a set of JVM options. The options can be specified using the -D parameter passed to the JVM running the TeamCity server or agent.

Server Startup Properties

Depending on how your TeamCity server is started (using shell scripts or as Microsoft Windows service), you need to customize JVM options (for example, JVM -D option). You can specify these options via environment variables or using Tomcat service configuration (see sections below for details).

You will need to restart the server for the option to take effect.

Examples of JVM option you might need are teamcity.data.path to specify TeamCity Data Directory or a debug parameter you received from TeamCity support.

Server is Run Via Shell Script

If you run the server using the runAll or teamcity-server scripts, you can set the options via TEAMCITY_SERVER_OPTS environment variable.

  • TEAMCITY_SERVER_MEM_OPTS — server JVM memory options

  • TEAMCITY_SERVER_OPTS — additional server JVM options

TeamCity Server is Run as Windows Service

To edit JVM server options run Tomcat's service configuration editor by executing the command

tomcat6w.exe //ES//TeamCity

in < TeamCity home >\bin directory and then edit the Java Options on the Java tab (for more information see Tomcat 6 documentation).

Agent Startup Properties

In TeamCity a build agent contains two processes:

  • Agent Launcher — Java process that launch the agent process itself

  • Agent — main process for a Build Agent; runs as a child process for the agent launcher

Whether you run a build agent via the agent.bat|sh script or as a Windows service, at first the agent launcher starts and then it starts the agent. For both processes you can customize the final agent behavior by specifying system properties and variables to run with.

Agent Launcher Properties

Build Agent Is Run Via Script

Before you run the <Agent Home>\bin\agent.bat|sh script, set the TEAMCITY_LAUNCHER_OPTS environment variable.

Build Agent Is Run As Service

In the <Agent Home>\launcher\conf\wrapper.conf file, add the following lines (one per option, the N number should increase):

wrapper.java.additional.<N>

Agent Properties

Build Agent Is Run Via Script

Before you run the <Agent Home>\bin\agent.bat|sh script, set the following environment variables:

  • TEAMCITY_AGENT_MEM_OPTS — Set agent memory options (JVM options)

  • TEAMCITY_AGENT_OPTS — additional agent JVM options

Build Agent Is Run As Service

In the <Agent Home>\launcher\conf\wrapper.conf file, add the following lines (one per option):

wrapper.app.parameter.<N>

Last modified: 20 April 2023