Skip to content

Commit b390629

Browse files
authored
[rails] Replace Agoo server with Pitchfork (#9736)
Agoo is a less commonly used server and can be somewhat unstable. Pitchfork is a maintained alternative for Unicorn (which hasn't seen updates since 2021).
1 parent b4a59b0 commit b390629

File tree

6 files changed

+22
-14
lines changed

6 files changed

+22
-14
lines changed

frameworks/Ruby/rails/Gemfile

+4-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ group :postgresql, optional: true do
1212
gem 'pg', '~> 1.5'
1313
end
1414

15-
group :agoo, optional: true do
16-
gem 'agoo', require: false
17-
gem 'rackup'
18-
end
19-
2015
group :iodine, optional: true do
2116
gem 'iodine', '~> 0.7', require: false
2217
end
@@ -28,3 +23,7 @@ end
2823
group :puma, optional: true do
2924
gem 'puma', '~> 6.5', require: false
3025
end
26+
27+
group :pitchfork, optional: true do
28+
gem 'pitchfork', '~> 0.17'
29+
end

frameworks/Ruby/rails/Gemfile.lock

+4-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ GEM
7272
securerandom (>= 0.3)
7373
tzinfo (~> 2.0, >= 2.0.5)
7474
uri (>= 0.13.1)
75-
agoo (2.15.13)
7675
async (2.23.0)
7776
console (~> 1.29)
7877
fiber-annotation
@@ -184,6 +183,9 @@ GEM
184183
racc (~> 1.4)
185184
openssl (3.3.0)
186185
pg (1.5.9)
186+
pitchfork (0.17.0)
187+
logger
188+
rack (>= 2.0)
187189
pp (0.6.2)
188190
prettyprint
189191
prettyprint (0.2.0)
@@ -276,12 +278,11 @@ PLATFORMS
276278
x86_64-linux
277279

278280
DEPENDENCIES
279-
agoo
280281
falcon (~> 0.47)
281282
iodine (~> 0.7)
282283
pg (~> 1.5)
284+
pitchfork (~> 0.17)
283285
puma (~> 6.5)
284-
rackup
285286
rails (~> 8.0.0)
286287
redis (~> 5.0)
287288
trilogy (~> 2.8.1)

frameworks/Ruby/rails/README.md

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ The tests were run with:
1717
- [Puma 6.4](http://puma.io/)
1818
- [Iodine](https://github.com/boazsegev/iodine)
1919
- [Falcon](https://github.com/socketry/falcon)
20+
- [Pitchfork](https://github.com/Shopify/pitchfork)
2021
- [MySQL](https://dev.mysql.com/)
2122
- [PostgreSQL](https://www.postgresql.org/)
2223
- [Redis 6](https://redis.io)

frameworks/Ruby/rails/benchmark_config.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"notes": "",
9292
"versus": "rack-iodine-mri-sequel-raw"
9393
},
94-
"agoo": {
94+
"pitchfork": {
9595
"db_url": "/db",
9696
"json_url": "/json",
9797
"query_url": "/queries?queries=",
@@ -107,12 +107,12 @@
107107
"language": "Ruby",
108108
"orm": "Full",
109109
"platform": "Rack",
110-
"webserver": "Agoo",
110+
"webserver": "Pitchfork",
111111
"os": "Linux",
112112
"database_os": "Linux",
113-
"display_name": "rails-agoo",
113+
"display_name": "rails-pitchfork",
114114
"notes": "",
115-
"versus": ""
115+
"versus": "rack-pitchfork-mri-sequel-raw"
116116
}
117117
}]
118118
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# frozen_string_literal: true
2+
3+
require_relative 'auto_tune'
4+
5+
num_workers, = auto_tune
6+
7+
worker_processes num_workers

frameworks/Ruby/rails/rails-agoo.dockerfile renamed to frameworks/Ruby/rails/rails-pitchfork.dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ENV LD_PRELOAD=libjemalloc.so.2
1515
COPY ./Gemfile* /rails/
1616

1717
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18-
ENV BUNDLE_WITH=postgresql:agoo
18+
ENV BUNDLE_WITH=postgresql:pitchfork
1919
RUN bundle install --jobs=8
2020

2121
COPY . /rails/
@@ -24,4 +24,4 @@ ENV RAILS_ENV=production_postgresql
2424
ENV PORT=8080
2525
ENV REDIS_URL=redis://localhost:6379/0
2626
CMD service redis-server start && \
27-
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)
27+
RACK_ENV=production bundle exec pitchfork -c config/pitchfork.rb

0 commit comments

Comments
 (0)