You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
3.3 KiB

11 months ago
8 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
8 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
2 months ago
2 months ago
2 months ago
  1. # This configuration file will be evaluated by Puma. The top-level methods that
  2. # are invoked here are part of Puma's configuration DSL. For more information
  3. # about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
  4. # Puma can serve each request in a thread from an internal thread pool.
  5. # The `threads` method setting takes two numbers: a minimum and maximum.
  6. # Any libraries that use thread pools should be configured to match
  7. # the maximum value specified for Puma. Default is set to 5 threads for minimum
  8. # and maximum; this matches the default thread size of Active Record.
  9. max_threads_count = ENV.fetch('RAILS_MAX_THREADS', 5)
  10. min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
  11. threads min_threads_count, max_threads_count
  12. # Specifies that the worker count should equal the number of processors in production.
  13. if ENV['RAILS_ENV'] == 'production'
  14. require 'concurrent-ruby'
  15. worker_count = Integer(ENV.fetch('WEB_CONCURRENCY') { Concurrent.physical_processor_count })
  16. workers worker_count if worker_count > 1
  17. end
  18. # Specifies the `worker_timeout` threshold that Puma will use to wait before
  19. # terminating a worker in development environments.
  20. worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
  21. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
  22. port ENV.fetch('PORT', 3000)
  23. # Specifies the `environment` that Puma will run in.
  24. environment ENV.fetch('RAILS_ENV') { 'development' }
  25. # Specifies the `pidfile` that Puma will use.
  26. pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
  27. # Allow puma to be restarted by `bin/rails restart` command.
  28. plugin :tmp_restart
  29. on_booted do
  30. # puts '********************* PUMA: booted **********************'
  31. # puts
  32. # puts ' ____ '
  33. # puts ' ______ ______ _______ | |__||_ '
  34. # puts ' | Ruby | | On | | Rails | | ) '
  35. # puts ' ~ ()--() ~ ()--() ~ ()---() ~ ()---()-\ '
  36. # puts
  37. # puts
  38. # puts ' _________'
  39. # puts ' |=========|'
  40. # puts ' __[]__ _ \_______/'
  41. # puts ' +================+ /______\ __(_)__ )( \_____/ )('
  42. # puts ' `-+ +-----+---+ | |------| /_______\ /__\ | | +======+'
  43. # puts ' | | | | +-+------+-. |=======| <____> | | || ||'
  44. # puts ' | | | | |o \_|___ __|__//\\__|___|_+======+'
  45. # puts ' | +=========+ |o o||=+'
  46. # puts ' | * * |o o||||'
  47. # puts ' | --%-- |o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o||=+'
  48. # puts ' +=====================================+-----------+====+'
  49. # puts ' |==/ ------ \=====/ ------ \===%--||o o||____'
  50. # puts ' // \ L_/__\___//_\__L_/__\_/ %=||o~~~~~~~~o||===\\_____'
  51. # puts ' ||__ /. ___________ . ______/ +==============+ \ \_'
  52. # puts ' || \__/ || || \__/ || //--\\ //--\\\\ \ \ \\\_'
  53. # puts ' \\ / || \ // \\ / || \ // (( <> ))(( <> ))\\_\_\_\_\\\\'
  54. # puts ' \========/ \========/ \____/ \____/ `-----------+'
  55. # puts
  56. end