-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First request to .../builds extremely slower than others for job with huge build history #3754
Comments
Beep boop! This issue has been idle for long enough that it's time to check If it is, what is blocking it? Would anyone be interested in submitting a If no activity is observed within the next week, this issue will be |
Hey, I'm reopening this one as this is still a thing. Thanks! |
Beep boop! This issue has been idle for long enough that it's time to check in and see if it's still important. If it is, what is blocking it? Would anyone be interested in submitting a PR or continuing the discussion to help move things forward? If no activity is observed within the next week, this issue will be |
Reopening as this is still happening at least with Concourse 7.9.1. |
@marco-m-pix4d how big is your builds table? have you tried to manually clean up not needed rows in there? |
We have this many rows in our DB:
We run concourse with:
I'm not aware of pipelines overriding the default retention setting but I will not rule it out. :-D I was able to pinpoint the query (as seen from postgres) to: SELECT b.id, b.name,
b.job_id,
b.resource_id,
b.resource_type_id,
b.team_id,
b.status,
b.manually_triggered,
b.created_by,
b.scheduled,
b.schema,
b.private_plan,
b.public_plan,
b.create_time,
b.start_time,
b.end_time,
b.reap_time,
j.name,
r.name,
b.pipeline_id,
p.name,
p.instance_vars,
t.name,
b.nonce,
b.drained,
b.aborted,
b.completed,
b.inputs_ready,
b.rerun_of,
rb.name,
b.rerun_number,
b.span_context,
COALESCE(bc.comment, '')
FROM builds b
LEFT OUTER JOIN jobs j ON b.job_id = j.id
LEFT OUTER JOIN resources r ON b.resource_id = r.id
LEFT OUTER JOIN pipelines p ON b.pipeline_id = p.id
LEFT OUTER JOIN teams t ON b.team_id = t.id
LEFT OUTER JOIN builds rb ON rb.id = b.rerun_of
LEFT OUTER JOIN build_comments bc ON b.id = bc.build_id
WHERE b.pipeline_id = $1 AND b.id < $2
ORDER BY COALESCE(b.rerun_of, b.id) DESC, b.id DESC
LIMIT 1; For the first build id of the pipeline, the |
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).
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:
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.
Why the paginated request to ../builds are much faster (relatively) than the first one?
The text was updated successfully, but these errors were encountered: