|
11 | 11 | */ |
12 | 12 | use Hyperf\Server\Server; |
13 | 13 | use Hyperf\Server\Event; |
| 14 | +use Swoole\Constant; |
14 | 15 |
|
15 | 16 | return [ |
16 | 17 | 'mode' => SWOOLE_PROCESS, |
|
27 | 28 | ], |
28 | 29 | ], |
29 | 30 | 'settings' => [ |
30 | | - 'enable_coroutine' => true, |
31 | | - 'worker_num' => swoole_cpu_num(), |
32 | | - 'pid_file' => BASE_PATH . '/runtime/hyperf.pid', |
33 | | - 'open_tcp_nodelay' => true, |
34 | | - 'max_coroutine' => 100000, |
35 | | - 'open_http2_protocol' => true, |
36 | | - 'max_request' => 100000, |
37 | | - 'socket_buffer_size' => 2 * 1024 * 1024, |
38 | | - 'buffer_output_size' => 2 * 1024 * 1024, |
| 31 | + Constant::OPTION_ENABLE_COROUTINE => true, |
| 32 | + Constant::OPTION_WORKER_NUM => swoole_cpu_num(), |
| 33 | + Constant::OPTION_PID_FILE => BASE_PATH . '/runtime/hyperf.pid', |
| 34 | + Constant::OPTION_OPEN_TCP_NODELAY => true, |
| 35 | + Constant::OPTION_MAX_COROUTINE => 100000, |
| 36 | + Constant::OPTION_OPEN_HTTP2_PROTOCOL => true, |
| 37 | + Constant::OPTION_MAX_REQUEST => 100000, |
| 38 | + Constant::OPTION_SOCKET_BUFFER_SIZE => 2 * 1024 * 1024, |
| 39 | + Constant::OPTION_BUFFER_OUTPUT_SIZE => 2 * 1024 * 1024, |
39 | 40 | ], |
40 | 41 | 'callbacks' => [ |
41 | 42 | Event::ON_WORKER_START => [Hyperf\Framework\Bootstrap\WorkerStartCallback::class, 'onWorkerStart'], |
|
0 commit comments