apache / brpc

brpc is an Industrial-grade RPC framework using C++ Language, which is often used in high performance system such as Search, Storage, Machine learning, Advertisement, Recommendation etc. "brpc" means "better RPC".
https://brpc.apache.org
Apache License 2.0
16.56k stars 3.98k forks source link

Support arena rpc pb message factory #2751

Closed chenBright closed 2 months ago

chenBright commented 2 months ago

What problem does this PR solve?

Issue Number: resolve #535

Problem Summary:

What is changed and the side effects?

Changed:

  1. 目前bRPC已经不支持pb 2.x,没有了兼容性方面的顾虑,所以在#2718 的基础上支持pb3 arena机制即可。
  2. HTTP协议支持RpcPBMessageFactory。

Side effects:


Check List:

wwbmmm commented 2 months ago

LGTM

sikey647 commented 4 weeks ago

有遇到过,这样设置之后,只要有流量,内存一致上涨OOM的情况吗 rpc_options.rpc_pb_message_factory = brpc::GetArenaRpcPBMessageFactory<1024, 128 * 1024>();

chenBright commented 4 weeks ago

@sikey647 试试#2798

sikey647 commented 3 weeks ago

@sikey647试试#2798

@chenBright 哦,看着应该可以了。 昨天看代码排查时候,感觉可能是arena直接放入对象池导致的,后来直接改成new/delete验证了下,看着是ok的。上午按你给的pr更新了下,目前观察看着是ok的

chenBright commented 3 weeks ago

@sikey647 #2798 已经合入了,可以更新一下master使用。