Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Reduce CPU use for GitLab permissions synching option #23193

Open
@DaedalusG

Description

@DaedalusG

Feature request description

Improve efficiency of codehost permissions synching

Is your feature request related to a problem? If so, please describe.

When users are synching Sourcegraph to a self-managed GitLab code host, and enable the synching option in their external service config, the CPU usage for their gitlab instance rises significantly.

This is because code hosts don't expose user permissions to Sourcegraph through their API, so in order to synchronize permissions SG needs to make requests for each user to determine which repos a user has access to, this can generate multiple requests per user due to limits in the number of repos the code host API allows per request "page". These permissions are cached to reduce the number of requests made, but the permissions are also periodically resynced.

  "authorization": {
    "identityProvider": {
      "type": "oauth"
    }
  }

Below is a grafana chart from Gitlab, detailing the authorization setting being turned off and on and the CPU use going up in relation to this on the Gitlab codehost.
gitlab

Users also observe Gitlab's puma cluster worker reaching nearly its full CPU allocation

Note this CPU usage remains high well after the initial synching of permissions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    perfteam/sourceTickets under the purview of Source - the one Source to graph it all

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions