当前位置:首页 > Web开发 > 正文

with maximum garbage collection (GC) 标签: 原文地址:https://www.c

2024-03-31 Web开发

https://learnku.com/docs/go-blog/qihoo/6532

Use a Task Pool, a mechanism with a group of long-lived goroutines consuming global task or message queues sent by connection goroutines, to replace short-lived goroutines.

Monitor and control goroutine numbers in the program. The lack of control can cause unbearable burden on the GC, imposed by surges in goroutines due to uninhibited acceptance of external requests, as RPC invocations sent to inner servers may block goroutines recently created.

Remember to add  to connections when under a mobile network; otherwise, it may lead to goroutine blockage. Apply it properly and with caution when under a LAN network, otherwise your RPC communication efficiency will be hurt.

Use Pipeline (under Full Duplex feature of TCP) to enhance the communication efficiency of RPC framework.

https://learnku.com/docs/go-blog/qihoo/6532 。 heap size went up to 69G, with maximum garbage collection (GC)

标签:

原文地点:https://www.cnblogs.com/yuanjiangw/p/12179793.html

温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/web/31816.html