php-parallel-soap icon indicating copy to clipboard operation
php-parallel-soap copied to clipboard

Multi requests cause high CPU load

Open taxp opened this issue 2 years ago • 1 comments

Hello.

When running multiple soap requests with setMulti(true), CPU load is 100%. This behavior shows especially when endpoints work slowly. This happens in the lines:

do {
    $mrc = curl_multi_exec($mh, $active);
} while ($mrc === CURLM_CALL_MULTI_PERFORM || $active);

Possible solution is to call usleep or to call curl_multi_select in the loop.

OS: Debian 10 PHP version: 7.2.34 CURL version: 7.64.0

taxp avatar Mar 21 '22 11:03 taxp

Thank you, could you share a code example to reproduce this issue, and do you think the fix could be adding optional sleep between the soap calls?

meabed avatar Mar 23 '22 02:03 meabed