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.

Install the CLILinux · macOS for development
curl -fsSL https://raw.githubusercontent.com/snails-rb/dist/main/install.sh | bash

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.

config/routes.rbRuby
# inside Snails::RouteTable.table
resources("/posts", PostsController, :json)
app/controllers/posts_controller.rb
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
end
$ bin/test
ok posts_test.rb
5/5 passed

Why Snails

Rails conventions, one binary.

Snails keeps the Rails conventions an API needs. The view layer is gone, and the server runs without Ruby.

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.

Requests per second · 32 concurrent connections · higher is better
  • 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.