英文:
Memory efficient way to use Redis pubsub on per user basis in go service?
问题
我们使用GraphQL订阅将数据推送到客户端。在使用Go语言编写的GraphQL服务器上,我们为每个用户订阅连接到一个pubsub频道(每个用户的频道是唯一的)。在测试过程中,我们注意到随着每个新用户订阅的增加,Go服务的内存消耗开始迅速增长。
对于如何减少这种实现的内存占用,您有什么建议吗?
英文:
We use GraphQL subscriptions that push data to the client. On the GraphQl server, written in golang, we connect to a pubsub channel for each user subscription (channel is unique for each user). While testing we noticed that the go service memory consumption started to grow really fast with every new user subscription.
Any recommendations on how we make this implementation less memory intensive?
答案1
得分: 1
你现在最好的做法是对你的程序进行分析,找出问题的原因。你可以参考这篇文章了解如何对程序进行分析。https://medium.com/@openmohan/profiling-in-golang-3e51c68eb6a8
请按照这篇文章获取更多关于如何对程序进行分析的信息。
英文:
The best thing you can do now is to profile your program to find out the reason behind the problem
https://medium.com/@openmohan/profiling-in-golang-3e51c68eb6a8
Follow the article for more information on how to profile a programs
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论