简体   繁体   English

Java EJB实体bean性能

[英]Java EJB entity beans performance

How performant is the entity bean? 实体bean的性能如何? Would it be too much to ask if I want 1000 objects per table (probably about 20 tables) across 5 processes where some processes might be changing the objects as often as 60 times a second? 问我是否要在5个进程中每个表1000个对象(可能大约20个表),而有些进程可能每秒频繁地更改对象60次?

Are there any resources out there on the limitations of the entity bean? 是否有关于实体bean限制的资源?

Thanks for any help! 谢谢你的帮助!

Performance is not really limited by the entities, but the JPA provider's implementation and your database. 性能实际上不受实体的限制,但JPA提供程序的实现和您的数据库会受到限制。

It's impossible to give performance estimation, because so many factors affect it: 进行性能估算是不可能的,因为有很多因素会影响性能估算:

  • JPA implementation JPA实施
  • JPA settings (like caching and batch writing) JPA设置(例如缓存和批处理写入)
  • Server hardware 服务器硬件
  • Network 网络
  • Database type 数据库类型
  • Database settings 数据库设置
  • Application server vendor 应用服务器供应商
  • Number of threads 线程数

etc. 等等

This test could give you some indication on performance of different JPA providers: 该测试可以给您一些有关不同JPA提供程序性能的指示:

http://terrazadearavaca.blogspot.com/2008/12/jpa-implementations-comparison.html http://terrazadearavaca.blogspot.com/2008/12/jpa-implementations-comparison.html

I have not tested the performance too much personally, but I measured one of my processes. 我个人没有对性能进行过多测试,但是我测量了我的流程之一。 It executes one query to each insert, and uses an Oracle database. 它对每个插入执行一个查询,并使用Oracle数据库。 It's running in one thread and is doing more than 250 inserts (+250 queries) per second. 它在一个线程中运行,并且每秒执行250次以上的插入(+250次查询)。 I would expect that using several threads the performance would be much better, but I have not so far had the need to try it. 我希望使用多个线程可以提高性能,但是到目前为止我还没有必要尝试一下。

Apart from the technical context, an important factor is you application's design. 除技术背景外,重要的因素是应用程序的设计。 A lot of early EJB applications suffered from horrendous performance because they carelessly used remote methods for everything, ie setting 5 attributes on a single EJB resulted in 5 network roundtrips. 许多早期的EJB应用程序遭受了可怕的性能折磨,因为它们不小心使用了远程方法来处理所有问题,即在单个EJB上设置5个属性导致5次网络往返。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM