Skip to content

Commit 60a0b02

Browse files
committed
[roda] Mark upload as io bound
Use Puma 8's new 'mark_as_io_bound' option allow more threads on the IO heavy upload call.
1 parent 3541503 commit 60a0b02

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

frameworks/roda/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ ENV RUBY_MN_THREADS=1
1212
ENV RACK_ENV=production
1313
ENV WEB_CONCURRENCY=auto
1414
ENV MAX_THREADS=4
15+
ENV MAX_IO_THREADS=10
1516

1617
WORKDIR /app
1718

frameworks/roda/app.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class App < Roda
6969
end
7070

7171
r.is 'upload' do
72+
request.env["puma.mark_as_io_bound"].call
7273
size = 0
7374
buf = request.body
7475
while (chunk = buf.read(65536))

frameworks/roda/puma.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
threads ENV.fetch('MAX_THREADS', 4).to_i
2+
max_io_threads ENV.fetch("MAX_IO_THREADS", 10).to_i
23

34
tls_cert_path = ENV.fetch('TLS_CERT', '/certs/server.crt')
45
tls_key_path = ENV.fetch('TLS_KEY', '/certs/server.key')

0 commit comments

Comments
 (0)