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

可否给skynet.socket增加查询发送缓冲区未发送字节数的函数 #1004

Closed
jxlczjp77 opened this issue May 5, 2019 · 3 comments
Closed

Comments

@jxlczjp77
Copy link

@jxlczjp77 jxlczjp77 commented May 5, 2019

我尝试用skynet做消息推送业务,有个问题是消费者阻塞或者读取速度变慢,推送服务的业务代码没有办法得到反馈,继续推送会造成大量消息积压在发送缓冲区。
当然目前也有解决方法,就是在业务层增加一个ack确认协议,不过如果底层能增加这个查询功能的话可以更好的调整推送速率。

@jxlczjp77

This comment has been minimized.

Copy link
Author

@jxlczjp77 jxlczjp77 commented May 5, 2019

socket.warning设置的回调函数可以得到缓冲区告警通知,在这里我尝试降速发送,后续再慢慢递增发送速度,但还是没有很好的方法来评估降速后是否缓冲区没有继续变大。

@cloudwu

This comment has been minimized.

Copy link
Owner

@cloudwu cloudwu commented May 5, 2019

过载 warning 信号后,一旦缓冲区发完会还推送一个 0 的 warning 信号,你可以靠这个测速。

@jxlczjp77

This comment has been minimized.

Copy link
Author

@jxlczjp77 jxlczjp77 commented May 5, 2019

实际测试确实发现 size 为 0 的 warning 信号,原来是这个原理,非常感谢。

@jxlczjp77 jxlczjp77 closed this May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.