This commit is contained in:
lq 2024-05-23 10:51:16 +08:00
parent e526a103ce
commit 2bcb4b7c7f

View File

@ -15,7 +15,7 @@ class HttpServer
$this->server = new Server("0.0.0.0",8085); $this->server = new Server("0.0.0.0",8085);
//配置参数 https://wiki.swoole.com/#/server/setting //配置参数 https://wiki.swoole.com/#/server/setting
$this->server->set(array( $this->server->set(array(
'worker_num' => 1, //设置启动的 Worker 进程数。【默认值CPU 核数】 'worker_num' => 2, //设置启动的 Worker 进程数。【默认值CPU 核数】
'daemonize' => false // 使用docker 不需要设置守护进程 'daemonize' => false // 使用docker 不需要设置守护进程
)); ));
//$this->server->on('request',function ($req,$res){}); //$this->server->on('request',function ($req,$res){});