pstree -a | grep php
| | `-php server.php 主进程
| | |-php server.php 管理线程 worker线程死掉后 可以重启一个worker线程
| | | `-php server.php
| | `-{php}
ps -aux
root 3797 0.0 1.5 42776 16240 pts/0 Sl+ 21:50 0:00 /usr/local/php-5.6.8/bin/php server.php root 3798 0.0 0.2 32024 2116 pts/0 S+ 21:50 0:00 /usr/local/php-5.6.8/bin/php server.php root 3800 0.0 0.2 32368 2360 pts/0 S+ 21:50 0:00 /usr/local/php-5.6.8/bin/php server.php
[[email protected] ~]# strace -p 3797 (查看目前进程在干嘛) Process 3797 attached - interrupt to quit poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout) time(NULL) = 1431008802 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout) time(NULL) = 1431008803 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout) time(NULL) = 1431008804 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout) time(NULL) = 1431008805 poll([{fd=5, events=POLLIN}], 1, 1000) = 0 (Timeout) time(NULL) = 1431008806
[[email protected] ~]# strace -p 3798 Process 3798 attached - interrupt to quit wait4(-1,
线程是可以共享进程的内存和资源
master 主进程
manager 管理线程
worker
时间: 2024-10-14 11:11:36