Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions frameworks/Ruby/rack/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ group :iodine, optional: true do
gem 'iodine', '~> 0.7', platforms: %i[ruby windows]
end

group :itsi, optional: true do
gem 'itsi'
end

group :passenger, optional: true do
gem 'logger' # required by passenger on Ruby 3.5
gem 'passenger', '~> 6.1', platforms: [:ruby, :windows], require: false
Expand Down
15 changes: 15 additions & 0 deletions frameworks/Ruby/rack/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ GEM
io-event (1.9.0)
io-stream (0.6.1)
iodine (0.7.58)
itsi (0.2.18)
itsi-scheduler (~> 0.2.18)
itsi-server (~> 0.2.18)
itsi-scheduler (0.2.18)
rb_sys (~> 0.9.91)
itsi-server (0.2.18)
json (~> 2)
prism (~> 1.4)
rack (>= 1.6)
rb_sys (~> 0.9.91)
json (2.13.2)
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
Expand All @@ -84,6 +94,7 @@ GEM
pitchfork (0.17.0)
logger
rack (>= 2.0)
prism (1.4.0)
protocol-hpack (1.5.1)
protocol-http (0.54.0)
protocol-http1 (0.35.2)
Expand All @@ -104,6 +115,9 @@ GEM
rack (>= 3)
rainbow (3.1.1)
rake (13.3.0)
rake-compiler-dock (1.9.1)
rb_sys (0.9.117)
rake-compiler-dock (= 1.9.1)
regexp_parser (2.10.0)
rubocop (1.73.2)
json (~> 2.3)
Expand Down Expand Up @@ -145,6 +159,7 @@ DEPENDENCIES
connection_pool (~> 2.4)
falcon (~> 0.47)
iodine (~> 0.7)
itsi
jdbc-postgres (~> 42.2)
json (~> 2.10)
logger
Expand Down
9 changes: 5 additions & 4 deletions frameworks/Ruby/rack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ The tests were run with:

* [Ruby 3.4](http://www.ruby-lang.org/)
* [JRuby 9.4](http://jruby.org/)
* [Rack 3.1](http://rack.github.com/)
* [Unicorn 6.1.0](http://unicorn.bogomips.org/)
* [Puma 7](http://puma.io/)
* [Iodine](https://github.com/boazsegev/iodine)
* [Rack 3](http://rack.github.com/)
* [Falcon](https://github.com/socketry/falcon)
* [Iodine](https://github.com/boazsegev/iodine)
* [Itsi](https://github.com/wouterken/itsi)
* [Passenger](https://github.com/phusion/passenger)
* [Pitchfork](https://github.com/Shopify/pitchfork)
* [Puma](http://puma.io/)
* [Sequel 5](https://sequel.jeremyevans.net/)


Expand Down
21 changes: 21 additions & 0 deletions frameworks/Ruby/rack/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,27 @@
"display_name": "rack [falcon]",
"notes": ""
},
"itsi": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"fortune_url": "/fortunes",
"update_url": "/updates?queries=",
"port": 8080,
"approach": "Realistic",
"classification": "Platform",
"orm": "raw",
"database": "Postgres",
"framework": "rack",
"language": "Ruby",
"platform": "Mri",
"webserver": "Itsi",
"os": "Linux",
"database_os": "Linux",
"display_name": "rack [itsi]",
"notes": ""
},
"jruby": {
"json_url": "/json",
"plaintext_url": "/plaintext",
Expand Down
13 changes: 13 additions & 0 deletions frameworks/Ruby/rack/config/itsi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require_relative 'auto_tune'

rackup_file './config.ru'

ruby_thread_request_backlog_size 10_000

preload false

num_workers, num_threads = auto_tune

workers num_workers
threads num_threads
fiber_scheduler false
4 changes: 4 additions & 0 deletions frameworks/Ruby/rack/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ class HelloWorld
def initialize
if defined?(Puma) && (threads = Puma.cli_config.options.fetch(:max_threads)) > 1
max_connections = threads
elsif defined?(Itsi)
require_relative 'config/auto_tune'
_num_workers, num_threads = auto_tune
max_connections = num_threads
else
max_connections = 512
end
Expand Down
24 changes: 24 additions & 0 deletions frameworks/Ruby/rack/rack-itsi.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ruby:3.5-rc

ENV RUBY_YJIT_ENABLE=1

# Use Jemalloc
RUN apt-get update && \
apt-get install -y --no-install-recommends libjemalloc2
ENV LD_PRELOAD=libjemalloc.so.2

RUN apt-get install -y build-essential libclang-dev

WORKDIR /rack

COPY Gemfile* ./

ENV BUNDLE_FORCE_RUBY_PLATFORM=true
RUN bundle config set with 'itsi'
RUN bundle install --jobs=8

COPY . .

EXPOSE 8080

CMD bundle exec itsi start -C config/itsi.rb --bind "http://tfb-server:8080"
Loading