Remote Procedure Call (RPC) is a widely used abstraction for cloud computing. The programmer specifies type information for each remote procedure, and a compiler generates stub code linked into each application to marshal and unmarshal arguments into message buffers. Increasingly, however, application and service operations teams need a high degree of visibility and control over the flow of RPCs between services, leading many installations to use sidecars or service mesh proxies for manageability and policy flexibility. These sidecars typically involve inspection and modification of RPC data that the stub compiler had just carefully assembled, adding needless overhead. Further, upgrading diverse application RPC stubs to use advanced hardware capabilities such as RDMA or DPDK is a long and involved process, and often incompatible with sidecar policy control. In this paper, we propose, implement, and evaluate a novel approach, where RPC marshalling and policy enforcement are done as a system service rather than as a library linked into each application. Applications specify type information to the RPC system as before, while the RPC service executes policy engines and arbitrates resource use, and then marshals data customized to the underlying network hardware capabilities. Our system, mRPC, also supports live upgrades so that both policy and marshalling code can be updated transparently to application code. Compared with using a sidecar, mRPC speeds up a standard microservice benchmark, DeathStarBench, by up to 2.5$\times$ while having a higher level of policy flexibility and availability.
翻译:远程过程调用(Remote Procedure Call,RPC)是云计算中广泛使用的一种抽象机制。程序员为每个远程过程指定类型信息,编译器生成存根代码并链接到各个应用程序中,用于将参数编组和解组为消息缓冲区。然而,随着应用和服务运维团队需要对服务间的RPC流程具备高度的可见性与控制能力,许多部署开始采用边车(sidecar)或服务网格代理来实现可管理性和策略灵活性。这些边车通常会对存根编译器刚刚精心组装好的RPC数据进行检测和修改,从而引入不必要的开销。此外,为了支持RDMA或DPDK等高级硬件能力而升级不同应用的RPC存根,是一个漫长且繁琐的过程,且往往与边车策略控制不兼容。本文提出、实现并评估了一种新颖方法:将RPC编组和策略执行作为系统服务而非链接到每个应用程序的库来实现。应用程序仍像以前一样向RPC系统指定类型信息,而RPC服务则执行策略引擎并仲裁资源使用,然后根据底层网络硬件能力定制编组数据。我们的系统mRPC还支持实时升级,使得策略和编组代码都能以对应用程序代码透明的方式进行更新。与使用边车相比,mRPC在标准微服务基准测试DeathStarBench上加速高达2.5倍,同时具备更高的策略灵活性和可用性。