Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Update environment variable handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansundin committed Dec 23, 2019
1 parent 2651f36 commit d72480c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Performance configuration:
# MALLOC_ARENA_MAX=2
# WEB_CONCURRENCY=2
# WEB_THREADS=25


# Application configuration:
#GITHUB_TOKEN=
#GITHUB_CLIENT_ID=
#GITHUB_CLIENT_SECRET=
Expand Down
9 changes: 5 additions & 4 deletions config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
ENV["APP_ENV"] ||= "development"
environment(ENV["APP_ENV"])

if ENV["APP_ENV"] == "development"
if ENV["APP_ENV"] == "development" && !ENV["WEB_CONCURRENCY"]
# better_errors and binding_of_caller works better with only one process and thread
workers(1)
threads(1, 1)
else
workers(ENV["WEB_CONCURRENCY"] || 3)
thread_count = ENV["WEB_THREADS"] || 5
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

Expand Down

0 comments on commit d72480c

Please sign in to comment.