[BUG] recv 重连问题
pixiaoxiao opened this issue · comments
pixiaoxiao commented
pixiaoxiao commented
recv方法
Luffy commented
maxAttempts设为0,捕获connect异常就可以吧?
pixiaoxiao commented
大神,我想请教你一个问题,服务本地虚拟机,2核2G,订阅频道发布速度0.5s/条(如果提高到0.1s/条,这时候明显的发现协程处理的速度降低), 协程客户端在处理订阅信息的时候,同样条件下跟workerman对比,速度没有worerkman的速度快,我怀疑是我这边的协程核心api参数配置不合理导致的,我想优化一下,大神能提供一点思路建议吗
这是协程
Coroutine::getOptions()
打印出来的核心参数
array:28 [
"daemonize" => false
"dispatch_mode" => 2
"reactor_num" => 4
"worker_num" => 8
"task_worker_num" => 8
"task_ipc_mode" => 1
"task_max_request" => 100000
"task_tmpdir" => "/dev/shm"
"max_request" => 100000
"open_tcp_nodelay" => true
"pid_file" => "/home/vagrant/dcat-admin/storage/laravels.pid"
"log_level" => 4
"heartbeat_idle_time" => 600
"heartbeat_check_interval" => 60
"log_file" => "/home/vagrant/dcat-admin/storage/logs/swoole-2021-04.log"
"document_root" => "/home/vagrant/dcat-admin/public"
"buffer_output_size" => 2097152
"socket_buffer_size" => 8388608
"package_max_length" => 4194304
"reload_async" => true
"max_wait_time" => 60
"max_coroutine" => 3000
"enable_reuse_port" => true
"enable_coroutine" => false
"upload_tmp_dir" => "/dev/shm"
"http_compression" => false
"enable_static_handler" => false
"hook_flags" => 2147479551
]
Luffy commented
你的协程是关闭的
"max_coroutine" => 3000
"enable_coroutine" => false
pixiaoxiao commented
这个昨天我也看到了,已改为true,从执行结果来看发现没有什么明细的变化,message_id都是这种的错开的,说明执行协程是开启有效的状态
在 2021-04-27 06:50:34,"沈唁" ***@***.***> 写道:
你的协程是关闭的
"max_coroutine" => 3000
"enable_coroutine" => false
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
pixiaoxiao commented
原因已经找到,send的第二个参数之前没有设置,默认的是true,导致开销额外增加
在 2021-04-27 06:50:36,"沈唁" ***@***.***> 写道:
Closed #48.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Luffy commented
send 的 第二个参数是按需求设置的。当你需要ack的时候设置为true,其他时候false就可以了