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
4 changes: 4 additions & 0 deletions frameworks/Ruby/rack/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ group :iodine, optional: true do
gem 'iodine', '~> 0.7', platforms: %i[ruby mswin]
end

group :pitchfork, optional: true do
gem 'pitchfork', '~> 0.17'
end

group :puma, optional: true do
gem 'puma', '~> 6.5'
end
Expand Down
5 changes: 5 additions & 0 deletions frameworks/Ruby/rack/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ GEM
language_server-protocol (3.17.0.4)
lint_roller (1.1.0)
localhost (1.3.1)
logger (1.6.6)
mapping (1.1.1)
memory-leak (0.5.2)
metrics (0.12.2)
Expand All @@ -75,6 +76,9 @@ GEM
ast (~> 2.4.1)
racc
pg (1.5.9)
pitchfork (0.17.0)
logger
rack (>= 2.0)
protocol-hpack (1.5.1)
protocol-http (0.49.0)
protocol-http1 (0.30.0)
Expand Down Expand Up @@ -139,6 +143,7 @@ DEPENDENCIES
jdbc-postgres (~> 42.2)
json (~> 2.10)
pg (~> 1.5)
pitchfork (~> 0.17)
puma (~> 6.5)
rack (~> 3.0)
rack-test
Expand Down
1 change: 1 addition & 0 deletions frameworks/Ruby/rack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The tests were run with:
* [Puma 6.4](http://puma.io/)
* [Iodine](https://github.com/boazsegev/iodine)
* [Falcon](https://github.com/socketry/falcon)
* [Pitchfork](https://github.com/Shopify/pitchfork)
* [Sequel 5](https://sequel.jeremyevans.net/)


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 @@ -106,6 +106,27 @@
"database_os": "Linux",
"display_name": "rack-puma-jruby-sequel-raw",
"notes": ""
},
"pitchfork": {
"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": "Platform",
"orm": "raw",
"database": "Postgres",
"framework": "rack",
"language": "Ruby",
"platform": "Mri",
"webserver": "Pitchfork",
"os": "Linux",
"database_os": "Linux",
"display_name": "rack-pitchfork-mri-sequel-raw",
"notes": ""
}
}
]
Expand Down
Empty file modified frameworks/Ruby/rack/config/auto_tune.rb
100755 → 100644
Empty file.
11 changes: 11 additions & 0 deletions frameworks/Ruby/rack/config/pitchfork.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

require_relative 'auto_tune'
require 'sequel'
num_workers, = auto_tune

worker_processes num_workers

before_fork do |_server|
Sequel::DATABASES.each(&:disconnect)
end
Empty file modified frameworks/Ruby/rack/falcon.rb
100755 → 100644
Empty file.
22 changes: 22 additions & 0 deletions frameworks/Ruby/rack/rack-pitchfork.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
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 'pitchfork'
RUN bundle install --jobs=8

COPY . .

EXPOSE 8080

CMD bundle exec pitchfork -c config/pitchfork.rb -o 0.0.0.0 -p 8080 -E production
Loading