Skip to content

Commit 56e9bbe

Browse files
authored
Merge pull request #572 from p8/rails/json-tls
[rails] Enable json-tls test
2 parents f94f0e4 + e10f9a7 commit 56e9bbe

8 files changed

Lines changed: 109 additions & 17 deletions

File tree

frameworks/rails/Dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ RUN bundle install --jobs=$(nproc)
2121

2222
COPY . .
2323

24-
EXPOSE 8080
24+
EXPOSE 8080 8081
2525

26-
ENV THRUSTER_TARGET_PORT=8080
27-
ENV THRUSTER_LOG_REQUESTS=false
28-
29-
CMD ["bin/thrust", "bin/rails", "s"]
26+
CMD ["bin/rails", "server"]

frameworks/rails/Gemfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@ gem 'puma', '~> 7.2'
55
gem 'pg', '~> 1.5'
66
gem 'bootsnap', require: false
77
gem 'connection_pool'
8-
gem 'thruster', require: false

frameworks/rails/Gemfile.lock

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ GEM
188188
securerandom (0.4.1)
189189
stringio (3.2.0)
190190
thor (1.5.0)
191-
thruster (0.1.20-arm64-darwin)
192-
thruster (0.1.20-x86_64-linux)
193191
timeout (0.6.1)
194192
tsort (0.2.0)
195193
tzinfo (2.0.6)
@@ -212,7 +210,6 @@ DEPENDENCIES
212210
pg (~> 1.5)
213211
puma (~> 7.2)
214212
rails (~> 8.0)
215-
thruster
216213

217214
CHECKSUMS
218215
action_text-trix (2.1.18) sha256=3fdb83f8bff4145d098be283cdd47ac41caf5110bfa6df4695ed7127d7fb3642
@@ -279,8 +276,6 @@ CHECKSUMS
279276
securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
280277
stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1
281278
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
282-
thruster (0.1.20-arm64-darwin) sha256=630cf8c273f562063b92ea5ccd7a721d7ba6130cc422c823727f4744f6d0770e
283-
thruster (0.1.20-x86_64-linux) sha256=d579f252bf67aee6ba6d957e48f566b72e019d7657ba2f267a5db1e4d91d2479
284279
timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb
285280
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
286281
tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b

frameworks/rails/bin/thrust

Lines changed: 0 additions & 5 deletions
This file was deleted.

frameworks/rails/config/puma.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
thread_count = ENV.fetch('RAILS_MAX_THREADS', 4).to_i
22
threads thread_count, thread_count
33

4-
port 8080
4+
tls_cert_path = ENV.fetch('TLS_CERT', '/certs/server.crt')
5+
tls_key_path = ENV.fetch('TLS_KEY', '/certs/server.key')
6+
bind "tcp://0.0.0.0:8080"
7+
bind "ssl://0.0.0.0:8081?cert=#{tls_cert_path}&key=#{tls_key_path}"
58

69
# Allow all HTTP methods so Rack middleware can return 405 instead of Puma returning 501
710
supported_http_methods :any

frameworks/rails/meta.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"limited-conn",
1313
"json",
1414
"json-comp",
15+
"json-tls",
1516
"upload",
1617
"api-4",
1718
"api-16",

site/data/json-tls-4096.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,25 @@
307307
"status_4xx": 0,
308308
"status_5xx": 0
309309
},
310+
{
311+
"framework": "rails",
312+
"language": "Ruby",
313+
"rps": 117389,
314+
"avg_latency": "34.22ms",
315+
"p99_latency": "34.22ms",
316+
"cpu": "6453.2%",
317+
"memory": "5.4GiB",
318+
"connections": 4096,
319+
"threads": 64,
320+
"duration": "5s",
321+
"pipeline": 1,
322+
"bandwidth": "421.07MB",
323+
"reconnects": 0,
324+
"status_2xx": 598796,
325+
"status_3xx": 0,
326+
"status_4xx": 0,
327+
"status_5xx": 0
328+
},
310329
{
311330
"framework": "ring-http-exchange",
312331
"language": "Clojure",
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
=> Booting Puma
2+
=> Rails 8.1.3 application starting in production
3+
=> Run `bin/rails server --help` for more startup options
4+
[1] Puma starting in cluster mode...
5+
[1] * Puma version: 7.2.0 ("On The Corner")
6+
[1] * Ruby version: ruby 4.0.3 (2026-04-21 revision 85ddef263a) +YJIT +MN +PRISM [x86_64-linux]
7+
[1] * Min threads: 3
8+
[1] * Max threads: 3
9+
[1] * Environment: production
10+
[1] * Master PID: 1
11+
[1] * Workers: 64
12+
[1] * Restarts: (✔) hot (✖) phased (✖) refork
13+
[1] * Preloading application
14+
[1] * Listening on http://0.0.0.0:8080
15+
[1] * Listening on ssl://0.0.0.0:8081?cert=/certs/server.crt&key=/certs/server.key
16+
[1] Use Ctrl-C to stop
17+
[1] ! WARNING: Detected `RUBY_MN_THREADS=1`
18+
[1] ! This setting is known to cause performance regressions with Puma.
19+
[1] ! Consider disabling this environment variable: https://github.com/puma/puma/issues/3720
20+
[1] - Worker 0 (PID: 8) booted in 0.16s, phase: 0
21+
[1] - Worker 1 (PID: 12) booted in 0.16s, phase: 0
22+
[1] - Worker 2 (PID: 16) booted in 0.16s, phase: 0
23+
[1] - Worker 3 (PID: 20) booted in 0.16s, phase: 0
24+
[1] - Worker 4 (PID: 24) booted in 0.15s, phase: 0
25+
[1] - Worker 5 (PID: 29) booted in 0.15s, phase: 0
26+
[1] - Worker 6 (PID: 34) booted in 0.15s, phase: 0
27+
[1] - Worker 7 (PID: 39) booted in 0.15s, phase: 0
28+
[1] - Worker 8 (PID: 44) booted in 0.14s, phase: 0
29+
[1] - Worker 9 (PID: 49) booted in 0.14s, phase: 0
30+
[1] - Worker 10 (PID: 55) booted in 0.14s, phase: 0
31+
[1] - Worker 11 (PID: 61) booted in 0.14s, phase: 0
32+
[1] - Worker 12 (PID: 67) booted in 0.14s, phase: 0
33+
[1] - Worker 13 (PID: 73) booted in 0.13s, phase: 0
34+
[1] - Worker 14 (PID: 82) booted in 0.13s, phase: 0
35+
[1] - Worker 15 (PID: 88) booted in 0.13s, phase: 0
36+
[1] - Worker 16 (PID: 94) booted in 0.13s, phase: 0
37+
[1] - Worker 17 (PID: 100) booted in 0.12s, phase: 0
38+
[1] - Worker 18 (PID: 105) booted in 0.12s, phase: 0
39+
[1] - Worker 19 (PID: 111) booted in 0.12s, phase: 0
40+
[1] - Worker 20 (PID: 117) booted in 0.12s, phase: 0
41+
[1] - Worker 21 (PID: 123) booted in 0.12s, phase: 0
42+
[1] - Worker 22 (PID: 128) booted in 0.11s, phase: 0
43+
[1] - Worker 23 (PID: 134) booted in 0.11s, phase: 0
44+
[1] - Worker 24 (PID: 139) booted in 0.11s, phase: 0
45+
[1] - Worker 25 (PID: 145) booted in 0.11s, phase: 0
46+
[1] - Worker 26 (PID: 151) booted in 0.11s, phase: 0
47+
[1] - Worker 27 (PID: 157) booted in 0.1s, phase: 0
48+
[1] - Worker 28 (PID: 163) booted in 0.1s, phase: 0
49+
[1] - Worker 29 (PID: 171) booted in 0.1s, phase: 0
50+
[1] - Worker 30 (PID: 179) booted in 0.1s, phase: 0
51+
[1] - Worker 31 (PID: 185) booted in 0.09s, phase: 0
52+
[1] - Worker 32 (PID: 190) booted in 0.09s, phase: 0
53+
[1] - Worker 33 (PID: 196) booted in 0.09s, phase: 0
54+
[1] - Worker 34 (PID: 201) booted in 0.09s, phase: 0
55+
[1] - Worker 35 (PID: 207) booted in 0.08s, phase: 0
56+
[1] - Worker 36 (PID: 211) booted in 0.08s, phase: 0
57+
[1] - Worker 37 (PID: 218) booted in 0.08s, phase: 0
58+
[1] - Worker 38 (PID: 224) booted in 0.08s, phase: 0
59+
[1] - Worker 39 (PID: 229) booted in 0.08s, phase: 0
60+
[1] - Worker 40 (PID: 235) booted in 0.07s, phase: 0
61+
[1] - Worker 41 (PID: 241) booted in 0.07s, phase: 0
62+
[1] - Worker 42 (PID: 247) booted in 0.07s, phase: 0
63+
[1] - Worker 43 (PID: 253) booted in 0.07s, phase: 0
64+
[1] - Worker 44 (PID: 259) booted in 0.07s, phase: 0
65+
[1] - Worker 45 (PID: 265) booted in 0.06s, phase: 0
66+
[1] - Worker 46 (PID: 270) booted in 0.06s, phase: 0
67+
[1] - Worker 47 (PID: 277) booted in 0.06s, phase: 0
68+
[1] - Worker 48 (PID: 283) booted in 0.06s, phase: 0
69+
[1] - Worker 49 (PID: 289) booted in 0.05s, phase: 0
70+
[1] - Worker 50 (PID: 294) booted in 0.05s, phase: 0
71+
[1] - Worker 51 (PID: 301) booted in 0.05s, phase: 0
72+
[1] - Worker 52 (PID: 306) booted in 0.05s, phase: 0
73+
[1] - Worker 53 (PID: 312) booted in 0.05s, phase: 0
74+
[1] - Worker 54 (PID: 318) booted in 0.04s, phase: 0
75+
[1] - Worker 55 (PID: 324) booted in 0.04s, phase: 0
76+
[1] - Worker 56 (PID: 330) booted in 0.04s, phase: 0
77+
[1] - Worker 57 (PID: 337) booted in 0.04s, phase: 0
78+
[1] - Worker 58 (PID: 343) booted in 0.03s, phase: 0
79+
[1] - Worker 59 (PID: 349) booted in 0.03s, phase: 0
80+
[1] - Worker 60 (PID: 355) booted in 0.03s, phase: 0
81+
[1] - Worker 61 (PID: 361) booted in 0.03s, phase: 0
82+
[1] - Worker 62 (PID: 367) booted in 0.03s, phase: 0
83+
[1] - Worker 63 (PID: 373) booted in 0.02s, phase: 0

0 commit comments

Comments
 (0)