- Notifications
You must be signed in to change notification settings - Fork1k
Closed
Description
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 anactivity bump which updates thedeadline
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.