workerman已启动,但是连接不上

toad
----------------------------------------------GLOBAL STATUS----------------------------------------------------
Workerman version:3.5.31          PHP version:7.3.21
start time:2020-08-29 02:42:37   run 0 days 0 hours   
load average: 1.8, 2, 2          event-loop:\Workerman\Events\Select
3 workers       3 processes
worker_name    exit_status      exit_count
Gateway        0                0
BusinessWorker 0                0
Register       0                0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid memory  listening                worker_name    connections send_fail timers  total_request qps    status
15583   20M     websocket://0.0.0.0:8443 Gateway        1           0         1       3             0      [idle]
15584   N/A     none         BusinessWorker N/A         N/A       N/A     N/A           N/A    [busy] 
15585   20M     text://0.0.0.0:1236      Register       1           0         0       2             0      [idle]
----------------------------------------------PROCESS STATUS---------------------------------------------------
Summary 40M     -                        -            2           0         1       5             0      [Summary] 

nginx 配置

    listen 80;
    server_name ws.xxx.com;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/chat/public;

    location /websocket {
            proxy_pass http://127.0.0.1:8443;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
    }

连接失败提示

WebSocket connection to 'ws://ws.xxx.com/websocket' failed: Error during WebSocket handshake: Unexpected response code: 502
4009 1 0
1个回答

walkor 打赏

status里 BusinessWorker 显示为busy,可能是业务代码用了死循环或者长时间阻塞的代码。把业务代码都去掉试下,排除业务代码问题。

  • 暂无评论
年代过于久远,无法发表回答
×
🔝