Skip to content

batch coder agent metadata #9782

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

Closed
johnstcn opened this issue Sep 19, 2023 · 2 comments · Fixed by #10225
Closed

batch coder agent metadata #9782

johnstcn opened this issue Sep 19, 2023 · 2 comments · Fixed by #10225
Assignees
Labels
api Area: HTTP API s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks

Comments

@johnstcn
Copy link
Member

We currently do not batch agent metadata. This causes a fair number of requests and DB load. Our documentation even has a formula for how much DB load a number of metadata would generate.

You can expect (10 * 6 * 2) / 4 or 30 writes per second.

There are a couple of ways we could optimize this:

  • Batch metadata on the agent side and only send them when there is new data
  • Batch metadata on the coderd side (similar to what we do for agent stats)
@johnstcn johnstcn added api Area: HTTP API bug labels Sep 19, 2023
@johnstcn
Copy link
Member Author

This is what 400 workspaces submitting 2 pieces of agent metadata every 10 seconds looks like:

image

This is curently enough to saturate a db-custom-1-3840 instance.

@johnstcn
Copy link
Member Author

Also noticing we end up duplicating a GetWorkspaceByAgentID query for some reason.

image

@matifali matifali added the s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks label Oct 2, 2023
mafredri added a commit that referenced this issue Oct 13, 2023
Fixes #9782

---

I recommend reviewing with ignore whitespace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Area: HTTP API s4 Internal bugs (e.g. test flakes), extreme edge cases, and bug risks
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants