Remoting and scalability question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to increase concurrency as much as possible and have a couple of
questions regarding what's going on under the hood for the following code
segments:

ChannelServices.RegisterChannel(new TcpChannel());

When creating the TcpChannel is this just reserving a port?

Does it ever make sense to create and register multiple TcpChannels? Let's
say you have many client requests running within a ThreadPool trying to
access the channel? Does the transformation of these requests prior to the
actual communication get serialized because all requests are going thru the
same channel or is each requests transformation done asynchronously
underneath the hood? I'm hoping that the answer is the latter.

Also if it does make sense to have multiple channels how do you indicate
this in the actual request; there is no channel parameter that I can see.

Here is a typical request that I perform:

m_topupRequest = (RTS.Remoting.Server.TopUpRequest) Activator.GetObject(
typeof(RTS.Remoting.Server.TopUpRequest),
"tcp://localhost:10500/TopUpRequest");

TopUpResult topupResult = m_topupRequest.Request(rtsCardTypeID,
rtsCardTypeID, phone, currencyType, currencyAmount, dbCode, dealerName,
dealerID,posID, requestIsTest);

Note: localhost is just hard-coded, we will have multiple load-balanced
server machines.

Underneath the hood, does a new socket get created during the
Activator.GetObject call and everything handled asynchronously when the
request is performed?
 
Hi Larry,

You don't need to create multiple channels - the Remoting framework is known
to use the ThreadPool to handle multiple incoming requests. Also, you can
Google for "scalenet.pdf" - it is an excellent free e-book on performance
and scalability issues published by Microsoft Patterns and Practices Team.
 
Dmytro, thank you very much; your response really cleared things up.

So it seems that one channel is good enough for a client application that
connects to say many different Remoting servers, correct? Does this mean
that all clients use the same source port (e.g. at the remoting server, we
would see the same port for the remote client)? Just curious here.

Are there good reference books that go into detail about what is going on
under the hood for remoting and also .Net in general?

Thanks for the reference to scalenet.pdf.
 
I just looked at scalenet.pdf. This is a great resource...no need to answer
my question concerning other books.
 
Larry,
So it seems that one channel is good enough for a client application that
connects to say many different Remoting servers, correct? Does this mean
that all clients use the same source port (e.g. at the remoting server, we
would see the same port for the remote client)? Just curious here.

Here's what MSDN says about the TcpChannel class:

"The TcpChannel opens and caches as many connections as there are threads
making requests to another server at that moment. Socket connections are
closed on the client after 15-20 seconds of inactivity."
 
Back
Top