horizon.php 5.7 KB

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