Browse Source

[rails] Add Iodine server

+-------------+---------+------+------+------+------+-------+------------+--------------+
|         name|plaintext|update|  json|    db| query|fortune|cached-query|weighted_score|
+-------------+---------+------+------+------+------+-------+------------+--------------+
|        rails|    24599| 10016| 84462| 24975| 15127|  15241|       16647|          1207|
| rails-iodine|   176699| 15306|116194| 32006| 25107|  18626|       31326|          1868|
Petrik 7 months ago
parent
commit
19fa4153d5

+ 13 - 9
frameworks/Ruby/rails/Gemfile

@@ -4,23 +4,27 @@ gem 'rails', '~> 8.0.0'
 gem 'redis', '~> 5.0'
 gem 'redis', '~> 5.0'
 gem 'tzinfo-data'
 gem 'tzinfo-data'
 
 
-group :mysql do
+group :mysql, optional: true do
   gem 'trilogy', '~> 2.8.1'
   gem 'trilogy', '~> 2.8.1'
 end
 end
 
 
-group :postgresql do
+group :postgresql, optional: true do
   gem 'pg', '~> 1.5'
   gem 'pg', '~> 1.5'
 end
 end
 
 
-group :falcon do
-  gem 'falcon', '~> 0.47', require: false
+group :agoo, optional: true do
+  gem 'agoo', require: false
+  gem 'rackup'
 end
 end
 
 
-group :puma do
-  gem 'puma', '~> 6.4', require: false
+group :iodine, optional: true do
+  gem 'iodine', '~> 0.7', require: false
 end
 end
 
 
-group :agoo do
-  gem 'agoo', require: false
-  gem 'rackup'
+group :falcon, optional: true do
+  gem 'falcon', '~> 0.47', require: false
+end
+
+group :puma, optional: true do
+  gem 'puma', '~> 6.4', require: false
 end
 end

+ 2 - 0
frameworks/Ruby/rails/Gemfile.lock

@@ -136,6 +136,7 @@ GEM
     io-endpoint (0.14.0)
     io-endpoint (0.14.0)
     io-event (1.7.3)
     io-event (1.7.3)
     io-stream (0.6.1)
     io-stream (0.6.1)
+    iodine (0.7.58)
     irb (1.14.1)
     irb (1.14.1)
       rdoc (>= 4.0.0)
       rdoc (>= 4.0.0)
       reline (>= 0.4.2)
       reline (>= 0.4.2)
@@ -269,6 +270,7 @@ PLATFORMS
 DEPENDENCIES
 DEPENDENCIES
   agoo
   agoo
   falcon (~> 0.47)
   falcon (~> 0.47)
+  iodine (~> 0.7)
   pg (~> 1.5)
   pg (~> 1.5)
   puma (~> 6.4)
   puma (~> 6.4)
   rackup
   rackup

+ 4 - 2
frameworks/Ruby/rails/README.md

@@ -12,9 +12,11 @@ comparing a variety of web platforms.
 
 
 The tests were run with:
 The tests were run with:
 
 
-- [Ruby 3.3](http://www.ruby-lang.org/)
-- [Rails 7.2](http://rubyonrails.org/)
+- [Ruby 3.4](http://www.ruby-lang.org/)
+- [Rails 8.0](http://rubyonrails.org/)
 - [Puma 6.4](http://puma.io/)
 - [Puma 6.4](http://puma.io/)
+- [Iodine](https://github.com/boazsegev/iodine)
+- [Falcon](https://github.com/socketry/falcon)
 - [MySQL](https://dev.mysql.com/)
 - [MySQL](https://dev.mysql.com/)
 - [PostgreSQL](https://www.postgresql.org/)
 - [PostgreSQL](https://www.postgresql.org/)
 - [Redis 6](https://redis.io)
 - [Redis 6](https://redis.io)

+ 24 - 1
frameworks/Ruby/rails/benchmark_config.json

@@ -66,7 +66,30 @@
       "database_os": "Linux",
       "database_os": "Linux",
       "display_name": "rails-falcon",
       "display_name": "rails-falcon",
       "notes": "",
       "notes": "",
-      "versus": "rack-falcon-mri"
+      "versus": "rack-falcon-mri-sequel-raw"
+    },
+    "iodine": {
+      "db_url": "/db",
+      "json_url": "/json",
+      "query_url": "/queries?queries=",
+      "fortune_url": "/fortunes",
+      "update_url": "/updates?queries=",
+      "plaintext_url": "/plaintext",
+      "cached_query_url": "/cached?queries=",
+      "port": 8080,
+      "approach": "Realistic",
+      "classification": "Fullstack",
+      "database": "Postgres",
+      "framework": "rails",
+      "language": "Ruby",
+      "orm": "Full",
+      "platform": "Rack",
+      "webserver": "Iodine",
+      "os": "Linux",
+      "database_os": "Linux",
+      "display_name": "rails-iodine",
+      "notes": "",
+      "versus": "rack-iodine-mri-sequel-raw"
     },
     },
     "agoo": {
     "agoo": {
       "db_url": "/db",
       "db_url": "/db",

+ 1 - 1
frameworks/Ruby/rails/rails-agoo.dockerfile

@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
 COPY ./Gemfile* /rails/
 COPY ./Gemfile* /rails/
 
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-ENV BUNDLE_WITHOUT=mysql:falcon:puma
+ENV BUNDLE_WITH=postgresql:agoo
 RUN bundle install --jobs=8
 RUN bundle install --jobs=8
 
 
 COPY . /rails/
 COPY . /rails/

+ 1 - 1
frameworks/Ruby/rails/rails-falcon.dockerfile

@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
 COPY ./Gemfile* /rails/
 COPY ./Gemfile* /rails/
 
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-ENV BUNDLE_WITHOUT=mysql:agoo:puma
+ENV BUNDLE_WITH=postgresql:falcon
 RUN bundle install --jobs=8
 RUN bundle install --jobs=8
 
 
 COPY . /rails/
 COPY . /rails/

+ 27 - 0
frameworks/Ruby/rails/rails-iodine.dockerfile

@@ -0,0 +1,27 @@
+FROM ruby:3.4
+
+RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-server
+
+EXPOSE 8080
+WORKDIR /rails
+
+# ENV RUBY_YJIT_ENABLE=1 YJIT is enabled in config/initializers/enable_yjit.rb
+
+# Use Jemalloc
+RUN apt-get update && \
+    apt-get install -y --no-install-recommends libjemalloc2
+ENV LD_PRELOAD=libjemalloc.so.2
+
+COPY ./Gemfile* /rails/
+
+ENV BUNDLE_FORCE_RUBY_PLATFORM=true
+ENV BUNDLE_WITH=postgresql:iodine
+RUN bundle install --jobs=8
+
+COPY . /rails/
+
+ENV RAILS_ENV=production_postgresql
+ENV PORT=8080
+ENV REDIS_URL=redis://localhost:6379/0
+CMD service redis-server start && \
+    bundle exec iodine

+ 1 - 1
frameworks/Ruby/rails/rails-mysql.dockerfile

@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
 COPY ./Gemfile* /rails/
 COPY ./Gemfile* /rails/
 
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-ENV BUNDLE_WITHOUT=postgresql:agoo:falcon
+ENV BUNDLE_WITH=mysql:puma
 RUN bundle install --jobs=8
 RUN bundle install --jobs=8
 
 
 COPY . /rails/
 COPY . /rails/

+ 1 - 1
frameworks/Ruby/rails/rails.dockerfile

@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
 COPY ./Gemfile* /rails/
 COPY ./Gemfile* /rails/
 
 
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
 ENV BUNDLE_FORCE_RUBY_PLATFORM=true
-ENV BUNDLE_WITHOUT=mysql:agoo:falcon
+ENV BUNDLE_WITH=postgresql:puma
 RUN bundle install --jobs=8
 RUN bundle install --jobs=8
 
 
 COPY . /rails/
 COPY . /rails/