LGTM Enterprise 1.22.2

LGTM-specific environment variables

You can use the LGTM-specific environment variables described below to help you configure the LGTM worker daemons.

Environment variables for LGTM's worker daemons are defined in the cluster configuration file. You can set the value of environment variables for:

  • All workers in the work pool
  • All workers running on a particular host machine
  • Groups of one or more workers running on a particular host

For information about setting environment variables and using labels to determine which projects are analyzed on each worker host, see Setting environment variables for workers.

Variable

Details
LGTM_CREDENTIALS_PASSWORD

Purpose: if you set a custom manifest password when you installed LGTM, the lgtm-config-gen.jar tool and upgrade.sh script prompt you to supply this password. Use this variable to provide the password if you run these commands programmatically—for example, by using Ansible.

Specify: using the standard method for defining environment variables on the coordination server.

Default: undefined. The lgtm-config-gen.jar tool and the upgrade.sh script will use the default encryption password. If this fails, you are prompted for a password.

LGTM_RAM

Purpose: override the maximum amount of memory available for each worker daemon to run LGTM analysis.

The setting applies per worker, not per thread used by a worker. Where multi-threading is enabled (see LGTM_THREADS below) the specified memory is shared between threads.

Specify: in the cluster configuration file using the environment property. The value must be an integer, optionally immediately followed by a unit prefix: K, M, G, or T (case insensitive). Units are 1024-based. If the unit suffix is omitted the value is interpreted as megabytes. The following are valid entries: 8704, 8704M, 8G, 12g. The following are invalid: 8704MB, 8 G, 8.5G.

Default: if this variable is undefined, memory is limited to 6 GB for each worker daemon.

LGTM_THREADS

Purpose: set the number of threads used by each worker daemon. Use this variable to enable LGTM analysis to run in parallel. For example, you might have a host machine in your work pool with adequate resources to run 5 workers, each using up to 3 threads.

Adding more threads per worker makes processing a single job faster. By contrast, adding more workers allows more jobs to be processed concurrently. For maximum throughput, increasing the number of workers may work better for your deployment. Adding threads is effective for decreasing job latency.

The number of cores and workers on the same LGTM worker host machine affects the value you can set for LGTM_THREADS. There is no point setting LGTM_THREADS higher than the number of cores. If you run multiple workers on the same machine, these workers compete for the same CPU and other resources, so the value you set for LGTM_THREADS should be lower than the number of cores.

If you increase the number of threads that each worker daemon can use, you should also use the LGTM_RAM environment variable to increase the amount of memory available to each worker. The memory limit applies per worker, so you may find that jobs fail, due to lack of memory, if you increase LGTM_THREADS without increasing the available memory accordingly.

Specify: in the cluster configuration file using the environment property. The value must be an integer.

Default: if this variable is undefined, analysis is run using a single thread.

Related topicsRelated topics