-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathpuma.rb
31 lines (26 loc) · 928 Bytes
/
puma.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Puma is a fast, concurrent web server for Ruby & Rack
#
# Learn more at: https://puma.io
# Bridgetown configuration documentation:
# https://edge.bridgetownrb.com/docs/configuration/puma
# This port number can be overriden by a bind configuration option
#
port ENV.fetch("BRIDGETOWN_PORT") { 4000 }
# You can adjust the number of workers (separate processes) and threads
# (per process) based on your production system
#
if ENV["BRIDGETOWN_ENV"] == "production"
workers ENV.fetch("BRIDGETOWN_CONCURRENCY") { 4 }
end
max_threads_count = ENV.fetch("BRIDGETOWN_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("BRIDGETOWN_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
# Preload the application for maximum performance
#
preload_app!
# Use the Bridgetown logger format
#
require "bridgetown-core/rack/logger"
log_formatter do |msg|
Bridgetown::Rack::Logger.message_with_prefix msg
end