Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reduce DB load of autobuild #15082

Closed
Closed
Assignees
johnstcnDanielleMaywood
Labels
need-backendIssues that need backend workneeds-rfcIssues that needs an RFC due to an expansive scope and unclear implementation path.
@johnstcn

Description

@johnstcn

Motivation

Theautobuild/ package periodically queries for workspaces that are eligible for a state transition viaGetWorkspacesEligibleForTransition.

This is run everyCODER_AUTOBUILD_POLL_INTERVAL, which defaults to 1 minute.

This would probably be OK if that were all it did, but it also kicks off a bunch of other queriesper workspace in the result set:

  • GetWorkspaceByID
  • GetUserByID
  • GetLatestWorkspaceBuildByWorkspaceID
  • GetProvisionerJobByID
  • GetTemplateByID
  • GetTemplateVersionByID
  • GetTemplateAccessControl

This can cause significant database load with multiple Coder instances and/or large numbers of workspaces.

Solutions

a) Instead of periodically querying, move to an event-based approach based on the next time we know we need to start a workspace.

b) Keep the existing timer-based approach but optimize the query.

c) Only have one replica running the autobuild query at a time.

Metadata

Metadata

Labels

need-backendIssues that need backend workneeds-rfcIssues that needs an RFC due to an expansive scope and unclear implementation path.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp