curl - PHP request hangs when using guzzle -
i have following code:
$client = new guzzlehttp\client( array( 'base_uri' => 'https://somesite.com' ) ); $response = $client->request('post', '/api', [ 'form_params' => array( 'action' => 'getusers', 'api_key' => $_post['key'], 'id' => $_post['id'] ) ]);
when multiple users accessing same page following code above, other users waits first or recent request finish before loading request.
i'm not using session
.
i have tag curl
because guzzle built on top of it. maybe has it?
any workaround this?
using xhr
won't fix because site i'm requesting api not accept other origins.
check available php processes if using php fpm. has status page (the setup described there) information.
if workers busy, client's requests wait. need increase amount of workers able process more requests @ once.
Comments
Post a Comment