Skip to content

Commit

Permalink
Merge pull request #9493 from p8/rack/iodine
Browse files Browse the repository at this point in the history
[ruby/rack] Add Iodine server
  • Loading branch information
msmith-techempower authored Jan 6, 2025
2 parents fa67f85 + 1f29a03 commit 68a5018
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 12 deletions.
12 changes: 8 additions & 4 deletions frameworks/Ruby/rack/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,23 @@ gem 'sequel'
gem 'sequel_pg', platforms: %i[ruby mswin]
gem 'tzinfo-data', '1.2023.3'

group :falcon do
group :falcon, optional: true do
gem 'falcon', '~> 0.47', platforms: %i[ruby mswin]
end

group :puma do
group :iodine, optional: true do
gem 'iodine', '~> 0.7', platforms: %i[ruby mswin]
end

group :puma, optional: true do
gem 'puma', '~> 6.4'
end

group :unicorn do
group :unicorn, optional: true do
gem 'unicorn', '~> 6.1', platforms: %i[ruby mswin]
end

group :development do
group :development, optional: true do
gem 'rack-test'
gem 'rubocop', platforms: %i[ruby mswin]
end
2 changes: 2 additions & 0 deletions frameworks/Ruby/rack/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ GEM
io-endpoint (0.14.0)
io-event (1.7.3)
io-stream (0.6.1)
iodine (0.7.58)
json (2.9.1)
kgio (2.11.4)
language_server-protocol (3.17.0.3)
Expand Down Expand Up @@ -127,6 +128,7 @@ PLATFORMS
DEPENDENCIES
connection_pool (~> 2.4)
falcon (~> 0.47)
iodine (~> 0.7)
jdbc-postgres (~> 42.2)
json (~> 2.8)
pg (~> 1.5)
Expand Down
8 changes: 4 additions & 4 deletions frameworks/Ruby/rack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ comparing a variety of web servers.
## Infrastructure Software Versions
The tests were run with:

* [Ruby 3.3](http://www.ruby-lang.org/)
* [Ruby 3.4](http://www.ruby-lang.org/)
* [JRuby 9.4](http://jruby.org/)
* [Rack 3.0.7](http://rack.github.com/)
* [Unicorn 6.1.0](http://unicorn.bogomips.org/)
* [Puma 6.2.1](http://puma.io/)
* [Falcon 0.42.3](https://github.com/socketry/falcon)
* [Puma 6.4](http://puma.io/)
* [Iodine](https://github.com/boazsegev/iodine)
* [Falcon](https://github.com/socketry/falcon)
* [Sequel 5.68.0](https://sequel.jeremyevans.net/)



## Paths & Source for Tests

* Routing and controller logic is in hello_world.rb
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 @@ -23,6 +23,27 @@
"display_name": "rack-puma-mri-sequel-raw",
"notes": ""
},
"iodine": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"fortune_url": "/fortunes",
"update_url": "/updates?queries=",
"port": 8080,
"approach": "Stripped",
"classification": "Micro",
"orm": "raw",
"database": "Postgres",
"framework": "rack",
"language": "Ruby",
"platform": "Mri",
"webserver": "Iodine",
"os": "Linux",
"database_os": "Linux",
"display_name": "rack-iodine-mri-sequel-raw",
"notes": ""
},
"unicorn": {
"json_url": "/json",
"plaintext_url": "/plaintext",
Expand Down
2 changes: 2 additions & 0 deletions frameworks/Ruby/rack/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class HelloWorld
'Passenger'
elsif defined?(Puma)
'Puma'
elsif defined?(Iodine)
'Iodine'
elsif defined?(Unicorn)
'Unicorn'
elsif defined?(Falcon)
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack/rack-falcon.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WORKDIR /rack
COPY Gemfile ./

ENV BUNDLE_FORCE_RUBY_PLATFORM=true
RUN bundle config set without 'development test puma unicorn'
RUN bundle config set with 'falcon'
RUN bundle install --jobs=8

COPY . .
Expand Down
22 changes: 22 additions & 0 deletions frameworks/Ruby/rack/rack-iodine.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM ruby:3.4

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

WORKDIR /rack

COPY Gemfile ./

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

COPY . .

EXPOSE 8080

CMD bundle exec iodine -p 8080
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack/rack-jruby.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ WORKDIR /rack

COPY Gemfile ./

RUN bundle config set without 'development test falcon unicorn'
RUN bundle config set with 'puma'
RUN bundle install --jobs=8

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack/rack-unicorn.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ WORKDIR /rack
COPY Gemfile ./

ENV BUNDLE_FORCE_RUBY_PLATFORM=true
RUN bundle config set without 'development test falcon puma'
RUN bundle config set with 'unicorn'
RUN bundle install --jobs=8

COPY . .
Expand Down
2 changes: 1 addition & 1 deletion frameworks/Ruby/rack/rack.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /rack
COPY Gemfile ./

ENV BUNDLE_FORCE_RUBY_PLATFORM=true
RUN bundle config set without 'development test falcon unicorn'
RUN bundle config set with 'puma'
RUN bundle install --jobs=8

COPY . .
Expand Down

0 comments on commit 68a5018

Please sign in to comment.