diff --git a/frameworks/Ruby/rails/Gemfile b/frameworks/Ruby/rails/Gemfile index e5d6e743679..b188913327b 100644 --- a/frameworks/Ruby/rails/Gemfile +++ b/frameworks/Ruby/rails/Gemfile @@ -1,10 +1,31 @@ source 'https://rubygems.org' gem 'oj', '~> 3.16' -gem 'pg', '~> 1.5', group: :postgresql -gem 'puma', '~> 6.4', require: false -gem 'falcon', '~> 0.47', require: false gem 'rails', '~> 7.2.0' gem 'redis', '~> 5.0' -gem 'trilogy', '~> 2.8.1', group: :mysql gem 'tzinfo-data' + +group :mysql do + gem 'trilogy', '~> 2.8.1' +end + +group :postgresql do + gem 'pg', '~> 1.5' +end + +group :falcon do + gem 'falcon', '~> 0.47', require: false +end + +group :puma do + gem 'puma', '~> 6.4', require: false +end + +group :unicorn do + gem 'unicorn', '~> 6.1', require: false +end + +group :agoo do + gem 'agoo', require: false + gem 'rackup' +end diff --git a/frameworks/Ruby/rails/Gemfile.lock b/frameworks/Ruby/rails/Gemfile.lock index 311ffc7f814..9773df3e123 100644 --- a/frameworks/Ruby/rails/Gemfile.lock +++ b/frameworks/Ruby/rails/Gemfile.lock @@ -71,6 +71,7 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) + agoo (2.15.13) async (2.17.0) console (~> 1.26) fiber-annotation @@ -137,6 +138,7 @@ GEM rdoc (>= 4.0.0) reline (>= 0.4.2) json (2.7.2) + kgio (2.11.4) localhost (1.3.1) logger (1.6.1) loofah (2.22.0) @@ -232,6 +234,7 @@ GEM rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) + raindrops (0.20.1) rake (13.2.1) rdoc (6.7.0) psych (>= 4.0.0) @@ -254,6 +257,9 @@ GEM concurrent-ruby (~> 1.0) tzinfo-data (1.2024.2) tzinfo (>= 1.0.0) + unicorn (6.1.0) + kgio (~> 2.6) + raindrops (~> 0.7) useragent (0.16.10) webrick (1.8.2) websocket-driver (0.7.6) @@ -267,14 +273,17 @@ PLATFORMS x86_64-linux DEPENDENCIES + agoo falcon (~> 0.47) oj (~> 3.16) pg (~> 1.5) puma (~> 6.4) + rackup rails (~> 7.2.0) redis (~> 5.0) trilogy (~> 2.8.1) tzinfo-data + unicorn (~> 6.1) BUNDLED WITH 2.3.3 diff --git a/frameworks/Ruby/rails/benchmark_config.json b/frameworks/Ruby/rails/benchmark_config.json index c5562485d6f..f663c793a3d 100644 --- a/frameworks/Ruby/rails/benchmark_config.json +++ b/frameworks/Ruby/rails/benchmark_config.json @@ -52,6 +52,7 @@ "fortune_url": "/fortunes", "update_url": "/updates?queries=", "plaintext_url": "/plaintext", + "cached_query_url": "/cached?queries=", "port": 8080, "approach": "Realistic", "classification": "Fullstack", @@ -66,6 +67,29 @@ "display_name": "rails-falcon", "notes": "", "versus": "rack-falcon-mri" + }, + "agoo": { + "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": "Agoo", + "os": "Linux", + "database_os": "Linux", + "display_name": "rails-agoo", + "notes": "", + "versus": "" } }] } diff --git a/frameworks/Ruby/rails/config/agoo.rb b/frameworks/Ruby/rails/config/agoo.rb new file mode 100644 index 00000000000..e69de29bb2d diff --git a/frameworks/Ruby/rails/rails-agoo.dockerfile b/frameworks/Ruby/rails/rails-agoo.dockerfile new file mode 100644 index 00000000000..7160fe32f84 --- /dev/null +++ b/frameworks/Ruby/rails/rails-agoo.dockerfile @@ -0,0 +1,27 @@ +FROM ruby:3.4-rc + +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_WITHOUT=trilogy +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 +CMD RACK_ENV=production bundle exec rackup -r agoo -s agoo -p 8080 -q -O workers=$(ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1)