[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Performance?
Hi!
Marcel Ruff wrote:
> > > I haven't tested your stuff, but the performance notes seems weird.
> > I've
> > > done some work on a message based application using RMI (=chat), and I
> > > managed to easily get a throughput of 15.000 messages per second. Your
> > > throughput of only 400 seems very low. Any ideas on why?
>
> Hi Rickard,
> nice to see you here, i am using your jboss EJB server now and then,
> it is an impressive piece of software.
Thanks :-) We are quite proud of our work, and it's always gratifying to
see that people appreciate it!
> 400 messages per second are 800 tcp/ip calls per second,
> that is because the message is sent to xmlBlaster and from there
> updated to a client again.
>
> But you are right, it is not a lot.
> I always thought that native socket would not be much faster,
> but your 15.000 messages is a lot more.
>
> I have no idea what eats up 14.200 messages when using RMI or CORBA.
No, my chat application used plain RMI ;-) Actually, I got 18.000
messages at peak (Athlon 650Mhz, 128Mb RAM).
> How where the conditions with your 15.000 messages (hardware, OS etc.)?
Riddle me this:
On a particularly sunny and inspiring day you write not one but two
letters of poetry to your lady friend. You put them both in the mailbox,
and by noon the postman empties the box. The following day another
postman in another town carry the two to your girlies house, so that she
may read your fine words.
The trick I use is described above.
This should be enough of a clue to help you see what you are missing. If
not, then the full details will be in my upcoming book "Mastering RMI"
(preorder now at Amazon) where the chat will be included with source and
explanation of both implementation, design, and architecture.
Good luck, and have fun :-) All there is is lessons, and real life is a
great teacher ;-)
> Rickard:
> ------------
> I just tried a simple getXy() method 500 times with JBOSS and J2EE EJB
> server:
>
> JBOSS does 62 requests per second
FWIW I get 300 requests per second if client is in a separate JVM, and
2500 requests per second if the client is in a servlet in the same JVM
(we have integrated the Tomcat servlet engine).
> Suns J2EE does 210 requests per second
>
> 210 messages is only a quarter of the xmlBlaster throughput (publish &
> update)
> I believe all the container code in the EJB server is degrading the
> performance, and the RMI call as well.
Yes. Note that jBoss does not yet have the performance fix I have
alluded to above. It will soon enough.
> The 62 requests per seconds of JBoss is strange, my EJbean looks like:
>
> getXy() {
> return xy;
> }
>
> JBoss does allways call ejbStore() which is a Oracle UPDATE call,
> i believe this consumes a lot of performance.
> But why does JBOSS call ejbStore() on a simple get method?
> (it is a bean managed entity bean)
ejbStore() is called at the end of a transaction. This is the EJB spec
rule. There are two ways to avoid it:
* In your BMP EntityBean you could have a flag "dirty" which you set to
true when state changes. In ejbStore you should check this flag and only
store if necessary.
* Convert your bean to a CMP one and use tuned updates. This will do the
above automatically.
* Convert your bean to a CMP one and keep a dirty flag and implement a
method "public boolean isModified()". jBoss will call it before it calls
"ejbStore" to test whether the state has changed or not.
The last one is done automatically by the code generated by my EJB tool
EJBDoclet, which you can find at dreambean.com/ejbdoclet.html
Hope this helps.
regards,
Rickard
--
Rickard Öberg
Email: rickard at telkel.com
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com