Connection closed
还没有人认领这个 Issue。
评估
调研方向
首先,使用所示的 timeout 和 max_conn_per_addr 设置,通过 Workerman\Http\Client::post 重现并发请求,比较顺序提交和快速连续提交。检查 issue 中描述的单 worker 设置以及与 curl_multi 的对比。完成标准是找出产生 "Connection closed" 结果的原因,并确认并发请求的预期行为。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- PHP
- 星标
- 55
- 派生
- 19
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
workerman-php/http-client 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 52/100
workerman-php/http-client#48 ·
-
难度 4/5 3-5 天 新手友好度 35/100
workerman-php/http-client#39 ·
-
TLS 1.3 未关闭
难度 4/5 3-5 天 新手友好度 35/100
workerman-php/http-client#32 ·
-
难度 5/5 一周以上 新手友好度 20/100
workerman-php/http-client#23 ·
-
如何忽略SSL 错误 未关闭
难度 5/5 一周以上 新手友好度 25/100
workerman-php/http-client#18 · 1 条评论 ·
查看 workerman-php/http-client 的全部 Issue
相似的 Issue
-
Bug
难度 2/5 1-3 小时 新手友好度 70/100
Automattic/safe-publish#594 ·
-
needs-triage Platform(Default)
难度 2/5 1-3 小时 新手友好度 75/100
-
HttpClient
难度 2/5 1-3 小时 新手友好度 75/100
symfony/symfony-docs#23092 ·
-
sync-en
难度 1/5 1 小时以内 新手友好度 90/100
-
sync-en
难度 1/5 1 小时以内 新手友好度 95/100