|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-08-22 11:01 UTC] edoardo dot serra at webrainstorm dot it
Description:
------------
Hi guys,
I'm using pecl_http 1.2.0 with curl enbabled (v7.13.1) and libz enabled (v1.2.2.2)
I'm testing HttpRequestPool with different numbers of requests.
When I use it to do 1000 or more requests it executes only a small amount of requests without giving exceptions of any kind.
That small amount of request is varying from time to time.
With the code below (1000 expected requests) I got a number of executed requests varying from 200 to 300.
(I got the number of executed requests grepping in the webserver logfile double checking with the script output)
I'm executing the script from the CLI
Reproduce code:
---------------
#!/usr/local/bin/php -q
<?php
set_time_limit(0);
/* utilize onfinish callback */
class Request extends HttpRequest {
function onFinish($success) {
printf("- %s -> %3d \n", $this->getUrl(), $this->getResponseCode());
}
}
$o = array("connecttimeout" => 10, "redirect" => 10);
for ($i = 1; $i <= 1000; $i++)
$u[] = "http://test.webrainstorm.it/httpool/index.php?run1000A=".$i;
foreach ($u as $url) {
$r[] = new Request($url, HTTP_METH_GET, $o);
}
printf ("Should do %d requests\n", count($r));
/* run requests in a pool */
$p = new HttpRequestPool;
foreach ($r as $request) {
$p->attach($request);
}
try {
$p->send();
} catch (HttpRequestPoolException $ex) {
foreach ($ex->exceptionStack as $e) {
echo $e, "\n";
}
}
?>
Expected result:
----------------
1000 lines indicating executed requests
Actual result:
--------------
200-300 lines indicating executed requests
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 16:00:02 2025 UTC |
I'd appreciate if you could try current CVS version. The exception was suppressed and it should be fixed in CVS. You were hitting the timeout. Please note that there's no exceptionStack property anymore, use something like the following instead: do { echo $ex, "\n"; while ($ex = @$ex->innerException); Thanks.