concourse / concourse/concourse

First request to .../builds extremely slower than others for job with huge build history

Open
#3,754 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug core/api
Dominant language
Go
Stars
7.9k
Forks
903
Avg merge
2d 11h
Merged PRs (30d)
20

Description

As shown in the gif (first 15sec are cut), when I go to https://ci.concourse-ci.org/teams/examples/pipelines/time-triggered/jobs/job/builds/200845

The first request to ../builds endpoint took about 17s, comparing of which to those subsequent paginated calls to the same endpoint shows it could be as 5x slower (17s vs 2s vs 3s).

Apr-18-2019 12-46-22

For a job that has less builds(e.g. couple hundreds) the first call takes around only X0ms to X00ms and the paginated calls show no big difference.

So there are two questions here:

  1. Why is the call to ../builds that slow for the job who has huge build history? Since it will fetch first 100 builds if range is not specified, which should be technically the same as a request against a job with less builds.

  2. Why the paginated request to ../builds are much faster (relatively) than the first one?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the request at the reported job URL and compare the initial ../builds call with its paginated follow-up calls, recording timings for a job with a large build history. Trace the ../builds API entry point and investigate why the first request is slower. Done means the cause is identified and the initial request no longer has the reported disproportionate delay, with the behavior verified against both large and smaller histories.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api, backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.