users@glassfish.java.net

Re: Why are Remote method calls so expensive?

From: <glassfish_at_javadesktop.org>
Date: Thu, 24 Jan 2008 08:18:07 PST

I deploy the WAR(s) seperately because it gives me finer control over deployment. It lets me make changes and update one aspect of the overall system without redeploying the entire system. It also speed development by just being able to redeploy the WAR that I'm working on instead of the entire deployment.

I did some testing. First, I tried implementing Externalizable on my core class. It was a very naive implementation that simply did a writeObject on everything. No real surprise, but this didn't do much. But it did show me getting the OOM error within my write method.

So what I did next was rather than return the List of objects, I instead serialized it on the server to a byte array, returned THAT, and then deserialized on the client.

This had two benefits.

1) It eliminated my memory spike. On a fresh server the spike goes from over 200M down to 30M. On a running server (after a redeploy), it seems to be a larger surge (40-50M). But it all GC's in the end.

2) It's 5 times faster this way. The old way took 25s the new way took 5s.

I'm fine with this solution, as it's a specific pain point within the system (I've been casually looking at ways to kill that 25s for a while now). Of course, I'm disheartened that I had to do this myself.

I suspect it's the "fault" of the CORBA IIOP protocol that I believe is used for remote EJBs. I recall waaay back trying an experiment with Weblogic where I switched from their internal T3 (I think) protocol to CORBA. We had a similar situation that downloaded a large blob of data for caching on the web tier. The CORBA version was MUCH slower than T3. Thankfully we were eventually able to make T3 work for us.

Is there any thought in adding a proprietary but more efficient protocol for Remote EJBs to GF much in the spirit of Weblogics T3? Or has the drive toward web services put a stake in the heart of the Remote EJB problem space? (If I had the time I'd send this blob over a web service just to see what happens, alas I don't. I'd like to think it would not be pretty.)
[Message sent by forum member 'whartung' (whartung)]

http://forums.java.net/jive/thread.jspa?messageID=255621