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