<%@ page isELIgnored="true" %> <%@ taglib uri="cms" prefix="cms" %> Optimizing Server Performance

Optimizing Server Performance

For advanced users experienced with web applications, there are a number things you can do to increase performance of the AnthillPro server. Much of what is included in this section is based on current users have successfully employed to improve performance.

Caching and AnthillPro

To improve server performance, it is possible to set up a caching proxy (such as Squid) to reduce bandwidth and improve AnthillPro's response times. This is especially helpful in distributed development environments: the proxy can improve performance for users at off-site locations because commonly used pages are loaded from the locally stored cache. Configure the caching proxy with AnthillPro just like any other web application. However, if the AnthillPro server was set up to use SSL, see Caching and SSL before attempting to use a caching proxy.

Caching and SSL

To improve server performance, it is possible to set up a caching proxy (such as Squid) to reduce bandwidth and improve AnthillPro's response times. This is especially helpful in distributed development environments: the proxy can improve performance for users at off-site locations because commonly used pages are loaded from the locally stored cache. Unless the server uses SSL, configuring the caching proxy with AnthillPro is the same as any other web application. See Caching and AnthillPro.

However, if AnthillPro was set up to use SSL (see Installing AnthillPro), Tomcat prevents web pages from being cached. By default, Tomcat includes "pragma:no-cache" as an HTTP header whenever SSL is enabled. To remove this header, the security-constraints section of the web.xml file (located in the \opt\tomcat\conf directory) must be modified. See Item 3 below.

Once completed, this will enable use of the proxy, as well as allow Tomcat to use both HTTP and HTTPS connections. If communication must always use SSL, the server.xml file (located in the \opt\tomcat\conf directory) must also be modified. There are numerous approaches to control how SSL is used-- each dependent on the desired behavior, the tools used, the network architecture, etc. Check with the system administrator to decide how to handle SSL.

To configure a caching proxy with SSL:

  1. Shut down the AnthillPro server and agent(s).

  2. Open the web.xml file, located in the \opt\tomcat\conf directory, in a text editor.

  3. Remove the security-constraint section (that includes the "pragma:no-cache" HTTP header) from the web.xml file. Typically, the header will be included under the <!-- security-constraints --> heading, and should be similar to:

      <security-constraint>
        <web-resource-collection>
          <web-resource-name>
            Automatic SSL Forwarding
          </web-resource-name>
           url-pattern>/*</url-pattern>
        </web-resource-collection>
        <user-data-constraint>
          <transport-guarantee>
            CONFIDENTIAL
          </transport-guarantee>
        </user-data-constraint>
      </security-constraint>
  4. Save changes to the web.xml file.

  5. Restart the AnthillPro server and agent(s). AnthillPro can now use the proxy, with Tomcat using both HTTP and HTTPS connections.

    If communication must always use SSL, the server.xml file (located in the \opt\tomcat\conf directory) must be modified. For example, you can disable the HTTP connector, enable an AJP connector, and set up a HTTPD server that handles SSL connection. However, there are numerous approaches to control how SSL is used, so check with the system administrator to decide how to handle SSL.

Uploading Artifacts to a Build Life

Under certain conditions the server (Codestation) may throw the following error: Server Error: HTTP Code 500: Could not acquire exclusive access to the buildlife. If you see this error when Codestation is attempting to upload multiple artifacts to the same Build Life, the first upload most likely exceeds the 15-second default time-out. To address this issue, see Codestation, Artifact Sets, and Exclusive Locks.

Overriding Server and Agent File Storage Settings

The AnthillPro server and agent allow you to override the default location for the storage of a number of things (see Item Two below). If it is necessary to override the default locations, the startup script must be modified to pass a system property (see Item One below). Before overriding the default location(s), keep the following in mind:

  • Storage Directory. If you change a storage directory, you are responsible for moving existing files in the directory to the new storage location.

  • Upgrading. A server upgrade will overwrite the startup script and the setting will need to be added again.

  • Windows Service. If running the server as a Windows service, the JAVA_OPTS (see below) in the service installer in the bin/service directory will need to be modified. Once modified, the service will need to be removed and reinstalled.

  • Windows Mapped Drive. If running the server on Windows and using a mapped drive as a storage location, Windows has been known the remove the mapping almost at random due to inactivity. See Microsoft Support.

To override the default storage location for the AnthillPro server and/or agent, modify the startup script to pass a system property:

  1. Go to the AnthillPro bin directory and open the ah3server.cmd or ah3server file (the file name depends on what platform the server is installed on) in a text editor.

  2. Find the JAVA_OPTS definition of the property you want to modify. See the appropriate property to be overridden:

  3. Set a new system property. The property needs to be prefixed with -D and a = (equals sign) should separate the property name from its value. For example, the default: ../myvar for anthill3.var.dir would become: -Danthill3.var.dir=../myvar.

    A relative path can be given as the value and the relative path is calculated from the server's bin directory. A absolute path is also an option.

Override Server or Agent Properties

Before making any changes, see Overriding Server and Agent File Storage Settings.

  • anthill3.var.dir (defaults to ../var). Not used to store files directly (see Overriding Agent Properties).

  • anthill3.logs.dir (defaults to ../var/log). Storage for logging files using the default logging configuration.

  • anthill3.temp.dir (defaults to ../var/temp). Storage for temporary files that created for short-term temporary use.

Override Server Properties

Before making any changes, see Overriding Server and Agent File Storage Settings.

  • anthill3.artifacts.dir (defaults to ../var/artifacts). Storage for files published to Codestation.

  • anthill3.codestation.dir (defaults to ../var/codestation). Storage for file in Codestation project Build Lives.

  • anthill3.publish.dir (defaults to ../var/published). Storage for published files that are accessible under the Reports tab of the Build Life.

  • anthill3.reports.dir (defaults to ../var/reports). Storage for published data files that are not accessible but used by the server.

  • anthill3.mavencache.dir (defaults to ../var/mavencache). Storage for files used with the Maven dependency integration.

  • anthill3.changelog.dir (defaults to ../var/changelog). Storage for data files used internally by AnthillPro for change log processing.

Override Agent Properties

Before making any changes, see Overriding Server and Agent File Storage Settings.

  • anthill3.work.dir (defaults to ../work/jobs). The base directory for agent working directories.

Server Logging Options

AnthillPro creates two log files: ah3server.out (which contains all logging messages) and ah3server.err (containing stack traces). Both logs are viewable through the UI at: System > Server Settings > Log/Error, or in the server's \var\log directory.

By default, the ah3server.out log has a maximum size of 50 MB, and the ah3server.err log has a maximum size of 5 MB. For either log, when the maximum file size is reached, the log will automatically roll over. To either increase or decrease the log size:

  1. Shut down the AnthillPro server (run: stop_ah3server.cmd located in the server's \bin directory).

  2. Go to the server's \conf\server directory and open the log4j.properties file in a text editor.

  3. To change the main server log file size, find the file appender section and modify the following setting (usually on line 9):

    • log4j.appender.file.MaxFileSize=50MB

  4. To change the main error log file size, find the error file appender section and modify the following setting (usually on line 17):

    • log4j.appender.errfile.MaxFileSize=5MB

  5. Save changes when done.

  6. Restart the server (run: start_ah3server.cmd or run_ah3server.cmd located in the server's \bin directory).

To change/set the logging level, see Configure Server Miscellaneous Settings.

Server Diagnostics

The Diagnostics tab (at System > Server Settings > Diagnostics) provides useful information when debugging the system. For those with permissions to the System page (typically AnthillPro administrators), you can run reports on the active request contexts; thread CPU usage; the system properties; and any scheduled items while troubleshooting the system.