一,查看帮助:
$ 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 会等所有客户端连接断开后重启
标签:webman,0.0,start,idle,php,8787 From: https://www.cnblogs.com/architectforest/p/18662280