Skip to content

RBAC authorization is slow with >80 objects #3098

@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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy