High number of running Jobs cause slowness on pipeline page
Summary
If a pipeline is triggered with a huge number of Jobs (tested this with a 1000), the pipeline page for the project becomes inaccessible until all jobs have finished.
The side effect of the a huge gitlab-ci
file is also that it take several minutes before the pipeline is created.
Steps to reproduce
- Create a project with this gitlab-ci.yml file.
- Run the pipeline.
What is the current bug behavior?
The jobs run but the pipline page is completely inaccessible.
What is the expected correct behavior?
The jobs to run without affecting the pipeline page.
Possible fixes
related ticket: https://gitlab.zendesk.com/agent/tickets/209667
Preload users for Ci::Build#detailed_status
, tags and runners
for Ci::Build#stuck?
. More details about the queries: #330707 (comment 599344210)
Availability & Testing
- Unit test changes: requires unit tests for N+1 queries.
- Integration test changes: Can we mock this many jobs in a pipeline in a feature test? Is it reasonable?
- End-to-end test change: perhaps this is not a good option for E2E test but rather a load test scenario.
See the test engineering planning process and reach out to your counterpart Software Engineer in Test for assistance: https://about.gitlab.com/handbook/engineering/quality/test-engineering/#test-planning