Traffic generation on GitLab.com deploy stages

In order to keep a consistent amount of traffic on staging, production and the production canary stage artificial traffic is generated by the traffic-generator.

The project has scheduled CI jobs that generate artificial traffic on different stages and report the results to prometheus. Results can be viewed on the traffic generation dashboard.

HTTPS traffic

HTTPS is configured to run every 15 minutes in a scheduled job. Traffic is divided by the following backends:

  • api: anon and authorized /api/ requests that are routed to the api fleet
  • https: anon and authorized https requests that are routed to the web fleet
  • registry: requests to the registry endpoint
  • pages: anon requests to a pages site
  • https_git: anon https request to git-upload-pack across various repositories.

Adding or removing an HTTPS endpoint

Update the urls.yml config file to add a new URL, or adjust the rate of an existing one. Not all HTTPS endpoints are configured using the same rates as some are more tasking on GitLab.com than others. Every URL can have the following set of attributes:

  • connections (default 20)
  • timeout (default 5s)
  • rate (default 2 requests per sec)
  • auth (pass auth token)

Typically the rate is adjusted depending on the endpoint’s performance.

Runners configuration for the traffic generator

The ops instance uses a GKE kubernetes cluster that is configured in Terraform in the ops environment The cluster is configured so that the pods have network access to prometheus so that it can update results after a run. For more information about the configuration of the cluster see the gke-runner README.