Raptor
Raptor is a high-performance, preloading, multi-process, multi-threaded Ruby 4+ web server implementing Rack 3.2+, leveraging Ractors for parallel HTTP/1.1 and HTTP/2 request processing, native C extensions for HTTP parsing and HPACK compression, and NIO for non-blocking I/O.
Installation
Install the gem and add to the application's Gemfile by executing:
bundle add raptor
If bundler is not being used to manage dependencies, install the gem by executing:
gem install raptor
Usage
# hello_world.ru
# frozen_string_literal: true
run proc { |_env| [200, { "content-type" => "text/plain" }, ["Hello, World!"]] }
> bundle exec raptor -t 3 -w 4 hello_world.ru
Raptor Cluster initializing:
├─ Version: 0.4.0
├─ Ruby Version: ruby 4.0.5 (2026-05-20 revision 64336ffd0e) +YJIT +PRISM [arm64-darwin23]
├─ Master PID: 26456
│ └─ 4 worker processes
│ ├─ 1 server thread
│ ├─ 1 reactor thread
│ ├─ 1 pipeline ractor
│ ├─ 1 pipeline collector thread
│ ├─ 3 worker threads
│ └─ 1 stats thread
└─ Listening on 0.0.0.0:9292
[26459] Worker 0 booted
[26460] Worker 1 booted
[26461] Worker 2 booted
[26462] Worker 3 booted
> curl localhost:9292
Hello, World!%
Also works with rackup and rails server:
> bundle exec rackup -s raptor hello_world.ru
> bundle exec rails server -u raptor
(Micro) Benchmarks
Raptor 0.4.0 vs Puma 8.0.1:
| Protocol | Raptor | Puma |
|---|---|---|
| HTTP/1.1 | ~20k req/s | ~21k req/s |
| HTTP/1.1 (keep-alive) | ~60k req/s | ~45k req/s |
| HTTP/2 | ~23k req/s | N/A |
Ruby 4.0.5 +YJIT, macOS Apple Silicon. 4 workers, 3 threads, 12 concurrent connections.
Development
After checking out the repo, run bin/setup to install dependencies. Then, run bundle exec rake to compile native
extensions and run the tests. You can also run bin/console for an interactive prompt that will allow you to
experiment.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/joshuay03/raptor. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Raptor project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.