horizon.php 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <?php
  2. return [
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Horizon Domain
  6. |--------------------------------------------------------------------------
  7. |
  8. | This is the subdomain where Horizon will be accessible from. If this
  9. | setting is null, Horizon will reside under the same domain as the
  10. | application. Otherwise, this value will serve as the subdomain.
  11. |
  12. */
  13. 'domain' => null,
  14. /*
  15. |--------------------------------------------------------------------------
  16. | Horizon Path
  17. |--------------------------------------------------------------------------
  18. |
  19. | This is the URI path where Horizon will be accessible from. Feel free
  20. | to change this path to anything you like. Note that the URI will not
  21. | affect the paths of its internal API that aren't exposed to users.
  22. |
  23. */
  24. 'path' => 'horizon',
  25. /*
  26. |--------------------------------------------------------------------------
  27. | Horizon Redis Connection
  28. |--------------------------------------------------------------------------
  29. |
  30. | This is the name of the Redis connection where Horizon will store the
  31. | meta information required for it to function. It includes the list
  32. | of supervisors, failed jobs, job metrics, and other information.
  33. |
  34. */
  35. 'use' => 'default',
  36. /*
  37. |--------------------------------------------------------------------------
  38. | Horizon Redis Prefix
  39. |--------------------------------------------------------------------------
  40. |
  41. | This prefix will be used when storing all Horizon data in Redis. You
  42. | may modify the prefix when you are running multiple installations
  43. | of Horizon on the same server so that they don't have problems.
  44. |
  45. */
  46. 'prefix' => env('HORIZON_PREFIX', 'horizon-'),
  47. /*
  48. |--------------------------------------------------------------------------
  49. | Horizon Route Middleware
  50. |--------------------------------------------------------------------------
  51. |
  52. | These middleware will get attached onto each Horizon route, giving you
  53. | the chance to add your own middleware to this list or change any of
  54. | the existing middleware. Or, you can simply stick with this list.
  55. |
  56. */
  57. 'middleware' => ['web'],
  58. /*
  59. |--------------------------------------------------------------------------
  60. | Queue Wait Time Thresholds
  61. |--------------------------------------------------------------------------
  62. |
  63. | This option allows you to configure when the LongWaitDetected event
  64. | will be fired. Every connection / queue combination may have its
  65. | own, unique threshold (in seconds) before this event is fired.
  66. |
  67. */
  68. 'waits' => [
  69. 'redis:feed' => 30,
  70. 'redis:follow' => 30,
  71. 'redis:shared' => 30,
  72. 'redis:default' => 30,
  73. 'redis:inbox' => 30,
  74. 'redis:low' => 30,
  75. 'redis:high' => 30,
  76. 'redis:delete' => 30,
  77. 'redis:story' => 30,
  78. 'redis:mmo' => 30,
  79. ],
  80. /*
  81. |--------------------------------------------------------------------------
  82. | Job Trimming Times
  83. |--------------------------------------------------------------------------
  84. |
  85. | Here you can configure for how long (in minutes) you desire Horizon to
  86. | persist the recent and failed jobs. Typically, recent jobs are kept
  87. | for one hour while all failed jobs are stored for an entire week.
  88. |
  89. */
  90. 'trim' => [
  91. 'recent' => 60,
  92. 'pending' => 60,
  93. 'completed' => 60,
  94. 'recent_failed' => 10080,
  95. 'failed' => 10080,
  96. 'monitored' => 10080,
  97. ],
  98. /*
  99. |--------------------------------------------------------------------------
  100. | Metrics
  101. |--------------------------------------------------------------------------
  102. |
  103. | Here you can configure how many snapshots should be kept to display in
  104. | the metrics graph. This will get used in combination with Horizon's
  105. | `horizon:snapshot` schedule to define how long to retain metrics.
  106. |
  107. */
  108. 'metrics' => [
  109. 'trim_snapshots' => [
  110. 'job' => 24,
  111. 'queue' => 24,
  112. ],
  113. ],
  114. /*
  115. |--------------------------------------------------------------------------
  116. | Fast Termination
  117. |--------------------------------------------------------------------------
  118. |
  119. | When this option is enabled, Horizon's "terminate" command will not
  120. | wait on all of the workers to terminate unless the --wait option
  121. | is provided. Fast termination can shorten deployment delay by
  122. | allowing a new instance of Horizon to start while the last
  123. | instance will continue to terminate each of its workers.
  124. |
  125. */
  126. 'fast_termination' => false,
  127. /*
  128. |--------------------------------------------------------------------------
  129. | Memory Limit (MB)
  130. |--------------------------------------------------------------------------
  131. |
  132. | This value describes the maximum amount of memory the Horizon worker
  133. | may consume before it is terminated and restarted. You should set
  134. | this value according to the resources available to your server.
  135. |
  136. */
  137. 'memory_limit' => env('HORIZON_MEMORY_LIMIT', 64),
  138. /*
  139. |--------------------------------------------------------------------------
  140. | Queue Worker Configuration
  141. |--------------------------------------------------------------------------
  142. |
  143. | Here you may define the queue worker settings used by your application
  144. | in all environments. These supervisors and settings handle all your
  145. | queued jobs and will be provisioned by Horizon during deployment.
  146. |
  147. */
  148. 'environments' => [
  149. 'production' => [
  150. 'supervisor-1' => [
  151. 'connection' => 'redis',
  152. 'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo'],
  153. 'balance' => env('HORIZON_BALANCE_STRATEGY', 'auto'),
  154. 'minProcesses' => env('HORIZON_MIN_PROCESSES', 1),
  155. 'maxProcesses' => env('HORIZON_MAX_PROCESSES', 20),
  156. 'memory' => env('HORIZON_SUPERVISOR_MEMORY', 64),
  157. 'tries' => env('HORIZON_SUPERVISOR_TRIES', 3),
  158. 'nice' => env('HORIZON_SUPERVISOR_NICE', 0),
  159. 'timeout' => env('HORIZON_SUPERVISOR_TIMEOUT', 300),
  160. ],
  161. ],
  162. 'local' => [
  163. 'supervisor-1' => [
  164. 'connection' => 'redis',
  165. 'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo'],
  166. 'balance' => 'auto',
  167. 'minProcesses' => 1,
  168. 'maxProcesses' => 20,
  169. 'memory' => 128,
  170. 'tries' => 3,
  171. 'nice' => 0,
  172. 'timeout' => 300
  173. ],
  174. ],
  175. ],
  176. 'darkmode' => env('HORIZON_DARKMODE', false),
  177. ];