并发使用作为 RMI 服务公开的 EJB
我构建了一个应用程序,它使用相同的 RMI 服务来模拟多个客户端。然后,每个客户端检索数据并将数据上传到服务器时同时调用该服务。我担心的是,如果每个删除调用都需要一些时间,远程服务实现(jBoss 5 EJB)是否可以远程处理这些调用,或者将它们序列化。
如果是后者,那么我必须限制客户端的数量,以防止减慢它们的速度。
I have built an application which simulates several clients using the same RMI service. This service is then invoked concurrently by every client retrieving and uploading data to the server. My concern is if every remove invocation takes some time does the remote service implementation (jBoss 5 EJB) can handle these calls remotely or it serializes them down.
If the latter is the case then I have to limit the number of clients to prevent slowing them down.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你到底是什么意思?
您的意思是有多个客户端,每个客户端都获取一个远程 EJB bean,然后调用它们收到的存根/代理上的方法,还是大量远程客户端共享一个代理?
我们谈论的是哪种 EJB bean?无状态会话 bean?
这些 bean 由服务器汇集,对于每个传入的远程方法调用它们,都会将一个实例分配给线程池中的工作线程。所以,是的,如果给定时间范围内的请求数量大于可用 bean 实例和工作线程的数量,那么这些多余的请求将不得不等待,直到 bean 变得可用。
因此,这是一种自动节流机制。
What exactly do you mean?
Do you mean that there are several clients who each obtain a remote EJB bean and then call a method on the stub/proxy they received, or do a large number of remote clients share a single proxy?
And what kind of EJB beans are we talking about? Stateless session beans?
These beans are pooled by the server and for each incoming remote method call to them, an instance is assigned to a worker thread from a thread pool. So yes, if the number of requests in a given time frame is larger then the number of available bean instances and worker threads, then those surplus requests will have to wait until a bean becomes available.
This is an automatic throttling mechanism thus.
除非远程方法实现执行某种同步,否则 RMI 调用不会按顺序进行。这适用于 RMI/JRMP 和 RMI/IIOP。
RMI calls are not sequentialized unless the remote method implementations perform synchronization of some kind. This applies to both RMI/JRMP and RMI/IIOP.