pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/php-http/curl-client/pull/56

assets/global-68dd150ce6c8e711.css" /> Issue 55 curl multirunner burn cpu by mekras · Pull Request #56 · php-http/curl-client · GitHub
Skip to content

Issue 55 curl multirunner burn cpu#56

Open
mekras wants to merge 2 commits into2.xfrom
issue-55-CurlMultirunner_burn_CPU
Open

Issue 55 curl multirunner burn cpu#56
mekras wants to merge 2 commits into2.xfrom
issue-55-CurlMultirunner_burn_CPU

Conversation

@mekras
Copy link
Collaborator

@mekras mekras commented Apr 10, 2019

No description provided.

Copy link
Contributor

@dbu dbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for looking into this. some comments and questions:


$info = curl_multi_info_read($this->multiHandle);
if (false !== $info) {
if ($info !== false) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't revert yoda style comparisons.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it has nothing to do with the change at hand.

i would have expected the code style checker to complain, but seems we don't have a rule for this activated.

}

do {
$status = curl_multi_exec($this->multiHandle, $active);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this now again busy waiting? should we repeat the curl_multi_select in each loop?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not pretty sure. Most examples I've found are like this https://bugs.php.net/bug.php?id=61141#1348321490

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its again the same as guzzle does, which is most likely what the symfony http client is using, so i'd hope its the right thing.

@ricostone
Copy link

ricostone commented Dec 10, 2019

Hi i'm running into this, any merge planned ? Any help needed ?
We actually kickfixed like this ...

$status = curl_multi_exec($this->multiHandle, $active);
$info = curl_multi_info_read($this->multiHandle);
if (false !== $info) {
                ...
}else{
 // fixing issue https://github.com/php-http/curl-client/issues/55
 usleep(self::MULTI_RUNNER_USLEEP);
}

@dbu
Copy link
Contributor

dbu commented Jan 22, 2020

from elastic/elasticsearch-php#990:

a solution proposed at https://bugs.php.net/bug.php?id=61141#1348321490 is

while ($active && $mrc == CURLM_OK) {
    if (curl_multi_select($mh) == -1) usleep(100);
    do { $mrc = curl_multi_exec($mh, $active); }
    while ($mrc == CURLM_CALL_MULTI_PERFORM);
}

(which we should format according to our code style, but functionality seems good to me. 100 micro seconds is 1 thousandst of a second, so should be an acceptable delay while lowering the cpu)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy