Skip to content
GitLab
Next
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • GitLab GitLab
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 44,761
    • Issues 44,761
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 1,329
    • Merge requests 1,329
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.orgGitLab.org
  • GitLabGitLab
  • Issues
  • #32823
Closed
Open
Issue created Sep 26, 2019 by Fabio Pitino@fabiopitino2️⃣Maintainer5 of 5 checklist items completed5/5 checklist items

Enable pipeline creation limits

In gitlab-foss#51401 (closed) we added support for job_activity_limit as a limitation for the pipeline creation. The job_activity_limit will drop a pipeline if the number of jobs in alive pipelines exceeds the specified limit.

Similar limits we have support for are pipeline_size_limit and pipeline_activity_limit.

Problem

Although the basic implementation for these limits is in place we haven't enabled them yet. In order to do that we would need to run the following in a production Rails console, given that they can only be set at DB level:

# iterate that for each plan
Plan::ALL_HOSTED_PLANS.each do |plan_name|
  Plan.find_by_name(plan_name).update!(active_jobs_limit: 1000)
end

Or set specific (e.g. progressive) limits per plan.

However, there are a couple of issues to be addressed in order to enable these limits on production:

  • it's currently not possible to set limits to free plan because it does not exist as a record in the DB and in the code a nil plan is considered free.
  • we have not tracking/logging on when a limit is hit and drops a pipeline. Only SELECT COUNT(*) FROM ci_pipelines WHERE failure_reason = 22;

Proposal

  • Add logging when a pipeline is dropped because of an exceeded limit (use Prometheus metrics if possible) !19155 (merged)
  • Force free plan to be a record in the DB and default to it when namespace.actual_plan is nil !19033 (merged)
  • Seed a Plan.create!(name: 'free', title: 'Free') record on production !19033 (merged)
  • Extract limits out of namespaces table and into a dedicated plan_limits table !19438 (merged)
  • Enable active_jobs_limit: 500, especially those in the lower plans: E.g. free, bronze, silver https://gitlab.com/gitlab-com/gl-infra/production/issues/1106
Edited Dec 12, 2019 by Fabio Pitino
Assignee
Assign to
Time tracking