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.

65 lines
3.3 KiB

10 months ago
10 months ago
7 months ago
10 months ago
4 weeks ago
4 weeks ago
4 weeks 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 starts a configurable number of processes (workers) and each process
  5. # serves each request in a thread from an internal thread pool.
  6. #
  7. # The ideal number of threads per worker depends both on how much time the
  8. # application spends waiting for IO operations and on how much you wish to
  9. # to prioritize throughput over latency.
  10. #
  11. # As a rule of thumb, increasing the number of threads will increase how much
  12. # traffic a given process can handle (throughput), but due to CRuby's
  13. # Global VM Lock (GVL) it has diminishing returns and will degrade the
  14. # response time (latency) of the application.
  15. #
  16. # The default is set to 3 threads as it's deemed a decent compromise between
  17. # throughput and latency for the average Rails application.
  18. #
  19. # Any libraries that use a connection pool or another resource pool should
  20. # be configured to provide at least as many connections as the number of
  21. # threads. This includes Active Record's `pool` parameter in `database.yml`.
  22. threads_count = ENV.fetch('RAILS_MAX_THREADS', 3)
  23. threads threads_count, threads_count
  24. # Specifies the `port` that Puma will listen on to receive requests; default is 3000.
  25. port ENV.fetch('PORT', 3000)
  26. # Allow puma to be restarted by `bin/rails restart` command.
  27. plugin :tmp_restart
  28. # Specify the PID file. Defaults to tmp/pids/server.pid in development.
  29. # In other environments, only set the PID file if requested.
  30. pidfile ENV['PIDFILE'] if ENV['PIDFILE']
  31. on_booted do
  32. # puts '********************* PUMA: booted **********************'
  33. # puts
  34. # puts ' ____ '
  35. # puts ' ______ ______ _______ | |__||_ '
  36. # puts ' | Ruby | | On | | Rails | | ) '
  37. # puts ' ~ ()--() ~ ()--() ~ ()---() ~ ()---()-\ '
  38. # puts
  39. # puts
  40. # puts ' _________'
  41. # puts ' |=========|'
  42. # puts ' __[]__ _ \_______/'
  43. # puts ' +================+ /______\ __(_)__ )( \_____/ )('
  44. # puts ' `-+ +-----+---+ | |------| /_______\ /__\ | | +======+'
  45. # puts ' | | | | +-+------+-. |=======| <____> | | || ||'
  46. # puts ' | | | | |o \_|___ __|__//\\__|___|_+======+'
  47. # puts ' | +=========+ |o o||=+'
  48. # puts ' | * * |o o||||'
  49. # puts ' | --%-- |o~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~o||=+'
  50. # puts ' +=====================================+-----------+====+'
  51. # puts ' |==/ ------ \=====/ ------ \===%--||o o||____'
  52. # puts ' // \ L_/__\___//_\__L_/__\_/ %=||o~~~~~~~~o||===\\_____'
  53. # puts ' ||__ /. ___________ . ______/ +==============+ \ \_'
  54. # puts ' || \__/ || || \__/ || //--\\ //--\\\\ \ \ \\\_'
  55. # puts ' \\ / || \ // \\ / || \ // (( <> ))(( <> ))\\_\_\_\_\\\\'
  56. # puts ' \========/ \========/ \____/ \____/ `-----------+'
  57. # puts
  58. end