Skip to content

Commit 79d161a

Browse files
authored
[ruby/rack] Use 2 threads for Iodine (#10508)
Instead of having more workers than processes, run with more threads.
1 parent 90289c1 commit 79d161a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

frameworks/Ruby/rack/hello_world.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class HelloWorld
4545
def initialize
4646
if defined?(Puma) || defined?(Itsi)
4747
max_connections = ENV.fetch('MAX_THREADS')
48+
elsif defined?(Iodine)
49+
max_connections = ENV.fetch('THREADS')
4850
else
4951
max_connections = 512
5052
end

frameworks/Ruby/rack/rack-iodine.dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ RUN bundle install --jobs=8
1717

1818
COPY . .
1919

20+
ENV THREADS=2
21+
2022
EXPOSE 8080
2123

22-
CMD bundle exec iodine -p 8080 -w $(($(nproc)*5/4))
24+
CMD bundle exec iodine -p 8080 -w $(nproc)

0 commit comments

Comments
 (0)