[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Bandwidth - Your experience?

Stewart Stevens

6/2/2004 11:16:00 PM

I have been trying to use the .NET Remoting framework....with some success!
I have been considering a raw socket implementation but if the Remoting
framework does the job its flexibility, ease of use, and the time saved
devleoping some nice socket code would seem to win the day. Performance is
an issue for me.

Now that I've got it all basically working the bandwidth I am getting is
about 2 mbs. (mega bits per second). This is measured with a single client
connecting to the remote server. Is this in line with your experience?

Today I'm going to profile the code and see where its spending the time and
if there is anything I can do. This bandwidth is a bit touch and go for my
application ... I'd really like to see at least 10mbs. Should I be able to
achieve this?

Here's what I'm doing:

I'm moving managed arrays of DataRange objects accross the remote
interface...I have an Enumeration Class that is derived from MarshalByRef
that fills a provided array with data.

To move 14,892 DataRange objects (each of which is 8 bytes long) takes about
..45 seconds (first couple of transfers take a little longer). So 14892 * 8 *
8 / 0.45 is how I arrive at the 2mbs figure.
typedef float DataValue;

[Serializable] [StructLayout(LayoutKind::Sequential)]public __value class
DataRange
{ ...
DataValue mMinimum;

DataValue mMaximum;

};

public __gc __interface IRangeEnumerator

{...

int Next(unsigned long n, [Out] DataRange items[], long offset);

};

public __gc class RangeEnumerator : public IRangeEnumerator, public
MarshalByRefObject

{ ...



int Next(unsigned long n, DataRange items[], long offset);

.... };

I set up the remote service like this:



BinaryServerFormatterSinkProvider *serverProv = new
BinaryServerFormatterSinkProvider();

BinaryClientFormatterSinkProvider *clientProv = new
BinaryClientFormatterSinkProvider();

IDictionary *props = new Hashtable();

serverProv->TypeFilterLevel = TypeFilterLevel::Full;

props->Add(S"port",__box(9080));

TcpChannel *channel = new TcpChannel(props, clientProv,serverProv);

ChannelServices::RegisterChannel(channel);

RemotingServices::Marshal(mServer, S"Server");


1 Answer

Someone@yahoo.com

6/4/2004 1:10:00 PM

0

Hi, Stewart:
See my inline comments. Wish they are helpful to you!

--
Yuancai (Charlie) Ye

Fast and securely accessing all of remote data sources anywhere with
SocketPro using batch/queue, asynchrony and parallel computation with online
compressing

See 30 well-tested and real OLEDB examples

www.udaparts.com


"Stewart Stevens" <firstnameA@Tadinstruments.co.kiwi> wrote in message
news:1086218178.528757@kyle.snap.net.nz...
> I have been trying to use the .NET Remoting framework....with some
success!
> I have been considering a raw socket implementation but if the Remoting
> framework does the job its flexibility, ease of use, and the time saved
> devleoping some nice socket code would seem to win the day. Performance
is
> an issue for me.

Over all, dotnet remoting is poor in serializing or de-serializing a midlle
or large size of objects. When you need to pass around large objects, you''d
better use socket instead for improving performance with your own mechanism
of serializing or de-serializing objects. See the article at
http://www.udaparts.com/articles/fastsoc...



>
> Now that I''ve got it all basically working the bandwidth I am getting is
> about 2 mbs. (mega bits per second). This is measured with a single client
> connecting to the remote server. Is this in line with your experience?
>
> Today I''m going to profile the code and see where its spending the time
and
> if there is anything I can do. This bandwidth is a bit touch and go for my
> application ... I''d really like to see at least 10mbs. Should I be able to
> achieve this?
>
> Here''s what I''m doing:
>
> I''m moving managed arrays of DataRange objects accross the remote
> interface...I have an Enumeration Class that is derived from MarshalByRef
> that fills a provided array with data.
>
> To move 14,892 DataRange objects (each of which is 8 bytes long) takes
about
> .45 seconds (first couple of transfers take a little longer). So 14892 * 8
*
> 8 / 0.45 is how I arrive at the 2mbs figure.
> typedef float DataValue;

See the article at http://www.udaparts.com/articles/sendo.... It is
entitled as Exchange small, middle and extremely large objects across
boundaries and machines. With my way, your performance can be FOR SURE
improved 10 times! If not, post your message here.

>
> [Serializable] [StructLayout(LayoutKind::Sequential)]public __value class
> DataRange
> { ...
> DataValue mMinimum;
>
> DataValue mMaximum;
>
> };
>
> public __gc __interface IRangeEnumerator
>
> {...
>
> int Next(unsigned long n, [Out] DataRange items[], long offset);
>
> };
>
> public __gc class RangeEnumerator : public IRangeEnumerator, public
> MarshalByRefObject
>
> { ...
>
>
>
> int Next(unsigned long n, DataRange items[], long offset);
>
> ... };
>
> I set up the remote service like this:
>
>
>
> BinaryServerFormatterSinkProvider *serverProv = new
> BinaryServerFormatterSinkProvider();
>
> BinaryClientFormatterSinkProvider *clientProv = new
> BinaryClientFormatterSinkProvider();
>
> IDictionary *props = new Hashtable();
>
> serverProv->TypeFilterLevel = TypeFilterLevel::Full;
>
> props->Add(S"port",__box(9080));
>
> TcpChannel *channel = new TcpChannel(props, clientProv,serverProv);
>
> ChannelServices::RegisterChannel(channel);
>
> RemotingServices::Marshal(mServer, S"Server");
>
>