Can we prevent deadlock on calling own server?

  • | 180 points

    If a PHP app makes multiple http API calls to the same machine, exhausting php_upstream entries, it will lock up, waiting on the first php-cgi.exe process that is still busy.

    This can be easily reproduced using the following code:
    for ($i=1;$i<15;$i++){
    $search = file_get_contents('http://SAME-MACHINE/ANY-SCRIPT.PHP');

    It is ok when launched from CLI, but locks up if requested over http when upstream is <15.

    I have asked on Stack-Exchange and the "best" suggestion was to switch to Linux...

    Is there a way to prevent this deadlock without having 50-100 upstream entries?


Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.