Implementation
Ruby on Rails
Ruby on Rails 8.1.4.1 · Ruby · Full-stack frameworks · ranked
Scores
| Category | Position | Score | ± |
|---|---|---|---|
| Hello world | 13 | 0.013* | ±23.0% |
| Database | 11–13 | 0.30* | ±24.8% |
| Application | 11–13 | 0.10* | ±32.8% |
| Memory (high-water mark) | 13 | 0.15 | ±9.4% |
| Startup | 1–13 | 0.72 | ±22.3% |
Runner CPUs: EPYC 7763, EPYC 9V74, Xeon 6975P-C
Settings
- Runtime
- Ruby 4.0.9 with YJIT and jemalloc
- Server
- Puma 8.1 behind Thruster 0.1, as in the Dockerfile rails new generates
- Workers
- Puma cluster mode: WEB_CONCURRENCY = BENCH_WORKERS (2) workers x 3 threads (the generated RAILS_MAX_THREADS default)
- Database layer
- Active Record (pg 1.7), pools of up to 8 connections per worker (16 in total); 6 in use, one per Puma thread (2 workers x 3 threads)
- Templates
- ERB (Action View)
- Logging
- Rails at warn (no request lines); Thruster's request log off
- Dependency source
- –
- Status
- measured
Notes
- Structure: Thruster (HTTP proxy) and Puma (2 workers x 3 threads) share the 2 vCPUs
Application endpoints: mechanisms
- Validation
- Route constraint id: /\d+/ (404); Active Model form objects (ActiveModel::API with numericality and length validations) for the query string, the JSON body and the form: 422; malformed JSON 400
- CSRF
- token (built-in): protect_from_forgery (ActionController::Base default): token in the encrypted cookie session, masked authenticity_token field, Origin checked when present; InvalidAuthenticityToken, 422
- Session store
- postgresql (generator): bin/rails generate authentication: a sessions row looked up through the signed session_id cookie, the user loaded through it; has_secure_password (bcrypt) on users.password_bcrypt
Tier 1 endpoints
| Endpoint | req/s | vs Axum | Efficiency (req/CPU-s) | p99 (ms) | Errors | Limits |
|---|---|---|---|---|---|---|
| /text | 1,823 (1,697–2,848) | 0.01 | 913 | 182.53 | 0 | |
| /json | 1,856 (1,760–2,923) | 0.01 | 931 | 163.44 | 0 | |
| /db-single | 1,567 (1,517–2,431) | 0.10 | 785 | 184.54 | 0 | |
| /html | 1,733 (1,585–2,544) | 0.01 | 869 | 191.70 | 0 | |
| /queries?queries=20 | 604 (542–1,163) | 0.68 | 305 | 251.34 | 0 | |
| /fortunes | 1,444 (1,342–2,144) | 0.06 | 723 | 217.10 | 0 | |
| GET /world/{id} | 1,570 (1,435–2,345) | 0.11 | 787 | 195.07 | 0 | |
| GET /worlds | 1,268 (1,214–1,865) | 0.12 | 636 | 238.73 | 0 | |
| POST /form | 1,300 (1,213–1,774) | 0.02 | 652 | 308.97 | 0 | |
| GET /me | 1,169 (1,066–1,593) | 0.15 | 586 | 246.38 | 0 | |
| /updates?queries=20 | 273 (244–542) | 0.71 | 145 | 522.88 | 0 | |
| PUT /world/{id} | 1,291 (1,190–1,847) | 0.11 | 651 | 203.79 | 0 |
Measured versions
actionpack8.1.4.1activerecord8.1.4.1pg1.7.0puma8.1.0rails8.1.4.1ruby4.0.9thruster0.1.27
Runner jobs
| Job | CPU model | Rounds | Status |
|---|---|---|---|
| 1 | EPYC 7763 | 5 | measured |
| 2 | EPYC 9V74 | 5 | measured |
| 3 | Xeon 6975P-C | 5 | measured |