Skip to content

UserInfo Endpoint Load Test

Test Overview

ItemDetails
Test DateDecember 12, 2025
Target EndpointGET /userinfo
PurposeMeasure maximum throughput for Bearer token validation and user data retrieval

Test Environment

K6 Cloud Configuration

ComponentDetails
Load GeneratorK6 Cloud (amazon:us:portland)
Targethttps://conformance.authrim.com
ProtocolBearer Token (JWT RS256)

Infrastructure

ComponentTechnology
ComputeCloudflare Workers
Key ManagementDurable Objects (KeyManager)
DatabaseCloudflare D1
User CacheCloudflare KV (USER_CACHE)

Test Methodology

Scenario

  1. Pre-generate 4,000 valid access tokens stored in R2
  2. Warmup phase: 30s at 50 RPS to activate DOs
  3. Benchmark phase: 3 minutes at target RPS
  4. Each VU picks a random token and calls /userinfo

Load Pattern

{
scenarios: {
warmup: {
executor: 'constant-arrival-rate',
rate: 50,
duration: '30s',
exec: 'warmupScenario',
},
userinfo_benchmark: {
executor: 'ramping-arrival-rate',
startRate: 0,
timeUnit: '1s',
preAllocatedVUs: 2400,
maxVUs: 3000,
stages: [
{ target: 1000, duration: '15s' },
{ target: 2000, duration: '180s' },
{ target: 0, duration: '15s' },
],
startTime: '30s',
},
},
}

Test Duration

  • Warmup: 30 seconds at 50 RPS
  • Benchmark: 3 minutes 30 seconds
  • Total: ~4 minutes per RPS target

Test Configuration

Authentication Flow

ParameterValue
Token TypeBearer (JWT)
Signature AlgorithmRS256
JWK SourceKeyManager DO (cached)
Token Count4,000 pre-generated

Success Criteria

  • HTTP 200 status code
  • sub claim present in response
  • Zero HTTP failures

Results - Performance Metrics

Summary

RPSTotal RequestsHTTP FailuresCF Worker ErrorsCF DO ErrorsStatus
1,000146,231000
2,000293,947000
2,500365,648000⚠️
3,000436,456000⚠️

Note: ⚠️ indicates K6 threshold exceeded (P95 > 500ms)

K6 Client Latency (ms)

RPSP50MeanP95P99Max
1,0001141171392004,523
2,00011813325435029,717
2,5001271743255855,842
3,0001502981,0321,7365,462

Warmup Phase Latency (ms)

RPS TargetRequestsP50MeanP95P99
1,000~1,500112112133138
2,000~1,500111114134138
2,500~1,500112118135488
3,000~1,500112115135155

Warmup activates DOs and prevents initial cold start spikes

Results - Infrastructure Metrics

Worker Duration (ms)

RPSTotalP50P75P90P99P999
1,000146,23113.2214.1415.6231.2088.22
2,000293,94714.1116.5724.1544.54176.35
2,500365,64815.9927.5255.91178.63668.57
3,000436,45617.5850.69124.55231.23596.17

Worker CPU Time (ms)

RPSP50P75P90P99P999
1,0001.101.231.504.025.28
2,0001.071.181.423.964.81
2,5001.061.171.433.974.85
3,0001.051.171.443.984.92

Key Finding: CPU time stable at ~1ms P50 - JWT RS256 verification overhead is minimal

Durable Objects Wall Time (ms)

KeyManager DO for JWK retrieval and caching:

RPSTotal DO ReqDO ErrorsP50P75P90P99P999
1,000146,32400.821.873.387.8389.34
2,000294,02300.460.741.636.8740.59
2,500352,38800.400.581.195.4139.51
3,000366,98600.380.540.946.0758.62

Key Finding: DO wall time improves at higher RPS due to better cache hit rates

D1 Database Metrics

RPSRead QueriesWrite QueriesRows ReadRows Written
1,000525,433341,182470,0911,982,394
2,000525,821341,182470,4791,982,394
2,500529,698341,182474,3561,982,394
3,000528,988341,182473,6461,982,394

Note: Write queries constant due to USER_CACHE KV effectiveness

Capacity Recommendations

UsageRecommended RPSRationale
Normal Operation≤2,000K6 P99 < 350ms, CF P99 < 50ms, 0% errors
Peak Handling≤2,500K6 P99 < 600ms, CF P99 < 200ms, 0% errors
Absolute Limit≤3,000K6 P99 < 2000ms, CF P99 < 250ms, 0% DO errors

Key Findings

1. JWT Verification is Fast

  • CPU time P99: ~4ms across all RPS levels
  • V8 WebCrypto + JWK caching makes RS256 verification negligible

2. KeyManager DO is Ultra-Fast

  • Wall time P99: 5-8ms stable
  • High cache hit rate at high RPS

3. Worker Queuing is the Bottleneck

  • Worker Duration P99 rises from 31ms to 231ms as RPS increases
  • CPU time stays flat - it’s request queuing, not processing

4. Cache is Effective

  • USER_CACHE (KV) keeps D1 writes constant
  • Read-through pattern prevents cold cache misses

5. 100% Success Rate at All RPS Levels

  • Zero HTTP failures even at 3,000 RPS
  • System remains reliable even when overloaded

Comparison with Silent Auth

EndpointRecommendedPeakLimit
Silent Auth2,000 RPS3,000 RPS4,000 RPS
UserInfo2,000 RPS2,500 RPS3,000 RPS

UserInfo has lower throughput due to:

  • JWT verification overhead
  • D1 reads for user data

Performance Visualization

K6 Client P99 Latency

xychart-beta
    title "RPS vs K6 P99 Latency (ms)"
    x-axis [1000, 2000, 2500, 3000]
    y-axis "Latency (ms)" 0 --> 2000
    bar [200, 350, 585, 1736]
RPSK6 P99Status
1,000200ms✅ Good
2,000350ms✅ Acceptable
2,500585ms⚠️ High
3,0001,736ms❌ At limit

Worker Duration P99

xychart-beta
    title "RPS vs CF Worker Duration P99 (ms)"
    x-axis [1000, 2000, 2500, 3000]
    y-axis "Duration (ms)" 0 --> 250
    bar [31, 45, 179, 231]

Load Degradation Pattern

Phase1000 RPS2000 RPS2500 RPS3000 RPS
Stable~114ms~115ms~127ms~150ms
Late~114ms~177ms~313ms~573ms
End~114ms~111ms~112ms~113ms

Note: Queuing accumulates over time at high RPS, but normalizes immediately after ramp-down.

Bottleneck Analysis

Layer1000-2000 RPS2500 RPS3000 RPS
K6 Client P99200-350ms585ms1,736ms
Worker CPUStable (1-4ms)StableStable
Worker DurationStable (15-45ms)Rising (55-179ms)At limit (125-231ms)
DO Wall TimeStable (1-8ms)StableStable
VerdictHeadroomAt load limitPerformance degradation

Test Execution Details

K6 Cloud Run URLs

RPSK6 Cloud URLTime (JST)
1,000https://authrim.grafana.net/a/k6-app/runs/630104901:08
2,500https://authrim.grafana.net/a/k6-app/runs/630116501:40
3,000https://authrim.grafana.net/a/k6-app/runs/630111801:30

Conclusion

Authrim’s UserInfo endpoint achieves:

  • Up to 2,000 RPS: High quality response (K6 P99 < 350ms, CF P99 < 50ms)
  • Up to 2,500 RPS: Acceptable range (K6 P99 < 600ms, CF P99 < 200ms)
  • 3,000+ RPS: Visible degradation (K6 P99 > 1,700ms)

Durable Objects (KeyManager) are fast - the bottleneck is Cloudflare Workers request queuing. Further scale-out requires multi-region deployment or Worker distribution.

100% success rate achieved at all RPS levels - reliability is maintained even at throughput limits.