-
Notifications
You must be signed in to change notification settings - Fork 48
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
gossdb Client 性能问题 #12
Comments
最近使用gossdb driver,发现一个性能瓶颈问题。使用MultiHgetAllSlice 获取整张hash map 时,请求量1次每秒,cpu飙到600%, 内存占用1GB,当前使用go1.8 编译,使用go1.7编译时,内存直接暴涨到3GB。然后go tool pprof 查看cpu,问题出现在func (c *Client) parse() []string 这个函数。
请问一下这个是否可以优化一下呢? |
代码还有优化的空间。 另外,不建议一次获取 hash 的全部内容,应该通过分页遍历,一次获取1000条记录为佳。 |
OK,我获取的hash 大小一般都比较小,不超过200条,当前我尝试优化了一下,先pprof 看一下效果,如果不错,再提交给你review 一下。 |
我重新提交了是个pull request ,麻烦帮忙review 一下。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: