0

启动swoole server服务之后 看不到reactor线程

代码

<?php

$server = new \Swoole\Server('0.0.0.0', 9520);

$server->set([
    'work_num' => 3,
    'task_work_num' => 3,
]);

$server->on('Start', function ($serv) {
    echo 'SWOOLE:'.SWOOLE_VERSION.'服务已启动'.PHP_EOL;
    echo 'swoole_cpu_num:'.swoole_cpu_num().PHP_EOL;
});

$server->on('Receive', function ($serv, $fd, $from_id, $data) {

});

$server->on('Task', function ($serv, $task) {

});

$server->on('Finish', function ($serv, $task_id, $data) {

});

$server->start();

启动服务

查看相关进程
图片描述

查看进程树状图
图片描述

xzeze 1
2019-06-25 提问
1 个回答
0

worker_num 和 task_worker_num ,你看下你写的(work_num、task_work_num),改成正确的再试试呢 ~

撰写答案

推广链接