PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > Re: For performance, one socket or two with dedicated send/receive?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

Re: For performance, one socket or two with dedicated send/receive?

Réponse
 
LinkBack Outils de la discussion
Vieux 03/03/2006, 01h22   #1 (permalink)
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

In article <1141336756.033668.74080@t39g2000cwt.googlegroups. com>,
"Druid" <mattdruid@gmail.com> wrote:

> A TCP connection can send and receive over the same connection, but
> is there a benifit to creating two TCP connections? I was thinking of
> using one specifically for sending, and one specifically for receiving.
> In what cases, if any, would you want to use two? This might be a
> newbie question, but I've been unable to find an answer about it yet.


I don't think there would be a significant benefit. If you use one
connection, ACKs can be piggy-backed on data segments, so you may get
slightly better performance this way.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Vieux 03/03/2006, 14h57   #2 (permalink)
googlegroups@marget.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

Barry Margolin wrote:
> "Druid" <mattdruid@gmail.com> wrote:
>
> > is there a benifit to creating two TCP connections? I was thinking of
> > using one specifically for sending, and one specifically for receiving.
> > In what cases, if any, would you want to use two?


> I don't think there would be a significant benefit. If you use one
> connection, ACKs can be piggy-backed on data segments, so you may get
> slightly better performance this way.


In the case of bidirectional data flow, Barry is correct (no surprise
there) that if anything, using a single channel might provide better
performace.

....With one gotcha: Certain buggy TCPs have a problem digging
themselves out of congestion control. When cwin is throttling
transmission, an incoming ACK with a payload (LEN > 0) is misfiled as a
DUPACK.

If your application is heavily bidirectional, and the connection
suffers some packet loss, the throughput will never recover because of
this bug.

Most applications are not heavily bidirectional, so that problem is not
widely observed.

There's another reason an application might want to use two sockets,
but not for bidirectional traffic: Unidirectional data flow over a
lossy network will probably be faster with several parallel sockets
than with one big one.

Non-high performing TCPs are too considerate and won't allow a single
socket connection to push the network hard enough. Parallel
connections will find the absolute limit (ever have to coexist with
edonkey?)

/chris marget

  Réponse avec citation
Vieux 06/03/2006, 15h12   #3 (permalink)
Druid
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

Well, the application isn't heavy bidirectional, it will be really
heavy in one direction, and light in the other. I want to guarantee
that the light direction doesn't suffer from any starvation if the
other direction is under heavy load.

I'm not concerned about the ACKs, I'm not sure if I should be.

So, would having two dedicated TCP connections (4 ports total - 2
endpoints on each side) in my application, 1 for sending, 1 for
receiving, would improve performance and mitigate starvation given this
context? From what you've said so far, it doesn't sound like it.

  Réponse avec citation
Vieux 06/03/2006, 23h27   #4 (permalink)
Rick Jones
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

I'd just go ahead and use one socket/connection. Be certain to
provide all "logically associated" data to the transport in one call
(writev, sendmsg etc).

rick jones
--
a wide gulf separates "what if" from "if only"
these opinions are mine, all mine; HP might not want them anyway...
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
  Réponse avec citation
Vieux 07/03/2006, 00h49   #5 (permalink)
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

In article <1141657940.031014.318260@u72g2000cwu.googlegroups .com>,
"Druid" <mattdruid@gmail.com> wrote:

> Well, the application isn't heavy bidirectional, it will be really
> heavy in one direction, and light in the other. I want to guarantee
> that the light direction doesn't suffer from any starvation if the
> other direction is under heavy load.


It shouldn't be a problem. The two directions are effectively
independent. Implementations don't usually share any per-connection
resources between the two directions, so there's nothing to starve
(there may be some system-wide resources that are shared, but then the
starvation would affect separate connections just as much as a single
connection).

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Vieux 07/03/2006, 03h11   #6 (permalink)
Vernon Schryver
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

In article <barmar-23B8CD.19491306032006@comcast.dca.giganews.com>,
Barry Margolin <barmar@alum.mit.edu> wrote:

>> Well, the application isn't heavy bidirectional, it will be really
>> heavy in one direction, and light in the other. I want to guarantee
>> that the light direction doesn't suffer from any starvation if the
>> other direction is under heavy load.

>
>It shouldn't be a problem. The two directions are effectively
>independent. Implementations don't usually share any per-connection
>resources between the two directions, so there's nothing to starve
>(there may be some system-wide resources that are shared, but then the
>starvation would affect separate connections just as much as a single
>connection).


Starvation can happen in the application as well as the operating system
or network machinery. For example, an application I care about involves
systems doing what might be described as flooding database changes to
peers and expecting peers to respond with grouped "commits." Things are
symmetric. Each system would rather not have incoming commits mixed
with and so delayed by the far larger database changes in a single TCP
pipe. The commits from a peer are relatively rare, and far quicker and
easier to handle that database changes. For various reasons incoming
commits should have higher priority than incoming database change
requests. My solution is two TCP connections between each pair of
peers. Each system handles incoming database changes only after it
has attended to incoming commits.

Of course, if you need to ask in a newsgroup to hear what's been said
in this thread, the right answer is almost certainly "one socket."


Vernon Schryver vjs@rhyolite.com
  Réponse avec citation
Vieux 07/03/2006, 20h52   #7 (permalink)
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

In article <duitka$30bu$1@calcite.rhyolite.com>,
vjs@calcite.rhyolite.com (Vernon Schryver) wrote:

> In article <barmar-23B8CD.19491306032006@comcast.dca.giganews.com>,
> Barry Margolin <barmar@alum.mit.edu> wrote:
>
> >> Well, the application isn't heavy bidirectional, it will be really
> >> heavy in one direction, and light in the other. I want to guarantee
> >> that the light direction doesn't suffer from any starvation if the
> >> other direction is under heavy load.

> >
> >It shouldn't be a problem. The two directions are effectively
> >independent. Implementations don't usually share any per-connection
> >resources between the two directions, so there's nothing to starve
> >(there may be some system-wide resources that are shared, but then the
> >starvation would affect separate connections just as much as a single
> >connection).

>
> Starvation can happen in the application as well as the operating system
> or network machinery. For example, an application I care about involves
> systems doing what might be described as flooding database changes to
> peers and expecting peers to respond with grouped "commits." Things are
> symmetric. Each system would rather not have incoming commits mixed
> with and so delayed by the far larger database changes in a single TCP
> pipe. The commits from a peer are relatively rare, and far quicker and
> easier to handle that database changes. For various reasons incoming
> commits should have higher priority than incoming database change
> requests. My solution is two TCP connections between each pair of
> peers. Each system handles incoming database changes only after it
> has attended to incoming commits.


This sounds like a very different issue -- you're talking about two
connections for the *same* direction, or for different types of
communication (e.g. FTP's Control and Data connections). The OP was
specifically asking about whether to use separate connections for the
opposite directions.

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
  Réponse avec citation
Vieux 10/03/2006, 06h51   #8 (permalink)
DMFH
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: For performance, one socket or two with dedicated send/receive?

On 2006-03-07, Barry Margolin <barmar@alum.mit.edu> wrote:

> This sounds like a very different issue -- you're talking about two
> connections for the *same* direction, or for different types of
> communication (e.g. FTP's Control and Data connections). The OP was
> specifically asking about whether to use separate connections for the
> opposite directions.


Thinking back in this thread to using a single TCP socket instead of
multiple ones for performance, this thread reminds me of the URG
flag in TCP, and how (from my own experience) this was never quite used
or implemented in a useful way and how it might have ed out moving
control elements of a communication faster than content.

Does anyone remember / recall / have an opinion on what happened to
the use of the URG bit?

/dmfh

----
__| |_ __ / _| |_ ____ __
dmfh @ / _` | ' \| _| ' \ _ / _\ \ /
\__,_|_|_|_|_| |_||_| (_) \__/_\_\
----
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h00.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,13958 seconds with 16 queries