forked from External/greenlight
Puma Worker Configuration (#1701)
We noticed that the current default settings perform very poorly under load. We managed to literally take down Greenlight during a larger event when people where accessing the landing page for rooms and when doing some tests, I was more or less able to DoS Greenlight on my own. This patch adds a default worker configuration similar to the previous configuration with one worker, but lets users easily adjust it to more workers which significantly improves the situation. The small, 4 core machine I was testing on could handle about thrice the amount of requests. Co-authored-by: Ahmad Farhat <ahmad.af.farhat@gmail.com>
This commit is contained in:
@ -23,14 +23,14 @@ environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
# Workers do not work on JRuby or Windows (both of which do not support
|
||||
# processes).
|
||||
#
|
||||
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
||||
workers ENV.fetch("WEB_CONCURRENCY") { 1 }
|
||||
|
||||
# Use the `preload_app!` method when specifying a `workers` number.
|
||||
# This directive tells Puma to first boot the application and load code
|
||||
# before forking the application. This takes advantage of Copy On Write
|
||||
# process behavior so workers use less memory.
|
||||
#
|
||||
# preload_app!
|
||||
preload_app!
|
||||
|
||||
# Allow puma to be restarted by `rails restart` command.
|
||||
plugin :tmp_restart
|
||||
|
Reference in New Issue
Block a user