fanliang11 / surging

Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
MIT License
3.24k stars 923 forks source link

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

Open ghost opened 1 year ago

ghost commented 1 year ago

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

fanliang11 commented 1 year ago

419

ServiceB 能调用 ServiceA吗?

ghost commented 1 year ago

亲,邮件已收到

ghost commented 1 year ago

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

fanliang11 commented 1 year ago

我这边项目中未碰上此类问题,可以用性能探查器或者利用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 commented 1 year ago

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