Skip to content

Commit 68a5018

Browse files
Merge pull request #9493 from p8/rack/iodine
[ruby/rack] Add Iodine server
2 parents fa67f85 + 1f29a03 commit 68a5018

File tree

10 files changed

+63
-12
lines changed

10 files changed

+63
-12
lines changed

frameworks/Ruby/rack/Gemfile

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,23 @@ gem 'sequel'
1111
gem 'sequel_pg', platforms: %i[ruby mswin]
1212
gem 'tzinfo-data', '1.2023.3'
1313

14-
group :falcon do
14+
group :falcon, optional: true do
1515
gem 'falcon', '~> 0.47', platforms: %i[ruby mswin]
1616
end
1717

18-
group :puma do
18+
group :iodine, optional: true do
19+
gem 'iodine', '~> 0.7', platforms: %i[ruby mswin]
20+
end
21+
22+
group :puma, optional: true do
1923
gem 'puma', '~> 6.4'
2024
end
2125

22-
group :unicorn do
26+
group :unicorn, optional: true do
2327
gem 'unicorn', '~> 6.1', platforms: %i[ruby mswin]
2428
end
2529

26-
group :development do
30+
group :development, optional: true do
2731
gem 'rack-test'
2832
gem 'rubocop', platforms: %i[ruby mswin]
2933
end

frameworks/Ruby/rack/Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ GEM
5353
io-endpoint (0.14.0)
5454
io-event (1.7.3)
5555
io-stream (0.6.1)
56+
iodine (0.7.58)
5657
json (2.9.1)
5758
kgio (2.11.4)
5859
language_server-protocol (3.17.0.3)
@@ -127,6 +128,7 @@ PLATFORMS
127128
DEPENDENCIES
128129
connection_pool (~> 2.4)
129130
falcon (~> 0.47)
131+
iodine (~> 0.7)
130132
jdbc-postgres (~> 42.2)
131133
json (~> 2.8)
132134
pg (~> 1.5)

frameworks/Ruby/rack/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ comparing a variety of web servers.
1111
## Infrastructure Software Versions
1212
The tests were run with:
1313

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

2223

23-
2424
## Paths & Source for Tests
2525

2626
* Routing and controller logic is in hello_world.rb

frameworks/Ruby/rack/benchmark_config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,27 @@
2323
"display_name": "rack-puma-mri-sequel-raw",
2424
"notes": ""
2525
},
26+
"iodine": {
27+
"json_url": "/json",
28+
"plaintext_url": "/plaintext",
29+
"db_url": "/db",
30+
"query_url": "/queries?queries=",
31+
"fortune_url": "/fortunes",
32+
"update_url": "/updates?queries=",
33+
"port": 8080,
34+
"approach": "Stripped",
35+
"classification": "Micro",
36+
"orm": "raw",
37+
"database": "Postgres",
38+
"framework": "rack",
39+
"language": "Ruby",
40+
"platform": "Mri",
41+
"webserver": "Iodine",
42+
"os": "Linux",
43+
"database_os": "Linux",
44+
"display_name": "rack-iodine-mri-sequel-raw",
45+
"notes": ""
46+
},
2647
"unicorn": {
2748
"json_url": "/json",
2849
"plaintext_url": "/plaintext",

frameworks/Ruby/rack/hello_world.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ class HelloWorld
2929
'Passenger'
3030
elsif defined?(Puma)
3131
'Puma'
32+
elsif defined?(Iodine)
33+
'Iodine'
3234
elsif defined?(Unicorn)
3335
'Unicorn'
3436
elsif defined?(Falcon)

frameworks/Ruby/rack/rack-falcon.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WORKDIR /rack
1212
COPY Gemfile ./
1313

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

1818
COPY . .
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM ruby:3.4
2+
3+
ENV RUBY_YJIT_ENABLE=1
4+
5+
# Use Jemalloc
6+
RUN apt-get update && \
7+
apt-get install -y --no-install-recommends libjemalloc2
8+
ENV LD_PRELOAD=libjemalloc.so.2
9+
10+
WORKDIR /rack
11+
12+
COPY Gemfile ./
13+
14+
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
15+
RUN bundle config set with 'iodine'
16+
RUN bundle install --jobs=8
17+
18+
COPY . .
19+
20+
EXPOSE 8080
21+
22+
CMD bundle exec iodine -p 8080

frameworks/Ruby/rack/rack-jruby.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ WORKDIR /rack
66

77
COPY Gemfile ./
88

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

1212
COPY . .

frameworks/Ruby/rack/rack-unicorn.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WORKDIR /rack
1212
COPY Gemfile ./
1313

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

1818
COPY . .

frameworks/Ruby/rack/rack.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /rack
1313
COPY Gemfile ./
1414

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

1919
COPY . .

0 commit comments

Comments
 (0)