1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- use app\webscoket\Manager;
- return [
- 'http' => [
- 'enable' => true,
- 'host' => '0.0.0.0',
- 'port' => 21969,
- 'worker_num' => swoole_cpu_num() * 2,
- 'options' => [
- 'package_max_length' => 50 * 1024 * 1024,
- ],
- ],
- 'websocket' => [
- 'enable' => true,
- 'handler' => Manager::class,
- 'ping_interval' => 25000,
- 'ping_timeout' => 60000,
- 'room' => [
- 'type' => 'table',
- 'table' => [
- 'room_rows' => 8192,
- 'room_size' => 2048,
- 'client_rows' => 4096,
- 'client_size' => 2048,
- ],
- 'redis' => [
- 'host' => '127.0.0.1',
- 'port' => 6379,
- 'max_active' => 3,
- 'max_wait_time' => 5,
- ],
- ],
- 'listen' => [],
- 'subscribe' => [],
- ],
- 'rpc' => [
- 'server' => [
- 'enable' => false,
- 'host' => '0.0.0.0',
- 'port' => 9000,
- 'worker_num' => swoole_cpu_num(),
- 'services' => [],
- ],
- 'client' => [],
- ],
- //队列
- 'queue' => [
- 'enable' => true,
- 'workers' => [
- 'qiniu_queue' => [],
- 'qiniu_batch' => [],
- 'qiniu_admin_log' => [],
- ],
- ],
- 'hot_update' => [
- 'enable' => env('APP_DEBUG', false),
- 'name' => ['*.php'],
- 'include' => [app_path(), root_path('qiniu')],
- 'exclude' => [],
- ],
- //连接池
- 'pool' => [
- 'db' => [
- 'enable' => true,
- 'max_active' => swoole_cpu_num() * 4,
- 'max_wait_time' => 5,
- ],
- 'cache' => [
- 'enable' => true,
- 'max_active' => 30,
- 'max_wait_time' => 5,
- ],
- //自定义连接池
- ],
- 'ipc' => [
- 'type' => 'unix_socket',
- 'redis' => [
- 'host' => '127.0.0.1',
- 'port' => 6379,
- 'max_active' => 3,
- 'max_wait_time' => 5,
- ],
- ],
- 'tables' => [],
- //每个worker里需要预加载以共用的实例
- 'concretes' => [],
- //重置器
- 'resetters' => [],
- //每次请求前需要清空的实例
- 'instances' => [],
- //每次请求前需要重新执行的服务
- 'services' => [],
- ];
|