Re: TcpClient buffer size limit?
- From: "Willy Denoyette [MVP]" <willy.denoyette@xxxxxxxxxx>
- Date: Tue, 5 Apr 2005 19:52:33 +0200
"Sharon" <Sharon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:991375CB-A242-43E3-8749-65D0B23181AC@xxxxxxxxxxxxxxxx
> Hi Willy,
>
> Ok' I'll try to make my case clearer:
> I'm developing an application that uses a Frame Grabber that produce 100
> mega byte frames.
> The application need to distribute these frames to several computers,
> frame1
> to pc1, frame2 to pc2, frame3 to pc3 and so on.
> The frames are generated in very high speed, therefore the frames
> transmission must also be very fast.
> So I'm looking for the optimum TCP connection and configuration to achieve
> the fastest speed.
> We are also using (in the near future) GLAN, dual Xeon PC's with Windows
> XP.
>
> From the tests I did, I found that a bigger TCP buffer making the
> transmission faster (of course there is a limit for that).
>
> Yes, I'm using simple synchronous socket IO and not an asynchronous. Why
> should I prefer the the asynchronous transmission? Will it make the frames
> transmission faster?
>
You should use an asynchronous pattern if you need to prepare some further
data while the actual data is being transmitted, or you when you have to
process the received data while receiving the next buffer.
That doesn't mean one is faster than the other, it's just a matter for
finding the perfect balance between CPU occupation, network throughput
without wasting precious resources like user/kernel memory.
> I'm not sure I understand what you mean when you say "using the default
> per
> interface type TCP registry settings and an application buffer size of 64K
> you can easily saturate a single Gigabit network interface."
> Can you please elaborate on that?
>
Yes, the TCP stack in XP and higher is self tuned, that means that a number
of parameters are adjusted automatically depending on the interface type and
characteristics and available RAM memory.
For instance a Gigabit interface will have a default TcpWindowSize of 64K at
the winsock API level, while a 10-100MBit interface has a window size of
17Kb (note that this is a maximum, windows will adapt this value depending
on how routers are configured, or to the receiving side's TcpWindowSize if
it's smaller).
Now without adapting the defaults (by adding the parameters to the
registry), you can saturate a Gigabit LAN interface when transferring large
chunks of data between two TCP/IP endpoints. For instance I achieved a
transfer rate of ~112MBytes/sec. (95% of the aggregate bandwidth) between
two PC's running XP connected through a GB switch.
Willy.
.
- Follow-Ups:
- Re: TcpClient buffer size limit?
- From: Sharon
- Re: TcpClient buffer size limit?
- References:
- Re: TcpClient buffer size limit?
- From: Willy Denoyette [MVP]
- Re: TcpClient buffer size limit?
- From: Ignacio Machin \( .NET/ C# MVP \)
- Re: TcpClient buffer size limit?
- From: Willy Denoyette [MVP]
- Re: TcpClient buffer size limit?
- From: Sharon
- Re: TcpClient buffer size limit?
- From: Willy Denoyette [MVP]
- Re: TcpClient buffer size limit?
- From: Sharon
- Re: TcpClient buffer size limit?
- Prev by Date: Re: WebService and the ArrayList
- Next by Date: Re: (decimal) 1.1 versus 1.1M
- Previous by thread: Re: TcpClient buffer size limit?
- Next by thread: Re: TcpClient buffer size limit?
- Index(es):
Relevant Pages
|