WordPress / WordPress/Requests

performance issue when using request_multiple

Open
#283 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
3.6k
Forks
500
Avg merge
2d 21h
Merged PRs (30d)
5

Description

The following code will cause serious performance problem:

do {
    $status = curl_multi_exec($multihandle, $active);
}
while ($status === CURLM_CALL_MULTI_PERFORM);

it will be much better if changed as follow

do {
    $status = curl_multi_exec($multihandle, $active);
    usleep(1000);
}
while ($status === CURLM_CALL_MULTI_PERFORM);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the request_multiple implementation and the loop that calls curl_multi_exec; start by tracing how its status and active-handle values are handled. Compare the reported loop with the proposed delay, then verify that repeated multi requests no longer busy-wait while completing successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.