【发布时间】:2010-04-24 09:49:59
【问题描述】:
基本上,我正在使用 apache bench 进行一些测试。我正在测试的文件需要 2 秒才能执行(经过优化,它连接到外部服务器,因此速度变慢)
基本上我发现我模拟的并发用户越多,我每秒可以执行的文件越多。
无论如何我可以在 php 中做这样的事情吗? :
<?php
execute_file('file.php');
execute_file('file.php');
execute_file('file.php');
execute_file('file.php');
execute_file('file.php');
?>
这将执行文件 5 次,但不会等待文件完成下载,因此上面的示例将快速调用 5 个函数然后退出。
我假设会使用某种超时?
【问题讨论】: