Skip to content

RBAC authorization is slow with >80 objects #3098

Closed
@kylecarbs

Description

@kylecarbs

Problem

On dev.coder.com I noticed the /api/v2/workspaces endpoint is slow when querying all. Upon doing a pprof, it became apparent our authentication code is the primary cause of this:

image

This is requesting 85 workspaces, and the request took ~180ms (of which ~170ms seems to be auth code).

Here is a direct download to the pprof. You can view it yourself with: go tool pprof -http=:8080 <downloaded file>.

Definition of Done

I'd suggest we write benchmarks for this code. Ideally it takes significantly less than 1ms to authorize a single RBAC object.

Metadata

Metadata

Assignees

Labels

apiArea: HTTP API

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions