Skip to content

create dedicated query for bumping workspace activity #8064

@johnstcn

Description

@johnstcn

Each running workspace agent reports stats every 30 seconds by default via POST to /api/v2/workspaceagents/me/report-stats. A side-effect of this operation is that we perform an activity bump which updates the deadline field of the active workspace build.

This curerntly kicks off up to 4 database queries in a transaction:

  • GetLatestWorkspaceBuildByWorkspaceID
  • GetProvisionerJobByID
  • GetWorkspaceByID
  • UpdateWorkspaceBuildByID (conditional)

With N active workspaces with active connections phoning home every 30 seconds, this adds potentially N/10 database queries per second.

We can potentially improve this by combining the first three queries into one.

Metadata

Metadata

Assignees

Labels

scaletestIssues related to scale testing.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions