RE: ejb performance

2000-12-16 Thread Savotchkin Egor

Yes, of course:



Pay attention to use write location in your code, f.ex. I use jdbc/CBOSS to
locate the datasource since it is the place where pooled datasources are
stored by orion.

Regards,
   Savotchkin Egor

Web-technologies department
eMail: [EMAIL PROTECTED]
CJSC "SoftPro" - Billing systems
tel: (+7-095) 755-5655 (3135)
web-site: http://www.cboss.ru


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Marcus Lankenau
Sent: Saturday, December 16, 2000 6:30 PM
To: Orion-Interest
Subject: Re: ejb performance


Hi Savotchkin!

Could you please describe, what you did to activate pooling? I tried this
for
my application, but without success... (could you maybe post you datasource
xml?)

thx in advance
Marcus Lankenau

> Yeah!!! I forgot that in this function I got not pooled db connection. So,
> after I turned the pooling on it became 0 to 10 ms (on PIII 600 with 256
> RAM) to invoke this function!!! Great indexes!!
> So given these numbers I may throw away all these transaction attributes
> and f.ex. always specify requires, since it doesnot affect perfomance...
>
> Regards,
>Savotchkin Egor
>
> Web-technologies department
> eMail: [EMAIL PROTECTED]
> CJSC "SoftPro" - Billing systems
> tel: (+7-095) 755-5655 (3135)
> web-site: http://www.cboss.ru
>

--
begin:vcard
n:Lankenau;Marcus
x-mozilla-html:FALSE
url:wwl.de
org:wwl vision2market;Interactive
adr:;;goebelstr. 46;Lilienthal;D;28865;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Senior Developer
fn:Marcus Lankenau
end:vcard






Re: ejb performance

2000-12-16 Thread Marcus Lankenau

Hi Savotchkin!

Could you please describe, what you did to activate pooling? I tried this for 
my application, but without success... (could you maybe post you datasource 
xml?)

thx in advance
Marcus Lankenau

> Yeah!!! I forgot that in this function I got not pooled db connection. So,
> after I turned the pooling on it became 0 to 10 ms (on PIII 600 with 256
> RAM) to invoke this function!!! Great indexes!!
> So given these numbers I may throw away all these transaction attributes
> and f.ex. always specify requires, since it doesnot affect perfomance...
>
> Regards,
>Savotchkin Egor
>
> Web-technologies department
> eMail: [EMAIL PROTECTED]
> CJSC "SoftPro" - Billing systems
> tel: (+7-095) 755-5655 (3135)
> web-site: http://www.cboss.ru
>

-- 
begin:vcard 
n:Lankenau;Marcus
x-mozilla-html:FALSE
url:wwl.de
org:wwl vision2market;Interactive
adr:;;goebelstr. 46;Lilienthal;D;28865;
version:2.1
email;internet:[EMAIL PROTECTED]
title:Senior Developer
fn:Marcus Lankenau
end:vcard




RE: ejb performance

2000-12-16 Thread Savotchkin Egor

Yeah!!! I forgot that in this function I got not pooled db connection. So,
after I turned the pooling on it became 0 to 10 ms (on PIII 600 with 256
RAM) to invoke this function!!! Great indexes!!
So given these numbers I may throw away all these transaction attributes and
f.ex. always specify requires, since it doesnot affect perfomance...

Regards,
   Savotchkin Egor

Web-technologies department
eMail: [EMAIL PROTECTED]
CJSC "SoftPro" - Billing systems
tel: (+7-095) 755-5655 (3135)
web-site: http://www.cboss.ru


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Robert Krueger
Sent: Saturday, December 16, 2000 2:57 PM
To: Orion-Interest
Subject: Re: ejb performance


At 14:28 16.12.00 , you wrote:
>Hi all!
> I made some tests to find out how transactions affect
> performance. I called
>a sessionless' ejb empty function with different transaction attributes. It
>turned out that call time mean was about 250 ms and it almost not changed
>depending on attributesn (Requires, supports, ...). So, does transactions
>have so little impact on perfomance???
> Why it takes about 250ms to invoke an empty function on ejb? Is
> it because
>ejb are distrubuted objects? What else could affect the ejb performance?
>
>Regards,
>Savotchkin Egor

you must have made a mistake 250ms is ridiculously slow. that's 4 calls per
sec please check your setup. this doesn't reflect our observations at
all. even with transactions that's way too slow or are you by any chance
using a 386 with 4 Meg RAM and a nojit VM ;-)).

regards,

robert

>Web-technologies department
>eMail: [EMAIL PROTECTED]
>CJSC "SoftPro" - Billing systems
>tel: (+7-095) 755-5655 (3135)
>web-site: http://www.cboss.ru
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de







Re: ejb performance

2000-12-16 Thread Robert Krueger

At 14:28 16.12.00 , you wrote:
>Hi all!
> I made some tests to find out how transactions affect 
> performance. I called
>a sessionless' ejb empty function with different transaction attributes. It
>turned out that call time mean was about 250 ms and it almost not changed
>depending on attributesn (Requires, supports, ...). So, does transactions
>have so little impact on perfomance???
> Why it takes about 250ms to invoke an empty function on ejb? Is 
> it because
>ejb are distrubuted objects? What else could affect the ejb performance?
>
>Regards,
>Savotchkin Egor

you must have made a mistake 250ms is ridiculously slow. that's 4 calls per 
sec please check your setup. this doesn't reflect our observations at 
all. even with transactions that's way too slow or are you by any chance 
using a 386 with 4 Meg RAM and a nojit VM ;-)).

regards,

robert

>Web-technologies department
>eMail: [EMAIL PROTECTED]
>CJSC "SoftPro" - Billing systems
>tel: (+7-095) 755-5655 (3135)
>web-site: http://www.cboss.ru
>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





RE: EJB Performance Question.

2000-11-15 Thread Gerald Gutierrez

At 10:11 AM 11/15/2000 +0100, you wrote:
>At 14:48 14.11.00 , you wrote:
>
>>Thanks Robert.  I think I'll try running some
>>benchmarks this week and post the results.  I wonder..
>>is there a way for and EJB->EJB to be _forced_ to
>>go through RMI?  i.e. can I turn this optimization
>>off?
>
>I don't think there is a documented way to to this.

Not to be a jerk but to provide some constructive criticism to Orion ... I 
don't think there is a documented way to do many, many things. Considering 
that it is a closed-source product, I think documentation should be one of 
the most important things to accompany the actual binaries.





RE: EJB Performance Question.

2000-11-15 Thread Tim Drury


The idea behind a bulk accessor is to return a single
object that holds all the data of your EJB.

(Forgive me for any syntax mistakes.  I'm doing this
from heart and I've done so much EJB2.0 stuff that my
1.1 is a little rusty.)

If you have an EJB like this:

public class FooEJB implements EntityBean
{
   public String data1;
   public String data2;
   public int data3;
   ...

   // this is a bulk accessor
   public FooView getFoo()
   {
  return new FooView(data1, data2, data3);
   }
}

You would create a "view" object that can hold all
the EJB data.  A view is a very thin "bean-like"
object:

public class FooView
{
   String data1;
   String data2;
   int data3;

   public String getData1() { return data1; }
   public String getData2() { return data2; }
   public int getData3() { return data3; }

   public FooView(String data1, String data2, int data3)
   {
  this.data1 = data1;
  this.data2 = data2;
  this.data3 = data3;
   }
}

Now you client only need to call:

   FooView fv = fooejb.getFooView();

to get all the data within the Foo EJB.  This reduces
the RMI marshalling to a single call.  Then, you use
the FooView accessors to get to the data; since FooView
is a local object, this will be fast.

NOTE: if you followed this thread, you heard from others
that Orion optimizes intra-VM EJB calls to "call-by-value"
which doesn't use RMI.  This is great for Orion, but is
not specified in the spec, so if you were to port your
application to another container, you aren't guaranteed
this optimization.  The above bulk accessor/View pattern
will always work.

-tim



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 7:04 PM
To: Orion-Interest
Subject: Re: EJB Performance Question.


Thank You for your kind reply. Can I get some pseudo-code an example?

Thank you.
- Original Message -
From: Tim Drury
To: Orion-Interest
Sent: Wednesday, November 15, 2000 12:03 AM
Subject: RE: EJB Performance Question.


Every single one of those calls to dir.getXXX() has to go across
the network via RMI.  This is slow.  You are better off using a
bulk accessor pattern.  For example, create a new class called
DirView which contains all the attributes of your Dir EJB.  Then
make a single call to the Dir EJB to get a DirView.  This will cause
only 1 RMI call and save you a huge amount of time.

Do you understand?  I can probably pseudo-code an example
if necessary.

-tim


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 3:56 AM
To: Orion-Interest
Subject: EJB Performance Question.


Hi, every one. First i'm sorry for my english.

We use servlet that call EJB. Next is code fraction.

//---
public Vector findByFirstPage(DirHome home, Integer rowCount) throws
Exception{

  Vector rows  = new Vector();
  Dir dir = null;

  System.out.println("step 11 time : " + (new java.util.Date()));

  // call EJB
  Collection col = home.findByFirstPage(rowCount.intValue());
  Iterator iter = col.iterator();

  System.out.println("step 12 time : " + (new java.util.Date()));

  while(iter.hasNext()) {
dir = (Dir)iter.next();
rows.add(EJBToRow(dir)); //<---  bottle neck #
  }

  System.out.println("step 13 time : " + (new java.util.Date()));

  return rows;

 }
 //---


Simple code. In while loop, EJBToRow() method take 3 second each call.

Next code is EJBToRow(). Very Simple. Only call EJB Meber methods.

 //---
 public Vector EJBToRow(Dir dir) throws Exception {

  Vector row = new Vector();

System.out.println("step 21 time : " + (new java.util.Date()));

  row.add(dir.getId());
  row.add(new Long(dir.getPId()));
  row.add(dir.getName());
  row.add(new Long(dir.getSerial()));
  row.add(new Long(dir.getChildCount()));
  row.add(new Long(dir.getDepth()));
  row.add(dir.getPMap());
  row.add(dir.getType());
  row.add(dir.getUserId());
  row.add(dir.getGroupId());
  row.add(dir.getOwnerPermR());
  row.add(dir.getOwnerPermW());
  row.add(dir.getOwnerPermX());
  row.add(dir.getGroupPermR());
  row.add(dir.getGroupPermW());
  row.add(dir.getGroupPermX());
  row.add(dir.getOtherPermR());
  row.add(dir.getOtherPermW());
  row.add(dir.getOtherPermX());
  row.add(dir.getCreateDate());
  row.add(dir.getUpdateDate());
  row.add(dir.getExpireDate());
  row.add(dir.getRemark());

System.out.println("step 22 time : " + (new java.util.Date()));

  return row;

 }
 //---

What's the key problem?












e-mail
site: [EMAIL PROTECTED]
: www.javanuri.comÀüÈ­
mobile : 02-6257-3002
: 019-255-2855





RE: EJB Performance Question.

2000-11-15 Thread Robert Krueger

At 14:48 14.11.00 , you wrote:

>Thanks Robert.  I think I'll try running some
>benchmarks this week and post the results.  I wonder..
>is there a way for and EJB->EJB to be _forced_ to
>go through RMI?  i.e. can I turn this optimization
>off?

I don't think there is a documented way to to this.

robert

>-tim
>
>
> > -Original Message-
> > From: Robert Krueger [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, November 14, 2000 1:36 PM
> > To: Orion-Interest
> > Subject: RE: EJB Performance Question.
> >
> >
> > At 12:06 14.11.00 , you wrote:
> > > > At 10:03 14.11.00 , you wrote:
> > > > >Every single one of those calls to dir.getXXX() has to go across
> > > > >the network via RMI.  This is slow.  You are better off using a
> > > >
> > > > well, with orion this is intra-vm so its not that bad ...
> > >
> > >Is there proof that Orion does this?  I'm not trying to be a jerk,
> > >but I'd like to see some numbers on how long a set/get takes for
> > >a client-to-ejb call and an ejb-to-ejb (same vm) call.
> >
> > do a getClass().getName() on your ejbobject. will be the same
> > wrapper class
> > that implements the ejbobject (if you look into the generate
> > code that's
> > temporarily there on deployment).
> >
> > anyway, I've never benchmarked but it is orders of magnitude
> > faster than
> > any rmi stack I've seen. I think there's even an old mail in
> > the archive
> > from karl that confirms this otiomization because it was one
> > of the first
> > things I asked (must at least be 10 months ago now).
> >
> > regards,
> >
> > robert
> >
> > >Not even Weblogic optimizes to pass-by-value for intra-vm ejb
> > >
> > >calls.  You have to use TopLink to get that optimization.
> > >Funny though, Weblogic provides a tag in their deployment
> > >description but it doesn't do anything.
> > >
> > >-tim
> >
> > (-) Robert Krüger
> > (-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
> > (-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
> > (-) Tel: 06151 665401, Fax: 06151 665373
> > (-) [EMAIL PROTECTED], www.signal7.de
> >
> >

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





Re: EJB Performance Question.

2000-11-14 Thread 김철회



Thank You for your kind reply. Can I get some pseudo-code an example? 
 
Thank you.

  - Original Message - 
  From: Tim Drury 
  
  To: Orion-Interest 
  Sent: Wednesday, November 15, 2000 12:03 
  AM
  Subject: RE: EJB Performance Question.
  
  Every single one of those calls to dir.getXXX() has to go 
  across
  the 
  network via RMI.  This is slow.  You are better off using 
  a
  bulk 
  accessor pattern.  For example, create a new class 
  called
  DirView which contains all the attributes of your Dir EJB.  
  Then
  make 
  a single call to the Dir EJB to get a DirView.  This will 
  cause
  only 
  1 RMI call and save you a huge amount of time.
   
  Do 
  you understand?  I can probably pseudo-code an 
example
  if 
  necessary.
   
  -tim
   
   
  
-Original Message-From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 14, 2000 
3:56 AMTo: Orion-InterestSubject: EJB Performance 
Question.
Hi, every one. First i'm sorry for my 
english.
 
We use servlet that call EJB. Next is code 
fraction.
 
//---
public Vector findByFirstPage(DirHome home, Integer 
rowCount) throws Exception{   Vector 
rows  = new Vector();  Dir dir = 
null;
 
  System.out.println("step 11 time : " + (new 
java.util.Date()));    
   // call 
EJB  Collection col = 
home.findByFirstPage(rowCount.intValue());  Iterator iter = 
col.iterator();
 
  System.out.println("step 12 time : " + (new 
java.util.Date()));    
 while(iter.hasNext()) {    
dir = (Dir)iter.next();    rows.add(EJBToRow(dir)); 
//<---  bottle neck 
#  }    System.out.println("step 13 
time : " + (new java.util.Date()));    
   return 
rows;   } 
 //---
 
 
Simple code. In while loop, EJBToRow() method take 3 
second each call.
 
Next code is EJBToRow(). Very Simple. Only call EJB Meber 
methods. 
 

 //---
 public Vector EJBToRow(Dir dir) throws Exception 
{   Vector row = new Vector();
 
System.out.println("step 21 time : " + (new 
java.util.Date()));    
 row.add(dir.getId());  row.add(new 
Long(dir.getPId()));  row.add(dir.getName());  row.add(new 
Long(dir.getSerial()));  row.add(new 
Long(dir.getChildCount()));  row.add(new 
Long(dir.getDepth()));  row.add(dir.getPMap());  row.add(dir.getType());  row.add(dir.getUserId());  row.add(dir.getGroupId());  row.add(dir.getOwnerPermR());  row.add(dir.getOwnerPermW());  row.add(dir.getOwnerPermX());  row.add(dir.getGroupPermR());  row.add(dir.getGroupPermW());  row.add(dir.getGroupPermX());  row.add(dir.getOtherPermR());  row.add(dir.getOtherPermW());  row.add(dir.getOtherPermX());  row.add(dir.getCreateDate());  row.add(dir.getUpdateDate());  row.add(dir.getExpireDate());  row.add(dir.getRemark());
 
System.out.println("step 22 time : " + (new 
java.util.Date()));    
   return 
row;   }

 //---
 
What's the key problem?
 
 
 
 
 
 
 
 
 




  
  

  e-mail 
  site

  : [EMAIL PROTECTED] 
  
  : 
  www.javanuri.com

  ÀüÈ­
  mobile 

  : 02-6257-3002
  : 019-255-2855
  
 
 
 
 
  

  
  

  


 


RE: EJB Performance Question.

2000-11-14 Thread Tim Drury


Thanks Robert.  I think I'll try running some
benchmarks this week and post the results.  I wonder..
is there a way for and EJB->EJB to be _forced_ to
go through RMI?  i.e. can I turn this optimization
off?

-tim


> -Original Message-
> From: Robert Krueger [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 14, 2000 1:36 PM
> To: Orion-Interest
> Subject: RE: EJB Performance Question.
> 
> 
> At 12:06 14.11.00 , you wrote:
> > > At 10:03 14.11.00 , you wrote:
> > > >Every single one of those calls to dir.getXXX() has to go across
> > > >the network via RMI.  This is slow.  You are better off using a
> > >
> > > well, with orion this is intra-vm so its not that bad ...
> >
> >Is there proof that Orion does this?  I'm not trying to be a jerk,
> >but I'd like to see some numbers on how long a set/get takes for
> >a client-to-ejb call and an ejb-to-ejb (same vm) call.
> 
> do a getClass().getName() on your ejbobject. will be the same 
> wrapper class 
> that implements the ejbobject (if you look into the generate 
> code that's 
> temporarily there on deployment).
> 
> anyway, I've never benchmarked but it is orders of magnitude 
> faster than 
> any rmi stack I've seen. I think there's even an old mail in 
> the archive 
> from karl that confirms this otiomization because it was one 
> of the first 
> things I asked (must at least be 10 months ago now).
> 
> regards,
> 
> robert
> 
> >Not even Weblogic optimizes to pass-by-value for intra-vm ejb
> >
> >calls.  You have to use TopLink to get that optimization.
> >Funny though, Weblogic provides a tag in their deployment
> >description but it doesn't do anything.
> >
> >-tim
> 
> (-) Robert Krüger
> (-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
> (-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
> (-) Tel: 06151 665401, Fax: 06151 665373
> (-) [EMAIL PROTECTED], www.signal7.de
> 
> 




RE: EJB Performance Question.

2000-11-14 Thread Mike Clark

If you're referring to the enable-call-by-reference tag, then indeed it
does do something (at lease in version 5.1).  Setting this tag to true
will effectively pass EJB method arguments and returned objects by
reference when called within the same JVM, rather than by value in
accordance with the EJB 1.1 specification.  This obviously increases
performance by eliminating the marshalling overhead, at the cost of
being non-spec compliant.

At any rate, for better or worse, in WebLogic call by reference is
enabled by default.  In other words, calls between servlets and EJBs in
the same JVM are optimized.

That said, don't let these optimizations pollute your EJB design. 
Having a well-defined and minimal remote contract is much more
portable, and generally easier to maintain and manage.  Moreover, you
may at some point in the future decide to separate the web server and
EJB container into separate JVMs. In general, EJB interface contracts
are specifically important to design correctly, as the invocation of
remote methods may in turn provoke life cycle methods, transactions,
etc.  

Mike


--- Tim Drury <[EMAIL PROTECTED]> wrote:
> > At 10:03 14.11.00 , you wrote:
> > >Every single one of those calls to dir.getXXX() has to go across
> > >the network via RMI.  This is slow.  You are better off using a
> > 
> > well, with orion this is intra-vm so its not that bad ...
> 
> Is there proof that Orion does this?  I'm not trying to be a jerk,
> but I'd like to see some numbers on how long a set/get takes for
> a client-to-ejb call and an ejb-to-ejb (same vm) call.
> 
> Not even Weblogic optimizes to pass-by-value for intra-vm ejb
> calls.  You have to use TopLink to get that optimization.
> Funny though, Weblogic provides a tag in their deployment 
> description but it doesn't do anything.
> 
> -tim
> 
> 
> 
> 


__
Do You Yahoo!?
Yahoo! Calendar - Get organized for the holidays!
http://calendar.yahoo.com/




RE: EJB Performance Question.

2000-11-14 Thread Robert Krueger

At 12:06 14.11.00 , you wrote:
> > At 10:03 14.11.00 , you wrote:
> > >Every single one of those calls to dir.getXXX() has to go across
> > >the network via RMI.  This is slow.  You are better off using a
> >
> > well, with orion this is intra-vm so its not that bad ...
>
>Is there proof that Orion does this?  I'm not trying to be a jerk,
>but I'd like to see some numbers on how long a set/get takes for
>a client-to-ejb call and an ejb-to-ejb (same vm) call.

do a getClass().getName() on your ejbobject. will be the same wrapper class 
that implements the ejbobject (if you look into the generate code that's 
temporarily there on deployment).

anyway, I've never benchmarked but it is orders of magnitude faster than 
any rmi stack I've seen. I think there's even an old mail in the archive 
from karl that confirms this otiomization because it was one of the first 
things I asked (must at least be 10 months ago now).

regards,

robert

>Not even Weblogic optimizes to pass-by-value for intra-vm ejb
>
>calls.  You have to use TopLink to get that optimization.
>Funny though, Weblogic provides a tag in their deployment
>description but it doesn't do anything.
>
>-tim

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





RE: EJB Performance Question.

2000-11-14 Thread Tim Drury

> At 10:03 14.11.00 , you wrote:
> >Every single one of those calls to dir.getXXX() has to go across
> >the network via RMI.  This is slow.  You are better off using a
> 
> well, with orion this is intra-vm so its not that bad ...

Is there proof that Orion does this?  I'm not trying to be a jerk,
but I'd like to see some numbers on how long a set/get takes for
a client-to-ejb call and an ejb-to-ejb (same vm) call.

Not even Weblogic optimizes to pass-by-value for intra-vm ejb
calls.  You have to use TopLink to get that optimization.
Funny though, Weblogic provides a tag in their deployment 
description but it doesn't do anything.

-tim




RE: EJB Performance Question.

2000-11-14 Thread Robert Krueger

At 10:03 14.11.00 , you wrote:
>Every single one of those calls to dir.getXXX() has to go across
>the network via RMI.  This is slow.  You are better off using a

well, with orion this is intra-vm so its not that bad ...

>bulk accessor pattern.  For example, create a new class called

.. although a bulk accessor is generally a good thing to use in such 
situations.

have you tried wrapping one usertransaction around your update operation or 
maybe even around the entire loop, depending on what you want to see as a 
transaction. this will improve performance significantly because you don't 
have all the tx overhead. if you don't know what a usertransaction is, read 
up on JTA.

HTH

robert

>DirView which contains all the attributes of your Dir EJB.  Then
>make a single call to the Dir EJB to get a DirView.  This will cause
>only 1 RMI call and save you a huge amount of time.
>
>Do you understand?  I can probably pseudo-code an example
>if necessary.
>
>-tim
>
>
>>-Original Message-
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, November 14, 2000 3:56 AM
>>To: Orion-Interest
>>Subject: EJB Performance Question.
>>
>>Hi, every one. First i'm sorry for my english.
>>
>>We use servlet that call EJB. Next is code fraction.
>>
>>//---
>>public Vector findByFirstPage(DirHome home, Integer rowCount) throws 
>>Exception{
>>
>>   Vector rows  = new Vector();
>>   Dir dir = null;
>>
>>   System.out.println("step 11 time : " + (new java.util.Date()));
>>
>>   // call EJB
>>   Collection col = home.findByFirstPage(rowCount.intValue());
>>   Iterator iter = col.iterator();
>>
>>   System.out.println("step 12 time : " + (new java.util.Date()));
>>
>>   while(iter.hasNext()) {
>> dir = (Dir)iter.next();
>> rows.add(EJBToRow(dir)); //<---  bottle neck #
>>   }
>>
>>   System.out.println("step 13 time : " + (new java.util.Date()));
>>
>>   return rows;
>>
>>  }
>>  //---
>>
>>
>>Simple code. In while loop, EJBToRow() method take 3 second each call.
>>
>>Next code is EJBToRow(). Very Simple. Only call EJB Meber methods.
>>
>>  //---
>>  public Vector EJBToRow(Dir dir) throws Exception {
>>
>>   Vector row = new Vector();
>>
>>System.out.println("step 21 time : " + (new java.util.Date()));
>>
>>   row.add(dir.getId());
>>   row.add(new Long(dir.getPId()));
>>   row.add(dir.getName());
>>   row.add(new Long(dir.getSerial()));
>>   row.add(new Long(dir.getChildCount()));
>>   row.add(new Long(dir.getDepth()));
>>   row.add(dir.getPMap());
>>   row.add(dir.getType());
>>   row.add(dir.getUserId());
>>   row.add(dir.getGroupId());
>>   row.add(dir.getOwnerPermR());
>>   row.add(dir.getOwnerPermW());
>>   row.add(dir.getOwnerPermX());
>>   row.add(dir.getGroupPermR());
>>   row.add(dir.getGroupPermW());
>>   row.add(dir.getGroupPermX());
>>   row.add(dir.getOtherPermR());
>>   row.add(dir.getOtherPermW());
>>   row.add(dir.getOtherPermX());
>>   row.add(dir.getCreateDate());
>>   row.add(dir.getUpdateDate());
>>   row.add(dir.getExpireDate());
>>   row.add(dir.getRemark());
>>
>>System.out.println("step 22 time : " + (new java.util.Date()));
>>
>>   return row;
>>
>>  }
>>  //---
>>
>>What's the key problem?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>--
>>e-mail
>>site
>>: [EMAIL PROTECTED]
>>: www.javanuri.com
>>ÀüÈ­
>>mobile
>>: 02-6257-3002
>>: 019-255-2855
>>
>>
>>
>>--
>>

(-) Robert Krüger
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de





Re: EJB Performance Question.

2000-11-14 Thread Klaus Thiele

Hi ±èöȸ,


>  public Vector EJBToRow(Dir dir) throws Exception {
[...]
>   row.add(dir.getId());
>   row.add(new Long(dir.getPId()));
>   row.add(dir.getName());
>   row.add(new Long(dir.getSerial()));
>   row.add(new Long(dir.getChildCount()));
>   row.add(new Long(dir.getDepth()));
[...]

> What's the key problem?

thats not a problem, thats a feature!
(each remote call runs within an transaction...)

study all the EJB-docs you can get and redesign your app.

bye
klaus
--
Klaus Thiele - Personal & Informatik AG
mailto:[EMAIL PROTECTED]

"There's got to be more to life than compile-and-go."





RE: EJB Performance Question.

2000-11-14 Thread Tim Drury



Every 
single one of those calls to dir.getXXX() has to go across
the 
network via RMI.  This is slow.  You are better off using 
a
bulk 
accessor pattern.  For example, create a new class 
called
DirView which contains all the attributes of your Dir EJB.  
Then
make a 
single call to the Dir EJB to get a DirView.  This will 
cause
only 1 
RMI call and save you a huge amount of time.
 
Do you 
understand?  I can probably pseudo-code an example
if 
necessary.
 
-tim
 
 

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]Sent: Tuesday, November 14, 2000 3:56 
  AMTo: Orion-InterestSubject: EJB Performance 
  Question.
  Hi, every one. First i'm sorry for my english.
   
  We use servlet that call EJB. Next is code 
  fraction.
   
  //---
  public Vector findByFirstPage(DirHome home, Integer 
  rowCount) throws Exception{   Vector rows  = 
  new Vector();  Dir dir = null;
   
    System.out.println("step 11 time : " + (new 
  java.util.Date()));    
     // call 
  EJB  Collection col = 
  home.findByFirstPage(rowCount.intValue());  Iterator iter = 
  col.iterator();
   
    System.out.println("step 12 time : " + (new 
  java.util.Date()));    
   while(iter.hasNext()) {    
  dir = (Dir)iter.next();    rows.add(EJBToRow(dir)); 
  //<---  bottle neck 
  #  }    System.out.println("step 13 
  time : " + (new java.util.Date()));    
     return 
  rows;   } 
   //---
   
   
  Simple code. In while loop, EJBToRow() method take 3 second 
  each call.
   
  Next code is EJBToRow(). Very Simple. Only call EJB Meber 
  methods. 
   
  
   //---
   public Vector EJBToRow(Dir dir) throws Exception 
  {   Vector row = new Vector();
   
  System.out.println("step 21 time : " + (new 
  java.util.Date()));    
   row.add(dir.getId());  row.add(new 
  Long(dir.getPId()));  row.add(dir.getName());  row.add(new 
  Long(dir.getSerial()));  row.add(new 
  Long(dir.getChildCount()));  row.add(new 
  Long(dir.getDepth()));  row.add(dir.getPMap());  row.add(dir.getType());  row.add(dir.getUserId());  row.add(dir.getGroupId());  row.add(dir.getOwnerPermR());  row.add(dir.getOwnerPermW());  row.add(dir.getOwnerPermX());  row.add(dir.getGroupPermR());  row.add(dir.getGroupPermW());  row.add(dir.getGroupPermX());  row.add(dir.getOtherPermR());  row.add(dir.getOtherPermW());  row.add(dir.getOtherPermX());  row.add(dir.getCreateDate());  row.add(dir.getUpdateDate());  row.add(dir.getExpireDate());  row.add(dir.getRemark());
   
  System.out.println("step 22 time : " + (new 
  java.util.Date()));    
     return 
  row;   }
  
   //---
   
  What's the key problem?
   
   
   
   
   
   
   
   
   
  
  
  
  


  
e-mail 
site
  
: [EMAIL PROTECTED] 

: 
www.javanuri.com
  
ÀüÈ­
mobile 
  
: 02-6257-3002
: 019-255-2855

   
   
   
   

  


  

  

   


RE: EJB Performance Question.

2000-11-14 Thread Juan Lorandi (Chile)



you're 
abusing OOP here
simplify your code

  -Original Message-From: [EMAIL PROTECTED] 
  [mailto:[EMAIL PROTECTED]]Sent: Martes, 14 de Noviembre de 2000 
  5:56To: Orion-InterestSubject: EJB Performance 
  Question.
  Hi, every one. First i'm sorry for my english.
   
  We use servlet that call EJB. Next is code 
  fraction.
   
  //---
  public Vector findByFirstPage(DirHome home, Integer 
  rowCount) throws Exception{   Vector rows  = 
  new Vector();  Dir dir = null;
   
    System.out.println("step 11 time : " + (new 
  java.util.Date()));    
     // call 
  EJB  Collection col = 
  home.findByFirstPage(rowCount.intValue());  Iterator iter = 
  col.iterator();
   
    System.out.println("step 12 time : " + (new 
  java.util.Date()));    
   while(iter.hasNext()) {    
  dir = (Dir)iter.next();    rows.add(EJBToRow(dir)); 
  //<---  bottle neck 
  #  }    System.out.println("step 13 
  time : " + (new java.util.Date()));    
     return 
  rows;   } 
   //---
   
   
  Simple code. In while loop, EJBToRow() method take 3 second 
  each call.
   
  Next code is EJBToRow(). Very Simple. Only call EJB Meber 
  methods. 
   
  
   //---
   public Vector EJBToRow(Dir dir) throws Exception 
  {   Vector row = new Vector();
   
  System.out.println("step 21 time : " + (new 
  java.util.Date()));    
   row.add(dir.getId());  row.add(new 
  Long(dir.getPId()));  row.add(dir.getName());  row.add(new 
  Long(dir.getSerial()));  row.add(new 
  Long(dir.getChildCount()));  row.add(new 
  Long(dir.getDepth()));  row.add(dir.getPMap());  row.add(dir.getType());  row.add(dir.getUserId());  row.add(dir.getGroupId());  row.add(dir.getOwnerPermR());  row.add(dir.getOwnerPermW());  row.add(dir.getOwnerPermX());  row.add(dir.getGroupPermR());  row.add(dir.getGroupPermW());  row.add(dir.getGroupPermX());  row.add(dir.getOtherPermR());  row.add(dir.getOtherPermW());  row.add(dir.getOtherPermX());  row.add(dir.getCreateDate());  row.add(dir.getUpdateDate());  row.add(dir.getExpireDate());  row.add(dir.getRemark());
   
  System.out.println("step 22 time : " + (new 
  java.util.Date()));    
     return 
  row;   }
  
   //---
   
  What's the key problem?
   
   
   
   
   
   
   
   
   
  
  
  
  


  
e-mail 
site
  
: [EMAIL PROTECTED] 

: 
www.javanuri.com
  
ÀüÈ­
mobile 
  
: 02-6257-3002
: 019-255-2855

   
   
   
   

  


  

  

   


Re: EJB performance

2000-03-21 Thread Karl Avedal

Hello,

Note that when using BMP Entity beans a request is made to the db for every bean
(no select * from...). This makes getting a large number of BMP entity beans
remarkably slow,

however, your test seems awfully slow even considering that so we will do some
more internal benchmarking to see if we find it to be very slow due to some bug.

Regards,
Karl Avedal

Jens Stutte wrote:

> Hi,
>
> i made some tests regarding the EJB performance. Well... i know it's still
> beta, and EJB is never lightning fast. But are you expecting some serious
> improvements of performance with the release version ? Not to get me wrong,
> i like the product and so on (and i know it's a general problem for EJB
> servers, too). Well, here are some facts:
>
> I have an entity bean (bean managed), with 4737 instances. After restarting
> the server, a findAll and a call of one business-get method (so that it must
> be instanciated) from a remote client of these take aprox. 160 s (orion
> 0.9.4 on an Athlon 600 Linux box with 256 MB, Classic VM, build 1.2.2-L,
> green threads, javacomp), that means ca. 33 ms per bean. To obtain this
> result, i optimized the retrieving of DB connections with a cache to not
> connect newly to the DB for every bean. The transaction type of all involved
> methods is "required" (as usual). Memory is no matter since memory usage of
> the server only grows by 12MB. There is no other application running. These
> 160s of CPU time are consumed almost all by the orion server, the DB server
> (informix) uses less than 1% of the time. And the CPU usage is at 100% all
> the time (so there is no lock or waiting for ports/network or similar). Of
> course this is not representive and others are welcome to post me their
> results. But to me it seems pretty much to guarantee a good response time in
> a production system (and the used server should be sufficient for a - small
> - production system, at least with another 256 MB of DRAM). Just for my
> curiousity: What process in instanciating an entity bean is such complex
> that it takes so much time? I know, the logic is very complex (with
> transactions and so on), but it seems pretty linear to me (correct me, if
> i'm wrong). If it's for me, i'd prefer much more memory consumption, if it
> helps the performance...
>
> Any suggestions on improving the performance are very appreciated, best
> regrads and keep on the good work,
>
> Jens Stutte
>
> 
> [EMAIL PROTECTED], http://www.net-media.de
>
> NetMedia GmbH
> Schubertstr. 8
> 66111 Saarbruecken
> Germany
>
> fon: +49 (0) 681 - 37 98 80
> fax: +49 (0) 681 - 33 89 3
>
>