Home > php教程 > php手册 > body text

php的POSIX 函数以及进程测试

WBOY
Release: 2016-06-06 19:54:32
Original
879 people have browsed it

参考:http://cn.php.net/manual/zh/ref.posix.php ?php echo posix_getpid(); //8805 sleep(10); ? 再用 #ps -ax 这个时候如果多开开个浏览器请求,就会发现Apache自动增加了几个新的进程 我们发现并非一直请求同一个进程 重启apache # /usr/local/apache2/

参考:http://cn.php.net/manual/zh/ref.posix.php

echo posix_getpid(); //8805
sleep(10);
?>

php的POSIX 函数以及进程测试

再用

#ps -ax

php的POSIX 函数以及进程测试

这个时候如果多开开个浏览器请求,就会发现Apache自动增加了几个新的进程

php的POSIX 函数以及进程测试

我们发现并非一直请求同一个进程

php的POSIX 函数以及进程测试

重启apache

# /usr/local/apache2/bin/apachectl restart

我们发现Apache又恢复到默认进程数。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!