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

性能、内存占用问题 #12

Closed
lesismal opened this issue Jul 16, 2021 · 3 comments
Closed

性能、内存占用问题 #12

lesismal opened this issue Jul 16, 2021 · 3 comments
Labels
invalid This doesn't seem right

Comments

@lesismal
Copy link

lesismal commented Jul 16, 2021

用于压测的echo server代码在这里: server

压测客户端100个连接、payload 64,代码在这:client

跟其他几个库相比,都是append一个新的buffer用于写,其他框架也可以直接写读到的buffer、但也都用了append的新buffer回写,所以这应该不影响各个框架性能对比

不知道现在这个echo server代码正确了没,用这个代码测,100连接、1k payload,吞吐量只有 gnet 的一半左右,甚至比 easygo还慢一些。。

如果方便,请提供下你们的benchmark代码我重新跑下看看

@lesismal
Copy link
Author

lesismal commented Jul 16, 2021

其他网络库使用相同的环境、 相同的虚拟机、相同的client压测

@lesismal lesismal changed the title OOM 性能、内存占用问题 Jul 16, 2021
@lesismal
Copy link
Author

lesismal commented Jul 17, 2021

直接这样用读到的buffer回写,吞吐量可能比easygo强一点,比gnet还是低很多,而且还是吃内存,压测30s,内存RES随便2、3G

reader := connection.Reader()
buf, err := reader.Next(reader.Len())
if err != nil {
        return err
}
n, err := connection.Write(buf)

@Hchenn
Copy link
Contributor

Hchenn commented Jul 18, 2021

压测代码会在后续更新,有兴趣可以加入用户群一起讨论 https://github.com/cloudwego/kitex#%E8%81%94%E7%B3%BB%E6%88%91%E4%BB%AC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Development

No branches or pull requests

2 participants