Alpha Ruby · native binary
Ruby web apps.
One native binary.
Snails is a Rails-like framework that compiles API-only Ruby apps into one native binary. No Ruby runtime, no GVL, no Puma workers: one process serves requests on every core and boots in single-digit milliseconds. Against Rails in cluster mode, that's ~3× the throughput with over 20× less memory under load — and ~12× against a default Rails app.
After that, snails new demo creates a project. The installer needscurl and tar; the first build also needs git,make, and a C compiler with the usual development headers. Full install guide →
Alpha. The public API can change between 0.x releases.
# inside Snails::RouteTable.table
resources("/posts", PostsController, :json)class PostsController < ActionController::API
def index
render(json: posts)
end
private
def posts
Post.all.map { |post| post_json(post) }
end
def post_json(post)
{ "id" => post.id, "title" => post.title }
end
endWhy Snails
Rails conventions, one binary.
Snails keeps the Rails conventions an API needs. The view layer is gone, and the server runs without Ruby.
The Rails shape
Routes, controllers, migrations, forms, mail, and jobs keep the shape you know. Models are plain classes over your tables, so the SQL stays visible.Coming from Rails →One native binary
Your app, the framework, and the HTTP server compile into one file. The server needs no Ruby runtime — ship the binary or the container image.Deploying →Every core, one process
Native code has no GVL, so a single process serves requests on all available cores. Memory does not multiply with worker count.How it compares →Tests against a real server
bin/test builds the app, boots it on a spare port, and sends real HTTP requests. Nothing mocks the framework out of the way.Testing →API-only by design: no HTML views, asset pipeline, or CSRF tokens. If you need server-rendered pages, this is the wrong tool.
Performance
Snails delivers 3.1× the throughput of Rails in cluster mode and 11.8× that of a default Rails app — the sameGET /up on the same 8-core machine. It compiles to native code without Ruby's GVL, so one process uses every core; Rails needs a worker process per core to use the same hardware.
- Snails57,863
- Rails (cluster mode)18,547
- Rails (default)4,920
- p95 latency
- 1.1 msRails (cluster mode) 4.0 ms
- Startup time
- 8 msRails (default) 1.5 s
- Memory under load
- 39 MiBRails (cluster mode) 866 MiB
Medians of three 15-second runs with request logging off; startup time from five runs. The route serves JSON and touches no database or view, so this measures the request path. Ratios transfer between machines; absolute figures belong to the machine that ran them. See How it compares in the manual for the full table, and snails-benchmarkfor the method and raw results.