码迷,mamicode.com
首页 > Web开发 > 详细

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

时间:2020-01-11 15:09:02      阅读:105      评论:0      收藏:0      [点我收藏+]

标签:ble   https   nec   queue   you   when   mem   can   rpc   

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 read and write deadlines 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)

标签:ble   https   nec   queue   you   when   mem   can   rpc   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!