env('OCTANE_SERVER', 'frankenphp'), /* |-------------------------------------------------------------------------- | Force HTTPS |-------------------------------------------------------------------------- | | When this configuration value is set to "true", Octane will inform the | framework that all absolute links must be generated using the HTTPS | protocol. Otherwise your links may be generated using plain HTTP. | */ 'https' => env('OCTANE_HTTPS', false), /* * Octane worker tuning * * App: 1 vCPU / 4 GiB. Aggregate VUs: 200 preallocated / 500 maximum. * Results below are from each sweep's one-minute 100-RPS plateau. * * | Workers | HTTP-200 RPS | p95 latency | HTTP failures | * | ------- | ------------ | ----------- | ------------- | * | 2 | 100.00 | 975 ms | 0 | * | 4 | 100.00 | 682 ms | 0 | * | 8 | 100.00 | 789 ms | 0 | * | 45 | 98.68 | 2663 ms | 1 | * * Two subsequent three-minute 90-RPS holds with four workers had no * HTTP failures or dropped arrivals, with p95 values of 134 and 192 ms. */ 'caddy' => [ 'env' => env('OCTANE_WORKERS') ? [ 'CADDY_SERVER_WORKER_COUNT' => (string) env('OCTANE_WORKERS'), 'CADDY_SERVER_WORKER_DIRECTIVE' => 'num ' . env('OCTANE_WORKERS'), ] : [], ], /* |-------------------------------------------------------------------------- | Octane Listeners |-------------------------------------------------------------------------- | | All of the event listeners for Octane's events are defined below. These | listeners are responsible for resetting your application's state for | the next request. You may even add your own listeners to the list. | */ 'listeners' => [ WorkerStarting::class => [ EnsureUploadedFilesAreValid::class, EnsureUploadedFilesCanBeMoved::class, ], RequestReceived::class => [ ...Octane::prepareApplicationForNextOperation(), ...Octane::prepareApplicationForNextRequest(), // ], RequestHandled::class => [ // ], RequestTerminated::class => [ // FlushUploadedFiles::class, ], TaskReceived::class => [ ...Octane::prepareApplicationForNextOperation(), // ], TaskTerminated::class => [ // ], TickReceived::class => [ ...Octane::prepareApplicationForNextOperation(), // ], TickTerminated::class => [ // ], OperationTerminated::class => [ FlushOnce::class, FlushTemporaryContainerInstances::class, // DisconnectFromDatabases::class, ], OperationReleased::class => [ // CollectGarbage::class, // ReleaseFreedMemory::class, ], WorkerErrorOccurred::class => [ ReportException::class, StopWorkerIfNecessary::class, ], WorkerStopping::class => [ CloseMonologHandlers::class, ], ], /* |-------------------------------------------------------------------------- | Warm / Flush Bindings |-------------------------------------------------------------------------- | | The bindings listed below will either be pre-warmed when a worker boots | or they will be flushed before every new request. Flushing a binding | will force the container to resolve that binding again when asked. | */ 'warm' => [ ...Octane::defaultServicesToWarm(), ], 'flush' => [ // ], /* |-------------------------------------------------------------------------- | Octane Swoole Tables |-------------------------------------------------------------------------- | | While using Swoole, you may define additional tables as required by the | application. These tables can be used to store data that needs to be | quickly accessed by other workers on the particular Swoole server. | */ 'tables' => [ 'example:1000' => [ 'name' => 'string:1000', 'votes' => 'int', ], ], /* |-------------------------------------------------------------------------- | Octane Swoole Cache Table |-------------------------------------------------------------------------- | | While using Swoole, you may leverage the Octane cache, which is powered | by a Swoole table. You may set the maximum number of rows as well as | the number of bytes per row using the configuration options below. | */ 'cache' => [ 'rows' => 1000, 'bytes' => 10000, ], /* |-------------------------------------------------------------------------- | File Watching |-------------------------------------------------------------------------- | | The following list of files and directories will be watched when using | the --watch option offered by Octane. If any of the directories and | files are changed, Octane will automatically reload your workers. | */ 'watch' => [ 'app', 'bootstrap', 'config/**/*.php', 'database/**/*.php', 'public/**/*.php', 'resources/**/*.php', 'routes', 'composer.lock', '.env', ], /* |-------------------------------------------------------------------------- | Garbage Collection Threshold |-------------------------------------------------------------------------- | | When executing long-lived PHP scripts such as Octane, memory can build | up before being cleared by PHP. You can force Octane to run garbage | collection if your application consumes this amount of megabytes. | */ 'garbage' => 50, /* |-------------------------------------------------------------------------- | Maximum Execution Time |-------------------------------------------------------------------------- | | The following setting configures the maximum execution time for requests | being handled by Octane. You may set this value to 0 to indicate that | there isn't a specific time limit on Octane request execution time. | */ 'max_execution_time' => 30, /* |-------------------------------------------------------------------------- | Octane Server State File |-------------------------------------------------------------------------- | | This value determines where Octane stores the state file used to track | the running server's master process ID and admin endpoint, which is | read by various Octane commands. You may tweak this if necessary. | */ 'state_file' => env('OCTANE_STATE_FILE', storage_path('logs/octane-server-state.json')), /* |-------------------------------------------------------------------------- | RoadRunner Options |-------------------------------------------------------------------------- | | The following options are only used when the RoadRunner server is the | server powering your application. You may customize the path to the | worker binary here, which is useful for zero-downtime deployments | where the application is served from a symlinked "current" path. | */ 'roadrunner' => [ 'command' => env('OCTANE_ROADRUNNER_COMMAND', 'vendor/bin/roadrunner-worker'), 'http_middleware' => env('OCTANE_ROADRUNNER_HTTP_MIDDLEWARE', 'static'), ], ];