Skip to main content

Glassfish IIOP performance problem

3 replies [Last post]
ztangm
Offline
Joined: 2010-06-13
Points: 0

I am experiencing some strange performance problem, probably related somehow to IIOP/Corba.

I am retrieving some objects from the server by some standalone client, which does a lookup on the InitialContext. It retrieves around 10k objects. I added time measuring in some AroundInvoke interceptor (the outer-most I have) and it takes 10s on the server side. On the client side it takes 18s to retrieve the data.

Initially I was thinking it is just too many objects, so for testing I serialized them into an object stream and read them back of that object stream again. This takes just 2s, the size of the serialized objects is 2MB.

10s for the server, 18s for the client and just 2s for serialize/deserialize. There are 6s missing! Any ideas welcome!

Client and server are on the same machine in my setup, so there is no network communication. I am using glassfish v3.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hvilekar
Offline
Joined: 2006-10-06
Points: 0

In addition to serialization / de-serialization, there are other
overheads like ORB initialization, GIOP protocol overheads - including
message fragmentation if the data size is more than 4K, Object waits on
the socket listener thread etc. Did you try performance profiling the
client's VM to get more insight on where the time is being spent ?

On 08/17/2012 11:30 AM, forums@java.net wrote:
> I am experiencing some strange performance problem, probably related
> somehow
> to IIOP/Corba. I am retrieving some objects from the server by some
> standalone client, which does a lookup on the InitialContext. It
> retrieves
> around 10k objects. I added time measuring in some AroundInvoke
> interceptor
> (the outer-most I have) and it takes 10s on the server side. On the
> client
> side it takes 18s to retrieve the data. Initially I was thinking it is
> just
> too many objects, so for testing I serialized them into an object
> stream and
> read them back of that object stream again. This takes just 2s, the
> size of
> the serialized objects is 2MB. 10s for the server, 18s for the client and
> just 2s for serialize/deserialize. There are 6s missing! Any ideas
> welcome!
> Client and server are on the same machine in my setup, so there is no
> network
> communication. I am using glassfish v3.
>
> --
>
> [Message sent by forum member 'ztangm']
>
> View Post: http://forums.java.net/node/889314
>
>

ztangm
Offline
Joined: 2010-06-13
Points: 0

Thanks for the hint. What would be your suggestion of how to profile that? Fetching the sources and stepping with a remote debugger through the code?

bdrx
Offline
Joined: 2012-08-30
Points: 0

You can use/attach the java profiler that comes with netbeans. See also jvisualvm.

I also have a similar issue using IIOP to connect to a glassfish jdbc datasource connection pool from a standalone client. The initial jndi datasource lookup time is unreasonably long (about 8 seconds) even though the client and glassfish are running on the same jvm. Is there any optimization or alternatives/workarounds to use a connection pool on glassfish from a standalone java application?
Right now we are just setting the -Dorg.omg.CORBA.ORBInitialPort flag and then creating an doing a lookup via new InitialContext().lookup()