perf

command
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Command perf measures how many concurrent requests a running Dilion server sustains, and at what latency, with a given number of accounts in its database. It is what .github/workflows/perf.yml runs; locally:

make up && DILION_DSN=... DILION_JWT_SECRET=... go run ./cmd/dilion &
go run ./test/perf -dsn postgres://dilion:dilion@localhost:55432/dilion_dev \
    -url http://localhost:8787 -accounts 1000

It seeds the accounts straight into auth.users (one bcrypt hash at the server's cost, shared by all of them), then runs each scenario in steps of increasing concurrency. Every step is a closed loop: that many virtual users each send their next request as soon as the previous one answers, with no think time, so "concurrency" is requests in flight, not people signed in. A step passes when its p95 latency is within -slo and fewer than 1% of its requests fail; the ramp stops at the first step that does not. The largest passing step is the scenario's sustained concurrency.

Scenarios:

sign-in        POST /token?grant_type=password for a random account
               (bcrypt dominates: this is the CPU-bound path)
session-check  per virtual user, signed in beforehand: GET /user, over
               and over (what a client or an API checking a session
               sends most)
session-mix    per virtual user, signed in beforehand: four GET /user,
               then one POST /token?grant_type=refresh_token rotating
               its own token (signed-in clients, refresh included)

The server, Postgres and this load generator share one machine in CI, so the numbers are for comparing runs with each other, not a capacity plan.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL