Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions frameworks/Ruby/rack/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ group :iodine, optional: true do
gem 'iodine', '~> 0.7', platforms: %i[ruby mswin]
end

group :passenger, optional: true do
gem 'base64' # required by passenger on Ruby 3.4
gem 'passenger', '~> 6.0', platforms: [:ruby, :mswin], require: false
end

group :pitchfork, optional: true do
gem 'pitchfork', '~> 0.17'
end
Expand Down
10 changes: 10 additions & 0 deletions frameworks/Ruby/rack/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ GEM
async-service (0.13.0)
async
async-container (~> 0.16)
base64 (0.2.0)
bigdecimal (3.1.9)
concurrent-ruby (1.3.5)
connection_pool (2.5.0)
Expand Down Expand Up @@ -75,6 +76,10 @@ GEM
parser (3.3.7.1)
ast (~> 2.4.1)
racc
passenger (6.0.26)
rack (>= 1.6.13)
rackup (>= 2.0.0)
rake (>= 12.3.3)
pg (1.5.9)
pitchfork (0.17.0)
logger
Expand All @@ -95,8 +100,11 @@ GEM
rack (3.1.11)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.2.1)
rack (>= 3)
rainbow (3.1.1)
raindrops (0.20.1)
rake (13.2.1)
regexp_parser (2.10.0)
rubocop (1.73.2)
json (~> 2.3)
Expand Down Expand Up @@ -137,11 +145,13 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
base64
connection_pool (~> 2.4)
falcon (~> 0.47)
iodine (~> 0.7)
jdbc-postgres (~> 42.2)
json (~> 2.10)
passenger (~> 6.0)
pg (~> 1.5)
pitchfork (~> 0.17)
puma (~> 6.5)
Expand Down
21 changes: 21 additions & 0 deletions frameworks/Ruby/rack/benchmark_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,27 @@
"display_name": "rack-puma-jruby-sequel-raw",
"notes": ""
},
"passenger": {
"json_url": "/json",
"plaintext_url": "/plaintext",
"db_url": "/db",
"query_url": "/queries?queries=",
"fortune_url": "/fortunes",
"update_url": "/updates?queries=",
"port": 8080,
"approach": "Realistic",
"classification": "Micro",
"orm": "raw",
"database": "Postgres",
"framework": "rack",
"language": "Ruby",
"platform": "Jruby",
"webserver": "Passenger",
"os": "Linux",
"database_os": "Linux",
"display_name": "rack-passenger-mri-sequel-raw",
"notes": ""
},
"pitchfork": {
"json_url": "/json",
"plaintext_url": "/plaintext",
Expand Down
12 changes: 1 addition & 11 deletions frameworks/Ruby/rack/hello_world.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,7 @@ class HelloWorld
PLAINTEXT_TYPE = 'text/plain'
DATE = 'Date'
SERVER = 'Server'
SERVER_STRING = if defined?(Puma)
'Puma'
elsif defined?(Iodine)
'Iodine'
elsif defined?(Unicorn)
'Unicorn'
elsif defined?(Falcon)
'Falcon'
else
'Ruby Rack'
end
SERVER_STRING = 'Rack'
TEMPLATE_PREFIX = '<!DOCTYPE html>
<html>
<head>
Expand Down
31 changes: 31 additions & 0 deletions frameworks/Ruby/rack/rack-passenger.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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

WORKDIR /rack

COPY Gemfile ./

ENV BUNDLE_FORCE_RUBY_PLATFORM=true
RUN bundle config set with 'passenger'
RUN bundle install --jobs=8

COPY . .

# TODO: https://github.com/phusion/passenger/issues/1916
ENV _PASSENGER_FORCE_HTTP_SESSION=true

RUN ruby config/auto_tune.rb | grep -Eo '[0-9]+' | head -n 1 > 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

Loading