Code Navigation Environment Variables

These docs list supported environment variables for Code Navigation.

frontend

The following are variables are read from the frontend service to control code navigation behavior exposed via the GraphQL API.

NameDefaultDescription
PRECISE_CODE_INTEL_DIAGNOSTICS_COUNT_MIGRATION_BATCH_SIZE1000The max no. of document records to migrate at a time.
PRECISE_CODE_INTEL_DIAGNOSTICS_COUNT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_DEFINITIONS_COUNT_MIGRATION_BATCH_SIZE1000The maximum number of definition records to migrate at once.
PRECISE_CODE_INTEL_DEFINITIONS_COUNT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_REFERENCES_COUNT_MIGRATION_BATCH_SIZE1000The maximum number of reference records to migrate at a time.
PRECISE_CODE_INTEL_REFERENCES_COUNT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_DOCUMENT_COLUMN_SPLIT_MIGRATION_BATCH_SIZE100The maximum number of document records to migrate at a time.
PRECISE_CODE_INTEL_DOCUMENT_COLUMN_SPLIT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_API_DOCS_SEARCH_MIGRATION_BATCH_SIZE1The maximum number of bundles to migrate at a time.
PRECISE_CODE_INTEL_API_DOCS_SEARCH_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_COMMITTED_AT_MIGRATION_BATCH_SIZE100The maximum number of upload records to migrate at a time.
PRECISE_CODE_INTEL_COMMITTED_AT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.
PRECISE_CODE_INTEL_REFERENCE_COUNT_MIGRATION_BATCH_SIZE100The maximum number of upload records to migrate at a time.
PRECISE_CODE_INTEL_REFERENCE_COUNT_MIGRATION_BATCH_INTERVAL1sThe timeout between processing migration batches.

The following settings should be the same for the precise-code-intel-worker service as well.

NameDefaultDescription
PRECISE_CODE_INTEL_UPLOAD_BACKENDBlobstoreThe target file service for code graph uploads. S3, GCS, and Blobstore are supported. In older versions of Sourcegraph (before v3.4.2) Minio was also a valid value.
PRECISE_CODE_INTEL_UPLOAD_MANAGE_BUCKETfalseWhether or not the client should manage the target bucket configuration
PRECISE_CODE_INTEL_UPLOAD_BUCKETlsif-uploadsThe name of the bucket to store LSIF uploads in
PRECISE_CODE_INTEL_UPLOAD_TTL168hThe maximum age of an upload before deletion

The following settings should be the same for the codeintel-auto-indexing worker task as well.

NameDefaultDescription
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_INSPECTED_PER_SECOND0The maximum number of repositories inspected for auto-indexing per second. Set to zero to disable limit.
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_UPDATED_PER_SECOND0The maximum number of repositories cloned or fetched for auto-indexing per second. Set to zero to disable limit.
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_INDEX_JOBS_PER_INFERRED_CONFIGURATION25Repositories with a number of inferred auto-index jobs exceeding this threshold will be auto-indexed

worker

The following are variables are read from the worker service to control code graph data behavior run in asynchronous background tasks.

codeintel-commitgraph

The following variables influence the behavior of the codeintel-commitgraph worker task.

NameDefaultDescription
PRECISE_CODE_INTEL_MAX_AGE_FOR_NON_STALE_BRANCHES2160h (about 3 months)The age after which a branch should be considered stale. Code graph indexes will be evicted from stale branches.
PRECISE_CODE_INTEL_MAX_AGE_FOR_NON_STALE_TAGS8760h (about 1 year)The age after which a tagged commit should be considered stale. Code graph indexes will be evicted from stale tagged commits.
PRECISE_CODE_INTEL_COMMIT_GRAPH_UPDATE_TASK_INTERVAL10sThe frequency with which to run periodic codeintel commit graph update tasks.

codeintel-auto-indexing

The following variables influence the behavior of the codeintel-auto-indexing worker task.

NameDefaultDescription
PRECISE_CODE_INTEL_AUTO_INDEXING_TASK_INTERVAL10mThe frequency with which to run periodic codeintel auto-indexing tasks.
PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_PROCESS_DELAY24hThe minimum frequency that the same repository can be considered for auto-index scheduling.
PRECISE_CODE_INTEL_AUTO_INDEXING_REPOSITORY_BATCH_SIZE100The number of repositories to consider for auto-indexing scheduling at a time.
PRECISE_CODE_INTEL_AUTO_INDEXING_POLICY_BATCH_SIZE100The number of policies to consider for auto-indexing scheduling at a time.
PRECISE_CODE_INTEL_DEPENDENCY_INDEXER_SCHEDULER_POLL_INTERVAL1sInterval between queries to the dependency indexing job queue.
PRECISE_CODE_INTEL_DEPENDENCY_INDEXER_SCHEDULER_CONCURRENCY1The maximum number of dependency graphs that can be processed concurrently.

The following settings should be the same for the frontend service as well.

NameDefaultDescription
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_INSPECTED_PER_SECOND0The maximum number of repositories inspected for auto-indexing per second. Set to zero to disable limit.
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_REPOSITORIES_UPDATED_PER_SECOND0The maximum number of repositories cloned or fetched for auto-indexing per second. Set to zero to disable limit.
PRECISE_CODE_INTEL_AUTO_INDEX_MAXIMUM_INDEX_JOBS_PER_INFERRED_CONFIGURATION25Repositories with a number of inferred auto-index jobs exceeding this threshold will be auto-indexed

codeintel-janitor

The following variables influence the behavior of the codeintel-janitor worker task.

NameDefaultDescription
PRECISE_CODE_INTEL_UPLOAD_TIMEOUT24hThe maximum time an upload can be in the 'uploading' state.
PRECISE_CODE_INTEL_CLEANUP_TASK_INTERVAL1mThe frequency with which to run periodic codeintel cleanup tasks.
PRECISE_CODE_INTEL_COMMIT_RESOLVER_TASK_INTERVAL10sThe frequency with which to run the periodic commit resolver task.
PRECISE_CODE_INTEL_COMMIT_RESOLVER_MINIMUM_TIME_SINCE_LAST_CHECK24hThe minimum time the commit resolver will re-check an upload or index record.
PRECISE_CODE_INTEL_COMMIT_RESOLVER_BATCH_SIZE100The maximum number of unique commits to resolve at a time.
PRECISE_CODE_INTEL_COMMIT_RESOLVER_MAXIMUM_COMMIT_LAG0sThe maximum acceptable delay between accepting an upload and its commit becoming resolvable. Be cautious about setting this to a large value, as uploads for unresolvable commits will be retried periodically during this interval.
PRECISE_CODE_INTEL_RETENTION_REPOSITORY_PROCESS_DELAY24hThe minimum frequency that the same repository's uploads can be considered for expiration.
PRECISE_CODE_INTEL_RETENTION_REPOSITORY_BATCH_SIZE100The number of repositories to consider for expiration at a time.
PRECISE_CODE_INTEL_RETENTION_UPLOAD_PROCESS_DELAY24hThe minimum frequency that the same upload record can be considered for expiration.
PRECISE_CODE_INTEL_RETENTION_UPLOAD_BATCH_SIZE100The number of uploads to consider for expiration at a time.
PRECISE_CODE_INTEL_RETENTION_POLICY_BATCH_SIZE100The number of policies to consider for expiration at a time.
PRECISE_CODE_INTEL_RETENTION_COMMIT_BATCH_SIZE100The number of commits to process per upload at a time.
PRECISE_CODE_INTEL_RETENTION_BRANCHES_CACHE_MAX_KEYS10000The number of maximum keys used to cache the set of branches visible from a commit.
PRECISE_CODE_INTEL_CONFIGURATION_POLICY_MEMBERSHIP_BATCH_SIZE100The maximum number of policy configurations to update repository membership for at a time.
PRECISE_CODE_INTEL_DOCUMENTATION_SEARCH_CURRENT_MINIMUM_TIME_SINCE_LAST_CHECK24hThe minimum time the documentation search current janitor will re-check records for a unique search key.
PRECISE_CODE_INTEL_DOCUMENTATION_SEARCH_CURRENT_BATCH_SIZE100The maximum number of unique search keys to clean up at a time.

precise-code-intel-worker

The following are variables are read from the precise-code-intel-worker service to control code graph data upload processing behavior.

NameDefaultDescription
PRECISE_CODE_INTEL_WORKER_POLL_INTERVAL1sInterval between queries to the upload queue.
PRECISE_CODE_INTEL_WORKER_CONCURRENCY1The maximum number of indexes that can be processed concurrently.
PRECISE_CODE_INTEL_WORKER_BUDGET0The amount of compressed input data (in bytes) a worker can process concurrently. Zero acts as an infinite budget.

The following settings should be the same for the frontend service as well.

NameDefaultDescription
PRECISE_CODE_INTEL_UPLOAD_BACKENDBlobstoreThe target file service for code graph data uploads. S3, GCS, and Blobstore are supported. In older versions of Sourcegraph (before v3.4.2) Minio was also a valid value.
PRECISE_CODE_INTEL_UPLOAD_MANAGE_BUCKETfalseWhether or not the client should manage the target bucket configuration
PRECISE_CODE_INTEL_UPLOAD_BUCKETlsif-uploadsThe name of the bucket to store LSIF uploads in
PRECISE_CODE_INTEL_UPLOAD_TTL168hThe maximum age of an upload before deletion
Previous
Auto-indexing