ruby3-http-server icon indicating copy to clipboard operation
ruby3-http-server copied to clipboard

Ruby 3 HTTP server using Ractors

Ruby 3 HTTP Server

This project demonstrates a toy implementation of an HTTP server using Ractors / Fibers from Ruby 3, as well as single and multi-threaded implementations

Important: Ractors as Ruby team states are not production ready, you may experience random segfaults and random errors, nevertheless this approach may be viable in the future and presents a great learning opportunity

Usage

  1. Make sure you have ruby 3.0.1 installed.
  2. Edit start.rb to select the server, and the app you want to run
  3. Run:
bundle install
bundle exec ruby start.rb

You can send requests via

ab -n 10000 -c 4 http://127.0.0.1:3000/test.txt