horizon.php 6.3 KB

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