Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 10-07-2005
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Java Object Output Stream and Ice

Hello again,

We have been using Ice, IcePack, IceStorm, IceBox, and Freeze successfully now for over 2 years in a heterogenous (Java/C++, Unix/Windows), distributed environment and we love it! Thanks again for all the great work.

We just noticed a performance issue in legacy non-Ice Java code that uses ObjectOutputStream and ObjectInputStream objects to read and write across processes. It appears as though the consumer is not keeping up with the producer and conquently the producer process is blocking a lot. Classic problem. We had a similar problem in Ice using two-way proxies, but once we changed to one-way proxies, performance got a *lot* better.

I have been trying to find out the underlying protocol that Java Object Streams at javasoft.com, but to no avail. I assume its TCP/IP two-way protocol, but cannot confirm.

We are considering re-engineering this communication link using Ice one-way proxies, but want to make sure it is worth it. Do you know if Java Object Streams use, in fact, a two-way protocol? Are there any recommendations you would have -- e.g. UDP vs. TCP -- for this problem?

Thanks a bunch for your help.

Brian
__________________
Brian Whitney
Boulder Research and Development
www.robotrade.com
Reply With Quote
  #2 (permalink)  
Old 10-07-2005
mes's Avatar
mes mes is offline
ZeroC Staff
 
Name: Mark Spruiell
Organization: ZeroC, Inc.
Project: Ice Developer
 
Join Date: Feb 2003
Location: California
Posts: 962
Hi Brian,

The ObjectInputStream and ObjectOutputStream classes only perform "marshaling", i.e., they translate Java primitive and object types into a binary format, and vice versa. They can be wrapped around another stream, such as one you might get from a network connection, but they don't perform any networking tasks themselves. You'll need to examine the legacy application in more detail to discover the origin of the underlying stream.

Hope that helps,
- Mark
Reply With Quote
  #3 (permalink)  
Old 10-07-2005
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Good point. the ObjectOutputStream is constructed this way:

ServerSocket serverSocket = new ServerSocket( somePort );
Socket socket = serverSocket.accept();
ObjectOutputStream oos = new ObjectOutputStream( socket.getOutputStream() );

.....
while(...)
oos.writeObject(...)

The ObjectInputStream construction:

Socket socket = RMISocketFactory.getDefaultSocketFactory().createS ocket( InetAddress.getLocalHost().getHostName, port );
...
ObjectInputStream ois = new ObjectInputStream( socket.getInputStream() );
...

while( ... )
ois.readObject();

I suppose we can experiment with setting socket buffer sizes, but wanted your opinion if you thought Ice might be better is this situation for some reason. This connection will always be Java<->Java.

THanks again,

Brian
__________________
Brian Whitney
Boulder Research and Development
www.robotrade.com
Reply With Quote
  #4 (permalink)  
Old 10-07-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,773
Since this is a general Java question, let me suggest that you post this question in some Java support forum.
Reply With Quote
  #5 (permalink)  
Old 10-07-2005
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Marc,

I was only trying to give some background to the basic questions which I stated which is:

Do you think can Ice achieve better performance than this current implementation of Object streams using sockets from Java server and client. Perhaps using one-way proxies. Please read the entire thread.

Your thoughts would be very much appreciated.

Thanks,

Brian
__________________
Brian Whitney
Boulder Research and Development
www.robotrade.com
Reply With Quote
  #6 (permalink)  
Old 10-07-2005
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,773
I'm sorry, but we do not have any performance data for your current implementation, therefore we cannot give any advice. If you would like us to investigate, please contact us at info@zeroc.com for commercial consulting services.
Reply With Quote
  #7 (permalink)  
Old 10-30-2005
rdilipk rdilipk is offline
Registered User
 
Name: Dilip Ranganathan
Organization: 3M
Project: None
 
Join Date: Jul 2003
Location: Minnesota, USA
Posts: 35
I not 100% sure if this is relevant but it appears that java.io.ObjectInputStream and java.io.ObjectOutputStream does appear to have some performance related issues. So much so that the JBoss gang have come up with thier own version of Java serialization (although I **think** it works only with JDK 1.5). This is probably old news, but pls take a look at this:
http://labs.jboss.com/portal/?ctrl:i...=serialization
Reply With Quote
  #8 (permalink)  
Old 10-30-2005
michi's Avatar
michi michi is offline
ZeroC Staff
 
Name: Michi Henning
Organization: ZeroC
Project: Ice
 
Join Date: Feb 2003
Location: Brisbane, Australia
Posts: 891
OutputStream would have to be implemented using introspection. At a hunch, I'd say that it's the introspection that causes the loss of performance, not the socket or the serialization as such. (Ice doesn't use introspection to marshal Slice types in Java.)

Cheers,

Michi.
Reply With Quote
  #9 (permalink)  
Old 10-31-2005
brian brian is offline
Registered User
 
Name: brian whitney
Organization: boulder research and development
Project: MarketBank
 
Join Date: Oct 2003
Posts: 119
Smile

Michi & rdilipk,

Thank you both for you comments/suggestions. This is the kind of information I was seeking in the first place.

Brian
__________________
Brian Whitney
Boulder Research and Development
www.robotrade.com
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I use Ice to process stream hyz1840 Help Center 3 05-25-2006 07:19 AM
Stream helper functions and C++ templates copton Help Center 7 01-20-2006 02:37 PM
Redirecting parts of output stream to other function kovacm Help Center 8 08-08-2005 09:24 AM
problem aboiut stream hierarchy rc_hz Comments 2 05-25-2005 04:15 AM
single stream for two-way communication? vukicevic Help Center 2 05-19-2003 03:17 PM


All times are GMT -4. The time now is 09:43 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.