webman: start.php的应用

一,查看帮助:

$ php start.php help
Usage: php yourfile <command> [mode]
Commands:
start           Start worker in DEBUG mode.
                Use mode -d to start in DAEMON mode.
stop            Stop worker.
                Use mode -g to stop gracefully.
restart         Restart workers.
                Use mode -d to start in DAEMON mode.
                Use mode -g to stop gracefully.
reload          Reload codes.
                Use mode -g to reload gracefully.
status          Get worker status.
                Use mode -d to show live status.
connections     Get worker connections. 

二,查看连接

]$ php start.php connections
Workerman[start.php] connections
--------------------------------------------------------------------- WORKERMAN CONNECTION STATUS --------------------------------------------------------------------------------
PID      Worker          CID       Trans   Protocol        ipv4   ipv6   Recv-Q       Send-Q       Bytes-R      Bytes-W       Status         Local Address          Foreign Address

三,查看状态

$ php start.php status
Workerman[start.php] status
----------------------------------------------GLOBAL STATUS----------------------------------------------------
Workerman version:4.2.1          PHP version:8.2.5
start time:2025-01-09 13:56:34   run 0 days 1 hours
load average: 0, 0.01, 0         event-loop:\Workerman\Events\Select
2 workers       17 processes
worker_name  exit_status      exit_count
webman       0                0
monitor      0                0
----------------------------------------------PROCESS STATUS---------------------------------------------------
pid     memory  listening           worker_name  connections send_fail timers  total_request qps    status
19078   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19079   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19080   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19081   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19082   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19083   5.05M   http://0.0.0.0:8787 webman       0           0         1       1             0      [idle]
19084   5.05M   http://0.0.0.0:8787 webman       0           0         1       1             0      [idle]
19085   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19087   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19088   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19090   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19091   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19092   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19094   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19095   4.77M   http://0.0.0.0:8787 webman       0           0         1       0             0      [idle]
19097   10.03M  http://0.0.0.0:8787 webman       0           0         1       11            0      [idle]
19099   4.79M   none                monitor      0           0         2       0             0      [idle]
----------------------------------------------PROCESS STATUS---------------------------------------------------
Summary 76M     -                   -            0           0         18      13            0      [Summary] 

加-d会实时刷新

四,重新加载代码

$ php start.php reload -g
Workerman[start.php] reload 

五,重启服务

$ php start.php restart -d -g

六,以daemon方式启动服务

$ php start.php start -d

七,reload和restart的区别:

restart 是进程全部同时重启,重启的一瞬间没有任何进程提供服务,这时候如果有请求到来会失败。
reload是进程一个一个重启,重启过程中始终有进程在提供服务,有新请求过来不会失败。

一般情况下 reload restart 不会中断正在处理的请求,但是如果正在执行的请求很慢,超过2秒没处理完,会被强行杀死,请求会被中断。

八,reload 加-g的作用:

-g   会等所有客户端连接断开后重启

 

posted @   刘宏缔的架构森林  阅读(14)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
历史上的今天:
2022-01-12 thinkphp6: 用bcrypt加密生成密码(php 8.1.1 / thinkphp v6.0.10LTS )
2022-01-12 thinkphp6: 使用yac做缓存(php 8.1.1 / thinkphp v6.0.10LTS )
2022-01-12 php8: 安装yac(yac 2.3.2-dev / php 8.1.1)
点击右上角即可分享
微信分享提示