Skip to content

bug: GetWorkspaceAgentByInstanceID can cause excessive load when starting workspaces #20817

@spikecurtis

Description

@spikecurtis

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

A customer alerted us to the fact that while starting a large number of workspaces the query GetWorkspaceAgentByInstanceID caused excessive load (10x the next most expensive) and averaged 100ms latency.

Relevant Log Output

Expected Behavior

GetWorkspaceAgentByInstanceID is a simple exact-match lookup, so should be very fast if properly optimized (do we have an index?).

Steps to Reproduce

Create a lot of EC2 instaces with AWS instance identity

Environment

  • Host OS:
  • Coder version:

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueEasily solved issues suitable for starters and community contributorss2Broken use cases or features (with a workaround). Only humans may set this.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions