Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection closed #16

Open
blackcatt opened this issue Sep 9, 2023 · 0 comments
Open

Connection closed #16

blackcatt opened this issue Sep 9, 2023 · 0 comments

Comments

@blackcatt
Copy link

I decided use http client in my worker.
Server part works on workerman Worker with one thread ( $worker->count = 1; ) Business logic requires it.

Part of http client here :

$http = new Workerman\Http\Client(
['max_conn_per_addr' => 128,
  'keepalive_timeout' => 15,
   'connect_timeout'   => 30,
   'timeout'           => 30,
]);
$t=microtime(1);
$http->post('http://127.0.0.1:8080', ['command'=>'ping'], 
function ($response) { echo "ok\n"; }, 
function ($exception) use($t){ echo ' exception ['.substr($exception,0,57).']</b> diff:'.(microtime(1)-$t).s"\n"; }
);

So, when i post queries sequentially all work fine and quick. But if i send multiple quries - http client very quickly (0.1sec) recieve exception "Connection closed". I was expect that it will wait answer from server up to 30 seconds, but not.
If I use another asynchronous method of client operation via curl_multi I don’t observe such server behavior.
May be i need some tune of psr7 ? Or do you have any smart thoughts on this topic?

Thank you for your product and attention to it.

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

No branches or pull requests

1 participant