note 103450 added to function.curl-multi-exec
| From: | fbparis at osu1 dot php dot net | Date: | Thu, 14 Apr 2011 05:46:51 +0000 |
| Subject: | note 103450 added to function.curl-multi-exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-178817@lists.php.net to get a copy of this message | ||
In all your examples, you should add a usleep() in the while loop to prevent CPU burning (and load
average > 1) :
<?php
// ...
$running = null;
do{
curl_multi_exec($mh,$running);
usleep(50000); // perfs are not altered, proc is safe :)
}while($running > 0);
// ...
?>
It really makes a difference !
----
Server IP: 80.67.10.228
Probable Submitter: 188.126.83.131
----
Manual Page -- http://www.php.net/manual/en/function.curl-multi-exec.php
Edit -- https://master.php.net/note/edit/103450
Del: integrated -- https://master.php.net/note/delete/103450/integrated
Del: useless -- https://master.php.net/note/delete/103450/useless
Del: bad code -- https://master.php.net/note/delete/103450/bad+code
Del: spam -- https://master.php.net/note/delete/103450/spam
Del: non-english -- https://master.php.net/note/delete/103450/non-english
Del: in docs -- https://master.php.net/note/delete/103450/in+docs
Del: other reasons-- https://master.php.net/note/delete/103450
Reject -- https://master.php.net/note/reject/103450
Search -- https://master.php.net/manage/user-notes.php