File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ ENV RUBY_YJIT_ENABLE=1
1111ENV RUBY_MN_THREADS=1
1212ENV RACK_ENV=production
1313ENV WEB_CONCURRENCY=auto
14- ENV MAX_THREADS=4
14+ ENV MAX_THREADS=3
15+ ENV MAX_IO_THREADS=10
1516
1617WORKDIR /app
1718
Original file line number Diff line number Diff line change 11source 'https://rubygems.org'
22
33gem 'sinatra' , '~> 4.1'
4- gem 'puma' , '~> 7.2 '
4+ gem 'puma' , '~> 8.0 '
55gem 'pg' , '~> 1.5'
66gem 'json'
77gem 'concurrent-ruby'
Original file line number Diff line number Diff line change 1010 nio4r (2.7.5 )
1111 pg (1.6.3-arm64-darwin )
1212 pg (1.6.3-x86_64-linux )
13- puma (7.2.0 )
13+ puma (8.0.1 )
1414 nio4r (~> 2.0 )
1515 rack (3.2.6 )
1616 rack-protection (4.2.1 )
@@ -38,7 +38,7 @@ DEPENDENCIES
3838 connection_pool
3939 json
4040 pg (~> 1.5 )
41- puma (~> 7.2 )
41+ puma (~> 8.0 )
4242 sinatra (~> 4.1 )
4343
4444CHECKSUMS
@@ -51,7 +51,7 @@ CHECKSUMS
5151 nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1
5252 pg (1.6.3-arm64-darwin) sha256=7240330b572e6355d7c75a7de535edb5dfcbd6295d9c7777df4d9dddfb8c0e5f
5353 pg (1.6.3-x86_64-linux) sha256=5d9e188c8f7a0295d162b7b88a768d8452a899977d44f3274d1946d67920ae8d
54- puma (7.2.0 ) sha256=bf8ef4ab514a4e6d4554cb4326b2004eba5036ae05cf765cfe51aba9706a72a8
54+ puma (8.0.1 ) sha256=7b94e50c07655718c1fb8ae41a11fc06c7d61293208b3aa608ff71a46d3ad37c
5555 rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2
5656 rack-protection (4.2.1) sha256=cf6e2842df8c55f5e4d1a4be015e603e19e9bc3a7178bae58949ccbb58558bac
5757 rack-session (2.1.2) sha256=595434f8c0c3473ae7d7ac56ecda6cc6dfd9d37c0b2b5255330aa1576967ffe8
Original file line number Diff line number Diff line change @@ -17,6 +17,21 @@ class MethodGuard
1717 end
1818end
1919
20+ # Threads marked as IO bound are allowed to go over Puma's max thread limit.
21+ class MarkAsIOBoundThreads
22+ def initialize ( app )
23+ @app = app
24+ end
25+
26+ def call ( env )
27+ if env [ 'PATH_INFO' ] . start_with? '/baseline'
28+ env [ "puma.mark_as_io_bound" ] . call
29+ end
30+ @app . call ( env )
31+ end
32+ end
33+
34+ use MarkAsIOBoundThreads
2035use MethodGuard
2136use Rack ::Deflater
2237run App
Original file line number Diff line number Diff line change 11threads ENV . fetch ( 'MAX_THREADS' , 4 ) . to_i
2+ max_io_threads ENV . fetch ( "MAX_IO_THREADS" , 10 ) . to_i
23
34tls_cert_path = ENV . fetch ( 'TLS_CERT' , '/certs/server.crt' )
45tls_key_path = ENV . fetch ( 'TLS_KEY' , '/certs/server.key' )
You can’t perform that action at this time.
0 commit comments