Skip to content

Commit

Permalink
Upgrade to Puma 5.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Jan 12, 2021
1 parent 5eba54d commit d850bfa
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Performance configuration:
# MALLOC_ARENA_MAX=2
# WEB_CONCURRENCY=2
# MIN_THREADS=25
# MAX_THREADS=25
# URL_MAX_CONCURRENCY=5

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ gem "rake", require: false
gem "irb"
gem "rack"
gem "sinatra"
gem "puma", "~> 4.3"
gem "puma"
gem "dotenv"
gem "redis"
gem "addressable"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GEM
pry (~> 0.9)
slop (~> 3.0)
public_suffix (4.0.6)
puma (4.3.7)
puma (5.1.1)
nio4r (~> 2.0)
racc (1.5.2)
rack (2.2.3)
Expand Down Expand Up @@ -102,7 +102,7 @@ DEPENDENCIES
powder
prometheus-client!
pry-remote
puma (~> 4.3)
puma
rack
rack-ssl-enforcer
rake
Expand Down
8 changes: 1 addition & 7 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,8 @@
environment(ENV["APP_ENV"])

if ENV["APP_ENV"] == "development" && !ENV["WEB_CONCURRENCY"]
# better_errors and binding_of_caller works better with only the master process and one thread
# better_errors and binding_of_caller works better in single mode with only one thread
threads(1, 1)
else
ENV["WEB_CONCURRENCY"] ||= "3"
ENV["WEB_THREADS"] ||= "5"
workers(ENV["WEB_CONCURRENCY"].to_i)
thread_count = ENV["WEB_THREADS"].to_i
threads(thread_count, thread_count)
end

preload_app!
Expand Down

0 comments on commit d850bfa

Please sign in to comment.