blobs across omniORB2

Sai-Lai Lo S.Lo@orl.co.uk
Tue, 8 Jul 1997 15:44:13 +0100


>>>>> Fred Stevens writes:

> I'm putting together a test of throughput for passing blobs (on the order
> of 10 MB) through omniorb.  Can anyone give me any suggestions about how to
> do this most efficiently?   Currently I'm using the BOA interface to pass
> sequences of octets.

I would suggest using sequence<octet>, e.g.:

     // IDL
     interface ttcp {
	typedef sequence<octet> blob;
	oneway void dump(in blob data);
     };


> Is there a better way of doing this?  Can I write to
> a lower-level interface and perhaps avoid some of the data copying?

May be you'll be surprised to know that omniORB is quite efficent in
handling very long sequence of octets and of other primitive types. **There
is no copying in the marshalling process.**  In otherwords, the sequences are
directly sent from and received into the sequences' buffers. 


-----------------------------------------------------------------------

With omniORB_2.2.0, you should be able to send blob up to around 256K and
then you will get a marshalling exception.

It is not a bug but a feature. omniORB sets a limit on the GIOP message size
that it sends out and accept. The value can be obtained by calling
omniORB::MaxMessageSize(). The default value is set at 256*1024.

The exact value is somewhat arbitrary and can be overrided by setting
the variable GIOP_Basetypes::max_giop_message_size. For example:

    GIOP_Basetypes::max_giop_message_size = 2048*1024;

The reason such a limit exists is to provide some way to protect the server
side from resource exhaustion. Think about the case when a rogue IIOP
request message contains a sequence length field set to 2^31. I have tested
omniORB against a test client that deliberately sent out randomly corrupted
IIOP messages. Try that on Orbix and it died horribly.

The current situation is not idea as the variable is inside a private
interface and should not really be accessed in the applications.  The
default should be larger. In the next release, I'll add a set value
function omniORB::MaxMssageSize(size_t sz); And a ORB init parameter
-ORBmaxGIOPmessageSize.


Regards,

Sai-Lai Lo

-- 
E-mail:         S.Lo@orl.co.uk          |       Olivetti & Oracle Research Lab
                                        |       24a Trumpington Street
Tel:            +44 223 343000          |       Cambridge CB2 1QA
Fax:            +44 223 313542          |       ENGLAND