[zhengzongqiang@localhost ~]$ ps aft | grep http 40193 pts/2 S+ 0:00 \_ grep --color=auto http 39658 pts/1 Sl+ 0:00 \_ /opt/soft/php/bin/php /opt/work/htdocs/swoole_mooc/demo/process/../server/http.php 39659 pts/1 S+ 0:00 \_ /opt/soft/php/bin/php /opt/work/htdocs/swoole_mooc/demo/process/../server/http.php 39661 pts/1 S+ 0:00 \_ /opt/soft/php/bin/php /opt/work/htdocs/swoole_mooc/demo/process/../server/http.php
我们可以看到,http
进程ID为39659
,其父进程ID为39658
进程,即swoole_process
进程,再父进程就是启动swoole_process
进程的进程,即执行此文件的的命令的进程,即39657
进程。
39659
进程也有子进程,即worker进程。
可以理解为39658
进程为master进程,39659
进程为manager进程。
链接:https://www.jianshu.com/p/97d3a4227202