LRPC的意义是什么?为什么有人要对同一台计算机进行远程过程调用? [英] What is the point of LRPC? Why would anyone want to make Remote Procedure Calls to the same machine?

查看:336
本文介绍了LRPC的意义是什么?为什么有人要对同一台计算机进行远程过程调用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我对RPC(远程过程调用)的了解,它们提供了一种将函数调用,调用等发送到远程计算机的方法。这样做的明显好处是,您可以在一个计算机集群上运行一个程序,并且可以处理更多请求,更多数据等等。

From what I understand about RPC (Remote Procedure Calls), is that they provide a way to send function calls, invocations, etc to remote machines. The obvious advantage of this is that you can have a single program that runs on a cluster of machines and can handle more requests, more data, on so on.

但是我对此感到困惑 LRPC-轻量级RPC
显然,存在这些东西是为了加快同一台计算机上的RPC。如论文我链接到

But I'm puzzled by LRPC - Lightweight RPC. Apparently this stuff exists to speed up RPC on the same machine. As written in the paper I linked to:


轻量级远程过程调用(LRPC)是一种通信工具
,其设计和优化用于同一台计算机上
上保护域之间的通信。在当代的小内核操作系统中,当
用于同一机器上保护域
之间占主导地位的通信类型时,
会导致不必要的高成本。此成本导致系统设计人员将
的弱关联子系统合并到同一保护域中,以
的安全性换取性能。通过减少同一台机器
的通信开销,LRPC鼓励了安全性和性能。

Lightweight Remote Procedure Call (LRPC) is a communication facility designed and optimized for communication between protection domains on the same machine. In contemporary small-kernel operating systems, existing RPC systems incur an unnecessarily high cost when used for the type of communication that predominates-between protection domains on the same machine. This cost leads system designers to coalesce weakly related subsystems into the same protection domain, trading safety for performance. By reducing the overhead of same-machine communication, LRPC encourages both safety and performance.

我的问题是:RPC的意义是什么?如果您正在同一台计算机上运行所有内容。 R 代表 REMOTE。。如果您不是 Remote,则将其称为LPC。我缺少什么?

My question is: what is the point of RPC if you're running everything o nthe same computer. The R stands for REMOTE. If you're not gonna be Remote, then just call it LPC. What am I missing?

推荐答案

本地RPC有几种用例,但是一个非常简单的示例是服务器同时拥有两个

There are several use cases for local RPC, but a very straightforward example is when a server has both remote and local clients.

让我们考虑一个基于RPC的打印服务器:

Let us consider for example an RPC-based print server:


  • 您可能有客户端位于远程主机上(例如,用于联网/共享的打印服务器);

  • 您还可能有客户端位于服务器主机本身上(因此本地应用程序也可以打印)。

很显然,您既不想为远程客户端编写打印服务器,又不想编写单独的打印文件-本地客户的服务器。因此,如果体系结构或中间件允许设计可被远程客户端(远程RPC )和本地客户端( local RPC )分别使用的打印服务器,那就更好了。 。

Obviously, you don't want to write both an print-server for remote clients and a separate print-server for local clients. Thus, it is far better if the architecture or middleware allows for designing a print server that can be used indifferently by remote clients (remote RPC) and local clients (local RPC).

这时,体系结构或中间件确保了本地客户端和远程客户端的通用接口:在实践中如何实现进程间通信必须完全透明给应用程序开发人员。

At this point, the architecture or middleware ensures a common interface both for local clients and for remote clients: how inter-process communication is achieved in practice must be made fully transparent to the application developer.

但是,对于远程客户端和本地客户端使用相同的进程间通信技术可能效率不高。因此,当服务器和客户端位于同一主机上时,RPC体系结构实现某种优化以优化性能是相当普遍的。从本质上讲,此优化与以下事实非常相似:本地网络通信使用本地环路,而不是在主机和网卡之间来回移动。

However, using the same inter-process communication technology both for remote clients and for local clients may be inefficient. Thus, it is fairly common for the RPC architecture to implement some kind of optimization so as to optimize performance when the server and the client are located on the same host. In spirit, this optimization is very similar to the fact that local network communication use the local loop rather than going back and forth between the host and the network card.

轻量级RPC 是一种这样的解决方案(并非唯一),它可以优化本地客户端的RPC性能。在RPC体系结构中实现此优化后:

Lightweight RPC is one such solution (it is not the only one) allowing for optimizing RPC performance for local clients. When this optimization is implemented into the RPC architecture:


  • 可以为本地客户端和远程客户端提供相同的RPC接口:


  • 应用程序开发人员不必处理某些客户端在其他客户端可能处于远程状态时可能是本地客户端的问题;

  • RPC体系结构在幕后调用中进行了优化到本地服务器,这样本地客户端就不会受到某些远程IPC技术的不利影响,而该技术对于本地通信而言并不是最佳选择。

这篇关于LRPC的意义是什么?为什么有人要对同一台计算机进行远程过程调用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆