Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ def self.redis
end

def self.pool_size
ENV.fetch('RAILS_MAX_THREADS', 4).to_i
ENV.fetch('RAILS_MAX_THREADS', 4).to_i + ENV.fetch("MAX_IO_THREADS", 10).to_i
end
end
4 changes: 3 additions & 1 deletion frameworks/rails/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ def call(env)

# Threads marked as IO bound are allowed to go over Puma's max thread limit.
class MarkAsIOBoundThreads
IOBoundPaths = %w[/baseline11 /baseline2 /async-db].map { [_1, nil] }.to_h.freeze

def initialize(app)
@app = app
end

def call(env)
if env['PATH_INFO'].start_with?('/baseline')
if IOBoundPaths.has_key? env['PATH_INFO']
env["puma.mark_as_io_bound"].call
end
@app.call(env)
Expand Down