Skip to content

Commit 14fb66d

Browse files
committed
[rails] Add Iodine server
1 parent 2ed435c commit 14fb66d

File tree

7 files changed

+68
-14
lines changed

7 files changed

+68
-14
lines changed

frameworks/Ruby/rails/Gemfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,27 @@ gem 'rails', '~> 8.0.0'
44
gem 'redis', '~> 5.0'
55
gem 'tzinfo-data'
66

7-
group :mysql do
7+
group :mysql, optional: true do
88
gem 'trilogy', '~> 2.8.1'
99
end
1010

11-
group :postgresql do
11+
group :postgresql, optional: true do
1212
gem 'pg', '~> 1.5'
1313
end
1414

15-
group :falcon do
16-
gem 'falcon', '~> 0.47', require: false
15+
group :agoo, optional: true do
16+
gem 'agoo', require: false
17+
gem 'rackup'
1718
end
1819

19-
group :puma do
20-
gem 'puma', '~> 6.4', require: false
20+
group :iodine, optional: true do
21+
gem 'iodine', '~> 0.7', require: false
2122
end
2223

23-
group :agoo do
24-
gem 'agoo', require: false
25-
gem 'rackup'
24+
group :falcon, optional: true do
25+
gem 'falcon', '~> 0.47', require: false
26+
end
27+
28+
group :puma, optional: true do
29+
gem 'puma', '~> 6.4', require: false
2630
end

frameworks/Ruby/rails/benchmark_config.json

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,30 @@
6666
"database_os": "Linux",
6767
"display_name": "rails-falcon",
6868
"notes": "",
69-
"versus": "rack-falcon-mri"
69+
"versus": "rack-falcon-mri-sequel-raw"
70+
},
71+
"iodine": {
72+
"db_url": "/db",
73+
"json_url": "/json",
74+
"query_url": "/queries?queries=",
75+
"fortune_url": "/fortunes",
76+
"update_url": "/updates?queries=",
77+
"plaintext_url": "/plaintext",
78+
"cached_query_url": "/cached?queries=",
79+
"port": 8080,
80+
"approach": "Realistic",
81+
"classification": "Fullstack",
82+
"database": "Postgres",
83+
"framework": "rails",
84+
"language": "Ruby",
85+
"orm": "Full",
86+
"platform": "Rack",
87+
"webserver": "Iodine",
88+
"os": "Linux",
89+
"database_os": "Linux",
90+
"display_name": "rails-iodine",
91+
"notes": "",
92+
"versus": "rack-iodine-mri-sequel-raw"
7093
},
7194
"agoo": {
7295
"db_url": "/db",

frameworks/Ruby/rails/rails-agoo.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
1515
COPY ./Gemfile* /rails/
1616

1717
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18-
ENV BUNDLE_WITHOUT=mysql:falcon:puma
18+
ENV BUNDLE_WITH=postgresql:agoo
1919
RUN bundle install --jobs=8
2020

2121
COPY . /rails/

frameworks/Ruby/rails/rails-falcon.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
1515
COPY ./Gemfile* /rails/
1616

1717
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18-
ENV BUNDLE_WITHOUT=mysql:agoo:puma
18+
ENV BUNDLE_WITH=postgresql:falcon
1919
RUN bundle install --jobs=8
2020

2121
COPY . /rails/
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ruby:3.4-rc
2+
3+
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-server
4+
5+
EXPOSE 8080
6+
WORKDIR /rails
7+
8+
# ENV RUBY_YJIT_ENABLE=1 YJIT is enabled in config/initializers/enable_yjit.rb
9+
10+
# Use Jemalloc
11+
RUN apt-get update && \
12+
apt-get install -y --no-install-recommends libjemalloc2
13+
ENV LD_PRELOAD=libjemalloc.so.2
14+
15+
COPY ./Gemfile* /rails/
16+
17+
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18+
ENV BUNDLE_WITH=postgresql:iodine
19+
RUN bundle install --jobs=8
20+
21+
COPY . /rails/
22+
23+
ENV RAILS_ENV=production_postgresql
24+
ENV PORT=8080
25+
ENV REDIS_URL=redis://localhost:6379/0
26+
CMD service redis-server start && \
27+
rails server

frameworks/Ruby/rails/rails-mysql.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
1515
COPY ./Gemfile* /rails/
1616

1717
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18-
ENV BUNDLE_WITHOUT=postgresql:agoo:falcon
18+
ENV BUNDLE_WITH=mysql:puma
1919
RUN bundle install --jobs=8
2020

2121
COPY . /rails/

frameworks/Ruby/rails/rails.dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
1515
COPY ./Gemfile* /rails/
1616

1717
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18-
ENV BUNDLE_WITHOUT=mysql:agoo:falcon
18+
ENV BUNDLE_WITH=postgresql:puma
1919
RUN bundle install --jobs=8
2020

2121
COPY . /rails/

0 commit comments

Comments
 (0)