Paolo Ponzano

Hello to everybody,
I'm new to .NET remoting and I'm trying to figure out the best of if (this is the first project that has been assigned to me to implement alone and I wish to make a good impression to my superiors)... I've a Windows Service that launches a thread and register a CAO object with this piece of code :

Code Block
TcpServerChannel srvChannel = new TcpServerChannel("serverPort", 5000);
IChannel ic = srvChannel;

ChannelServices.RegisterChannel(ic, false);

RemotingConfiguration.ApplicationName = "DBHelper";
RemotingConfiguration.RegisterActivatedServiceType(typeof(DBHelper));


On the other side, I've an architecture defined as

Presentation Layer
Businness Layer
Proxy Layer

in the proxyDataAccess.cs I register the remote type as :

Code Block
ActivatedClientTypeEntry i = RemotingConfiguration.IsRemotelyActivatedClientType(typeof (DBHelper));
if (i == null)
{
RemotingConfiguration.RegisterActivatedClientType(typeof(DBHelper),
"tcp://localhost:5000/DBHelper");

}
myDBHelper = new DBHelper(idCup, idSeason, idMatchCode);

and during the Application life I use it to access to database object with that loop

while (_stillreceivingdata)
{
_idCurrentlyLastFrame = myDataProxyAccessForTracking.GetCurrentlyLastFrameForMatch();

int start = Environment.TickCount;
for (int i = _idCurrentFrame; i < _idCurrentlyLastFrame; i += _numForwardFrame)
{

ProcessSingleFrameBlock(i);

}
int end = Environment.TickCount - start;

Thread.Sleep(100000); //just for test
}


The ProcessSingleFrameBlock is :

private void ProcessSingleFrameBlock(int frameNumber)
{

SqlDataReader d = myDataProxyAccessForTracking.GetEventsFromFrameRange(frameNumber, Math.Min(_numForwardFrame, _idCurrentlyLastFrame - frameNumber + 1));


if (d.HasRows)
{
int start = Environment.TickCount;
_idCurrentFrame = ProcessFrameData(d);
int end = Environment.TickCount - start;
}
else
{
List<FrameData> emptyFrame = FillEmptyFrameDataList(frameNumber);
AddFrameToList(emptyFrame);
}
d.Close();
}


here I've seen that the SqlDataReader is still accessed by trasparentproxy, and in ProcessFrameData i read the data and put them in a List<FrameData>.

My question is, why if I use directly the DBHelper as local object it takes 12-14 secs to execute, while using .NET remoting it takes 17,5-20 mins where do I do wrong

I need to use CAO object since I need a constructor with 3 parameter for DBHelper class, please help me

Thanks in advance,
Paolo Ponzano

-UPDATE 2007/11/04 : As I've seen (and beeing new I wasn't aware of before) is that using the DBHelper that acccess to DB as a remote object, all the loop done in the sdr.Read() are done passing by the trasparent proxy. Is there a way to tell the remote object, give me the sdr (SQLDataReader) as a local copy It tooks 8seconds to process 150 records since it goes up and down the network for each read request.

Should SAO remoting resolve my problem, or have I to change the architecture at all
Thank



Re: .NET Remoting and Runtime Serialization For decent performance and scalability

Sowmy Srinivasan

Have you profiled to see where the bottleneck when using Remoting In general transferring large amount of data across remoting boundaries (or any kind of distributed boundary) is tricky. Neither chatty (frequent gets) nor batch (buffer all records) technique work great. At the risk of stating the obvious your best bet is to somehow filter your records at the source.

SAO and CAO should have comparable performance. Please let me know if you can isolate any specific parts of remoting to be particularly slow and we can work together to see how we can workaround the bottleneck






Re: .NET Remoting and Runtime Serialization For decent performance and scalability

Paolo Ponzano

I'll check and let you know, for now I've abbandoned .net Remoting and I'm using the DbHelper direcly (apps is still in dev fase), I also know that's better to have the record filtered at the source, but this should mean to move a lot of businnes logic to the layer I've defined as DataLayer.

Thanks, I'll let you know




Re: .NET Remoting and Runtime Serialization For decent performance and scalability

msdngroup

Hi,

If you care for performance and scalability, you can't ignore this article:

Performance Comparison between SocketPro and dotNet Remoting as well as Window Communication Framework (WCF)







Re: .NET Remoting and Runtime Serialization For decent performance and scalability

Nathan Evans

I can, and I will ignore it. You cannot compare a basic sockets library to a full-scale middleware like .NET remoting, WCF and Java's RMI.





Re: .NET Remoting and Runtime Serialization For decent performance and scalability

msdngroup


Hi, Nathan Evans:

You don't understand the SocketPro communication framework at all. It supports many features you can't find anywehere else. Here are a few of features you may like: It is supplementary to other communication frameworks like NET remoting and WCF.

Cross-browser supported as shown in the post.

Remote ADO.NET objects, DataReader, DataSet and DataTable. Can you directly remote DataReader across smart device, desktop and different versions of .NET runtimes

Requests Batching like the below "strange code":

BeginBatching();
SendRequest1();
SendRequest2();
SendRequest3();
......
Commit(true);

In case you need to remote your requests with a slow network, does the above feature improve your application performance and scalability

Smart device fully supported

100% asynchronous request handling with synchrony computation support.

Many many features .....