Skip to content

Commit 668341f

Browse files
authored
[rails] Test with agoo server (#9363)
1 parent 157bbff commit 668341f

File tree

5 files changed

+85
-4
lines changed

5 files changed

+85
-4
lines changed

frameworks/Ruby/rails/Gemfile

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,31 @@
11
source 'https://rubygems.org'
22

33
gem 'oj', '~> 3.16'
4-
gem 'pg', '~> 1.5', group: :postgresql
5-
gem 'puma', '~> 6.4', require: false
6-
gem 'falcon', '~> 0.47', require: false
74
gem 'rails', '~> 7.2.0'
85
gem 'redis', '~> 5.0'
9-
gem 'trilogy', '~> 2.8.1', group: :mysql
106
gem 'tzinfo-data'
7+
8+
group :mysql do
9+
gem 'trilogy', '~> 2.8.1'
10+
end
11+
12+
group :postgresql do
13+
gem 'pg', '~> 1.5'
14+
end
15+
16+
group :falcon do
17+
gem 'falcon', '~> 0.47', require: false
18+
end
19+
20+
group :puma do
21+
gem 'puma', '~> 6.4', require: false
22+
end
23+
24+
group :unicorn do
25+
gem 'unicorn', '~> 6.1', require: false
26+
end
27+
28+
group :agoo do
29+
gem 'agoo', require: false
30+
gem 'rackup'
31+
end

frameworks/Ruby/rails/Gemfile.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ GEM
7171
minitest (>= 5.1)
7272
securerandom (>= 0.3)
7373
tzinfo (~> 2.0, >= 2.0.5)
74+
agoo (2.15.13)
7475
async (2.17.0)
7576
console (~> 1.26)
7677
fiber-annotation
@@ -137,6 +138,7 @@ GEM
137138
rdoc (>= 4.0.0)
138139
reline (>= 0.4.2)
139140
json (2.7.2)
141+
kgio (2.11.4)
140142
localhost (1.3.1)
141143
logger (1.6.1)
142144
loofah (2.22.0)
@@ -232,6 +234,7 @@ GEM
232234
rake (>= 12.2)
233235
thor (~> 1.0, >= 1.2.2)
234236
zeitwerk (~> 2.6)
237+
raindrops (0.20.1)
235238
rake (13.2.1)
236239
rdoc (6.7.0)
237240
psych (>= 4.0.0)
@@ -254,6 +257,9 @@ GEM
254257
concurrent-ruby (~> 1.0)
255258
tzinfo-data (1.2024.2)
256259
tzinfo (>= 1.0.0)
260+
unicorn (6.1.0)
261+
kgio (~> 2.6)
262+
raindrops (~> 0.7)
257263
useragent (0.16.10)
258264
webrick (1.8.2)
259265
websocket-driver (0.7.6)
@@ -267,14 +273,17 @@ PLATFORMS
267273
x86_64-linux
268274

269275
DEPENDENCIES
276+
agoo
270277
falcon (~> 0.47)
271278
oj (~> 3.16)
272279
pg (~> 1.5)
273280
puma (~> 6.4)
281+
rackup
274282
rails (~> 7.2.0)
275283
redis (~> 5.0)
276284
trilogy (~> 2.8.1)
277285
tzinfo-data
286+
unicorn (~> 6.1)
278287

279288
BUNDLED WITH
280289
2.3.3

frameworks/Ruby/rails/benchmark_config.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"fortune_url": "/fortunes",
5353
"update_url": "/updates?queries=",
5454
"plaintext_url": "/plaintext",
55+
"cached_query_url": "/cached?queries=",
5556
"port": 8080,
5657
"approach": "Realistic",
5758
"classification": "Fullstack",
@@ -66,6 +67,29 @@
6667
"display_name": "rails-falcon",
6768
"notes": "",
6869
"versus": "rack-falcon-mri"
70+
},
71+
"agoo": {
72+
"db_url": "/db",
73+
"json_url": "/json",
74+
"query_url": "/queries?queries=",
75+
"fortune_url": "/fortunes",
76+
"update_url": "/updates?queries=",
77+
"plaintext_url": "/plaintext",
78+
"cached_query_url": "/cached?queries=",
79+
"port": 8080,
80+
"approach": "Realistic",
81+
"classification": "Fullstack",
82+
"database": "Postgres",
83+
"framework": "rails",
84+
"language": "Ruby",
85+
"orm": "Full",
86+
"platform": "Rack",
87+
"webserver": "Agoo",
88+
"os": "Linux",
89+
"database_os": "Linux",
90+
"display_name": "rails-agoo",
91+
"notes": "",
92+
"versus": ""
6993
}
7094
}]
7195
}

frameworks/Ruby/rails/config/agoo.rb

Whitespace-only changes.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
FROM ruby:3.4-rc
2+
3+
RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends redis-server
4+
5+
EXPOSE 8080
6+
WORKDIR /rails
7+
8+
# ENV RUBY_YJIT_ENABLE=1 YJIT is enabled in config/initializers/enable_yjit.rb
9+
10+
# Use Jemalloc
11+
RUN apt-get update && \
12+
apt-get install -y --no-install-recommends libjemalloc2
13+
ENV LD_PRELOAD=libjemalloc.so.2
14+
15+
COPY ./Gemfile* /rails/
16+
17+
ENV BUNDLE_FORCE_RUBY_PLATFORM=true
18+
ENV BUNDLE_WITHOUT=trilogy
19+
RUN bundle install --jobs=8
20+
21+
COPY . /rails/
22+
23+
ENV RAILS_ENV=production_postgresql
24+
ENV PORT=8080
25+
ENV REDIS_URL=redis://localhost:6379/0
26+
CMD service redis-server start
27+
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)

0 commit comments

Comments
 (0)