Home All Groups Group Topic Archive Search About

Remoting and scalability question

Author
8 Feb 2006 8:30 PM
Larry Herbinaux
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?

Author
9 Feb 2006 11:04 AM
Dmytro Lapshyn [MVP]
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.

Show quote
"Larry Herbinaux" <LarryHerbin***@discussions.microsoft.com> wrote in
message news:EC4F2DC0-2D43-4D0B-BBB3-25ED7EDD13AD@microsoft.com...
> 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?
>
Author
9 Feb 2006 6:19 PM
Larry Herbinaux
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.

Show quote
"Dmytro Lapshyn [MVP]" wrote:

> 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.
>
> "Larry Herbinaux" <LarryHerbin***@discussions.microsoft.com> wrote in
> message news:EC4F2DC0-2D43-4D0B-BBB3-25ED7EDD13AD@microsoft.com...
> > 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?
> >
>
>
>
Author
9 Feb 2006 8:15 PM
Larry Herbinaux
I just looked at scalenet.pdf.  This is a great resource...no need to answer
my question concerning other books.

Show quote
"Larry Herbinaux" wrote:

> 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.
>
> "Dmytro Lapshyn [MVP]" wrote:
>
> > 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.
> >
> > "Larry Herbinaux" <LarryHerbin***@discussions.microsoft.com> wrote in
> > message news:EC4F2DC0-2D43-4D0B-BBB3-25ED7EDD13AD@microsoft.com...
> > > 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?
> > >
> >
> >
> >
Author
10 Feb 2006 8:50 AM
Dmytro Lapshyn [MVP]
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."

Show quote
"Larry Herbinaux" <LarryHerbin***@discussions.microsoft.com> wrote in
message news:4FDB1260-23EF-48F5-B4D6-AA0BDDD27331@microsoft.com...
> 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.
>
> "Dmytro Lapshyn [MVP]" wrote:
>
>> 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.
>>
>> "Larry Herbinaux" <LarryHerbin***@discussions.microsoft.com> wrote in
>> message news:EC4F2DC0-2D43-4D0B-BBB3-25ED7EDD13AD@microsoft.com...
>> > 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?
>> >
>>
>>
>>

AddThis Social Bookmark Button