Browse Source

[ruby/sinatra] Remove passenger (#9713)

Remove passenger as it is the slowest and it doesn't differentiate that
much.
Petrik de Heus 4 months ago
parent
commit
859c6f2295

+ 0 - 4
frameworks/Ruby/sinatra-sequel/Gemfile

@@ -17,10 +17,6 @@ group :iodine, optional: true do
   gem 'iodine', '~> 0.7', platforms: [:ruby, :mswin], require: false
 end
 
-group :passenger, optional: true do
-  gem 'passenger', '~> 6.0', platforms: [:ruby, :mswin], require: false
-end
-
 group :puma, optional: true do
   gem 'puma', '~> 6.4', require: false
 end

+ 0 - 8
frameworks/Ruby/sinatra-sequel/Gemfile.lock

@@ -11,10 +11,6 @@ GEM
       ruby2_keywords (~> 0.0.1)
     mysql2 (0.5.6)
     nio4r (2.7.4)
-    passenger (6.0.26)
-      rack (>= 1.6.13)
-      rackup (>= 2.0.0)
-      rake (>= 12.3.3)
     pg (1.5.9)
     puma (6.6.0)
       nio4r (~> 2.0)
@@ -26,10 +22,7 @@ GEM
     rack-session (2.1.0)
       base64 (>= 0.1.0)
       rack (>= 3.0.0)
-    rackup (2.2.1)
-      rack (>= 3)
     raindrops (0.20.1)
-    rake (13.2.1)
     ruby2_keywords (0.0.5)
     sequel (5.90.0)
       bigdecimal
@@ -57,7 +50,6 @@ DEPENDENCIES
   iodine (~> 0.7)
   json (~> 2.8)
   mysql2 (~> 0.5)
-  passenger (~> 6.0)
   pg (~> 1.5)
   puma (~> 6.4)
   sequel (~> 5.0)

+ 0 - 20
frameworks/Ruby/sinatra-sequel/benchmark_config.json

@@ -62,26 +62,6 @@
         "versus": "rack-sequel-postgres-iodine-mri",
         "notes": ""
       },
-      "postgres-passenger-mri": {
-        "db_url": "/db",
-        "query_url": "/queries?queries=",
-        "fortune_url": "/fortunes",
-        "update_url": "/updates?queries=",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "Postgres",
-        "framework": "sinatra",
-        "language": "Ruby",
-        "orm": "Full",
-        "platform": "Rack",
-        "webserver": "Passenger",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "sinatra-sequel-postgres-passenger-mri",
-        "versus": "rack-sequel-postgres-passenger-mri",
-        "notes": ""
-      },
       "postgres-unicorn-mri": {
         "db_url": "/db",
         "query_url": "/queries?queries=",

+ 3 - 16
frameworks/Ruby/sinatra-sequel/boot.rb

@@ -8,17 +8,7 @@ ALL_IDS = ID_RANGE.to_a
 QUERIES_MIN = 1
 QUERIES_MAX = 500
 SEQUEL_NO_ASSOCIATIONS = true
-
-SERVER_STRING =
-  if defined?(PhusionPassenger)
-    'passenger'
-  elsif defined?(Puma)
-    'puma'
-  elsif defined?(Unicorn)
-    'unicorn'
-  elsif defined?(Iodine)
-    'iodine'
-  end
+SERVER_STRING = "Sinatra"
 
 Bundler.require(:default) # Load core modules
 
@@ -33,13 +23,10 @@ def connect(dbtype)
   opts = {}
 
   # Determine threading/thread pool size and timeout
-  if defined?(JRUBY_VERSION)
-    opts[:max_connections] = (2 * Math.log(Integer(ENV.fetch('MAX_CONCURRENCY')))).floor
-    opts[:pool_timeout] = 10
-  elsif defined?(Puma) && (threads = Puma.cli_config.options.fetch(:max_threads)) > 1
+  if defined?(Puma) && (threads = Puma.cli_config.options.fetch(:max_threads)) > 1
     opts[:max_connections] = (2 * Math.log(threads)).floor
     opts[:pool_timeout] = 10
-  elsif defined?(Unicorn) || defined?(Passenger)
+  elsif defined?(Unicorn)
     Sequel.single_threaded = true
   end
 

+ 0 - 28
frameworks/Ruby/sinatra-sequel/sinatra-sequel-postgres-passenger-mri.dockerfile

@@ -1,28 +0,0 @@
-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
-
-ADD ./ /sinatra-sequel
-WORKDIR /sinatra-sequel
-
-ENV BUNDLE_WITH=postgresql:passenger
-RUN bundle install --jobs=4 --gemfile=/sinatra-sequel/Gemfile
-
-# TODO: https://github.com/phusion/passenger/issues/1916
-ENV _PASSENGER_FORCE_HTTP_SESSION=true
-ENV DBTYPE=postgresql
-
-RUN ruby -r /sinatra-sequel/config/auto_tune -e 'puts auto_tune.first' > instances
-
-EXPOSE 8080
-
-CMD bundle exec passenger start --log-level 1 \
-       --engine builtin --disable-turbocaching --disable-security-update-check \
-       --spawn-method direct --max-pool-size $(cat instances) --min-instances $(cat instances) --max-request-queue-size 1024 \
-       --address 0.0.0.0 --port 8080 --environment production
-

+ 0 - 4
frameworks/Ruby/sinatra/Gemfile

@@ -16,10 +16,6 @@ group :iodine, optional: true do
   gem 'iodine', '~> 0.7', platforms: [:ruby, :mswin], require: false
 end
 
-group :passenger, optional: true do
-  gem 'passenger', '~> 6.0', platforms: [:ruby, :mswin], require: false
-end
-
 group :puma, optional: true do
   gem 'puma', '~> 6.4', require: false
 end

+ 0 - 6
frameworks/Ruby/sinatra/Gemfile.lock

@@ -38,10 +38,6 @@ GEM
       ruby2_keywords (~> 0.0.1)
     mysql2 (0.5.6)
     nio4r (2.7.4)
-    passenger (6.0.26)
-      rack (>= 1.6.13)
-      rackup (>= 2.0.0)
-      rake (>= 12.3.3)
     pg (1.5.9)
     puma (6.6.0)
       nio4r (~> 2.0)
@@ -56,7 +52,6 @@ GEM
     rackup (2.2.1)
       rack (>= 3)
     raindrops (0.20.1)
-    rake (13.2.1)
     ruby2_keywords (0.0.5)
     securerandom (0.4.1)
     sinatra (4.1.1)
@@ -86,7 +81,6 @@ DEPENDENCIES
   iodine (~> 0.7)
   json (~> 2.8)
   mysql2 (~> 0.5)
-  passenger (~> 6.0)
   pg (~> 1.5)
   puma (~> 6.4)
   rackup

+ 0 - 20
frameworks/Ruby/sinatra/benchmark_config.json

@@ -88,26 +88,6 @@
         "versus": "rack-postgres-iodine-mri",
         "notes": ""
       },
-      "postgres-passenger-mri": {
-        "db_url": "/db",
-        "query_url": "/queries?queries=",
-        "fortune_url": "/fortunes",
-        "update_url": "/updates?queries=",
-        "port": 8080,
-        "approach": "Realistic",
-        "classification": "Micro",
-        "database": "Postgres",
-        "framework": "sinatra",
-        "language": "Ruby",
-        "orm": "Full",
-        "platform": "Rack",
-        "webserver": "Passenger",
-        "os": "Linux",
-        "database_os": "Linux",
-        "display_name": "sinatra-postgres-passenger-mri",
-        "versus": "rack-postgres-passenger-mri",
-        "notes": ""
-      },
       "postgres-unicorn-mri": {
         "db_url": "/db",
         "query_url": "/queries?queries=",

+ 1 - 13
frameworks/Ruby/sinatra/boot.rb

@@ -7,19 +7,7 @@ ID_RANGE = (1..MAX_PK).freeze
 ALL_IDS = ID_RANGE.to_a
 QUERIES_MIN = 1
 QUERIES_MAX = 500
-
-SERVER_STRING =
-  if defined?(PhusionPassenger)
-    'passenger'
-  elsif defined?(Puma)
-    'puma'
-  elsif defined?(Unicorn)
-    'unicorn'
-  elsif defined?(Iodine)
-    'iodine'
-  elsif defined?(Agoo)
-    'agoo'
-  end
+SERVER_STRING = "Sinatra"
 
 Bundler.require(:default) # Load core modules
 

+ 0 - 28
frameworks/Ruby/sinatra/sinatra-postgres-passenger-mri.dockerfile

@@ -1,28 +0,0 @@
-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
-
-ADD ./ /sinatra
-WORKDIR /sinatra
-
-ENV BUNDLE_WITH=postgresql:passenger
-RUN bundle install --jobs=4 --gemfile=/sinatra/Gemfile
-
-# TODO: https://github.com/phusion/passenger/issues/1916
-ENV _PASSENGER_FORCE_HTTP_SESSION=true
-ENV DBTYPE=postgresql
-
-RUN ruby -r /sinatra/config/auto_tune -e 'puts auto_tune.first' > instances
-
-EXPOSE 8080
-
-CMD bundle exec passenger start --log-level 1 \
-       --engine builtin --disable-turbocaching --disable-security-update-check \
-       --spawn-method direct --max-pool-size $(cat instances) --min-instances $(cat instances) --max-request-queue-size 1024 \
-       --address 0.0.0.0 --port 8080 --environment production
-