Hateburo: kazeburo hatenablog

Operations Engineer / Site Reliability / 運用系小姑 / Perl Monger

Rhebok, a High Performance Rack Handler/Server 2x faster than Unicorn

Last December I released Rhebok to rubygems. Rhebok is a High Performance Rack Handler/Server.

rhebok | RubyGems.org | your community gem host

kazeburo/rhebok · GitHub

Rhebok is a standalone Preforking Web Server. This server is optimized for running HTTP application server behind a reverse proxy like nginx. When start Rhebok as upstream server of nginx and connect via unix domain socket, Rhebok is 2 times faster than Unicorn.

Benchmark

f:id:kazeburo:20150106161554p:plain

"nginx static file" represents req/sec when delivering 13 bytes static files from nginx

Benchmark details is here.

Features

Rhebok supports following features.

  • ultra fast HTTP processing using picohttpparser
  • uses accept4(2) if OS support
  • uses writev(2) for output responses
  • prefork and graceful shutdown using prefork_engine
  • hot deploy using start_server (here is golang version by lestrrat-san)
  • supports HTTP/1.1. But does not have Keepalive.
  • supports OobGC

Installation and Usage

Add this line to your application's Gemfile and execute bundle install

gem 'rhebok'

Or install it yourself as

$ gem install rhebok

To run Rhebok, use the rackup command.

$ rackup -s Rhebok --port 8080 -O MaxWorkers=5 -O MaxRequestPerChild=1000 -O OobGC=yes -E production config.ru

For more details, please read README.md. If you found problems and bug, please send p-r or issue to github