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

服务间通讯导致内存持续增加 #429

Open
ghost opened this issue Dec 5, 2022 · 5 comments
Open

服务间通讯导致内存持续增加 #429

ghost opened this issue Dec 5, 2022 · 5 comments

Comments

@ghost
Copy link

ghost commented Dec 5, 2022

按文中介绍调用链方式去设计:ApiGeteWay -> ServiceB ->ServiceA
运行一段时间后,ApiGeteWay和 ServiceA 内存保持稳定,但是 ServiceB 内存占用持续增加,没有释放的迹象,这是什么原因呢?

@fanliang11
Copy link
Owner

#419
ServiceB 能调用 ServiceA吗?

@ghost
Copy link
Author

ghost commented Dec 5, 2022 via email

@ghost
Copy link
Author

ghost commented Dec 5, 2022

您说的没大理解 ,我拉的最新代码,ServiceB 以 T GetService() 调用 ServiceA出现上述情况,ServiceB在整个业务中主要充当聚合的作用,ApiGeteWay -> ServiceB ->ServiceA这样的用法有问题?

@fanliang11
Copy link
Owner

我这边项目中未碰上此类问题,可以用性能探查器或者利用WinDbg分析一下那里的问题吗?
建议询问:
1.ApiGeteWay 是引用stage 组件生成的网关吗?ServiceB是不是架设引用在网关的聚合服务
2.如果业务耗时较长,可以改成以下方式,但是这会消耗过多线程切换,这个不适用流媒体处理,更适合业务操作
}
var workerGroup1 = new MultithreadEventLoopGroup();
.ChildHandler(new ActionChannelInitializer(channel =>
{
pipeline.AddLast(new LengthFieldBasedFrameDecoder(int.MaxValue, 0, 4, 0, 4));
pipeline.AddLast(workerGroup1, "HandlerAdapter", new

@ghost
Copy link
Author

ghost commented Dec 6, 2022

ApiGeteWay 不是引用stage 组件生成的网关,ServiceB也不是架构引用在网关的聚合服务。ServiceB是为了处理复杂的跨服务业务的建立的服务模块,所以我的理解ServiceB从调用过程中是即是客户端又是服务端。非常感谢您的耐心指点,我下来用WinDbg分析下问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant