horizon.php 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. 'redis:intbg' => 30,
  80. 'redis:adelete' => 30,
  81. 'redis:groups' => 30,
  82. 'redis:move' => 30,
  83. 'redis:pushnotify' => 30,
  84. ],
  85. /*
  86. |--------------------------------------------------------------------------
  87. | Job Trimming Times
  88. |--------------------------------------------------------------------------
  89. |
  90. | Here you can configure for how long (in minutes) you desire Horizon to
  91. | persist the recent and failed jobs. Typically, recent jobs are kept
  92. | for one hour while all failed jobs are stored for an entire week.
  93. |
  94. */
  95. 'trim' => [
  96. 'recent' => 60,
  97. 'pending' => 60,
  98. 'completed' => 60,
  99. 'recent_failed' => 10080,
  100. 'failed' => 10080,
  101. 'monitored' => 10080,
  102. ],
  103. /*
  104. |--------------------------------------------------------------------------
  105. | Metrics
  106. |--------------------------------------------------------------------------
  107. |
  108. | Here you can configure how many snapshots should be kept to display in
  109. | the metrics graph. This will get used in combination with Horizon's
  110. | `horizon:snapshot` schedule to define how long to retain metrics.
  111. |
  112. */
  113. 'metrics' => [
  114. 'trim_snapshots' => [
  115. 'job' => 24,
  116. 'queue' => 24,
  117. ],
  118. ],
  119. /*
  120. |--------------------------------------------------------------------------
  121. | Fast Termination
  122. |--------------------------------------------------------------------------
  123. |
  124. | When this option is enabled, Horizon's "terminate" command will not
  125. | wait on all of the workers to terminate unless the --wait option
  126. | is provided. Fast termination can shorten deployment delay by
  127. | allowing a new instance of Horizon to start while the last
  128. | instance will continue to terminate each of its workers.
  129. |
  130. */
  131. 'fast_termination' => false,
  132. /*
  133. |--------------------------------------------------------------------------
  134. | Memory Limit (MB)
  135. |--------------------------------------------------------------------------
  136. |
  137. | This value describes the maximum amount of memory the Horizon worker
  138. | may consume before it is terminated and restarted. You should set
  139. | this value according to the resources available to your server.
  140. |
  141. */
  142. 'memory_limit' => env('HORIZON_MEMORY_LIMIT', 64),
  143. /*
  144. |--------------------------------------------------------------------------
  145. | Queue Worker Configuration
  146. |--------------------------------------------------------------------------
  147. |
  148. | Here you may define the queue worker settings used by your application
  149. | in all environments. These supervisors and settings handle all your
  150. | queued jobs and will be provisioned by Horizon during deployment.
  151. |
  152. */
  153. 'environments' => [
  154. 'production' => [
  155. 'supervisor-1' => [
  156. 'connection' => 'redis',
  157. 'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups', 'adelete', 'move', 'pushnotify'],
  158. 'balance' => env('HORIZON_BALANCE_STRATEGY', 'auto'),
  159. 'minProcesses' => env('HORIZON_MIN_PROCESSES', 1),
  160. 'maxProcesses' => env('HORIZON_MAX_PROCESSES', 20),
  161. 'memory' => env('HORIZON_SUPERVISOR_MEMORY', 64),
  162. 'tries' => env('HORIZON_SUPERVISOR_TRIES', 3),
  163. 'nice' => env('HORIZON_SUPERVISOR_NICE', 0),
  164. 'timeout' => env('HORIZON_SUPERVISOR_TIMEOUT', 300),
  165. ],
  166. ],
  167. 'local' => [
  168. 'supervisor-1' => [
  169. 'connection' => 'redis',
  170. 'queue' => ['high', 'default', 'follow', 'shared', 'inbox', 'feed', 'low', 'story', 'delete', 'mmo', 'intbg', 'groups', 'adelete', 'move', 'pushnotify'],
  171. 'balance' => 'auto',
  172. 'minProcesses' => 1,
  173. 'maxProcesses' => 20,
  174. 'memory' => 128,
  175. 'tries' => 3,
  176. 'nice' => 0,
  177. 'timeout' => 300
  178. ],
  179. ],
  180. ],
  181. 'darkmode' => env('HORIZON_DARKMODE', false),
  182. ];