Tobias Rapp wrote:
> Hello Arno,
> 
>>> By default winsock's send buffer size is 8 kb which is much bigger
>>> than TFtpCli's constant BLOCK_SIZE of 1460 bytes. So one condition
>>> described in the article is not true since a single send call in
>>> TFtpCli does not fill the whole underlying winsock send buffer.
>>> I realy wonder why disabling Nagle doesn't help?
>> 
>> Same applies to WSocket's internal send buffer that has a block size
>> of 1460 as well. So if you haven't increased BufSize of TWSocket
>> a single send call does never fill the whole underlying winsock send
>> buffer.
> 
> That's exactly the thing I'm doing at the moment: I increase the
> BufSize of TWSocket from 1460 bytes to 1MB. The throughput increases
> from 1.2MB/s to more than 7MB/s.

Ahh, I was thinking that you increased winsock's send buffer size.
With a BufSize > winsock send buffer you risc to fullfill the error
conditions described in the article...

I would play with sligtly increased SocketSndBufSize and a BufSize set
to something below like 16/8 and 32/16 kb. TWSocket's property
BufSize actually is the block size and the amount of data copied into
the winsock buffer in a single (winsock) send call. Increasing 
SocketSndBufSize however also decreases the maximum posible sockets
in the system (no problem if you don't need hundreds of sockets at
the same time).     

> 
> As far as I understand Nagle=off only would help me if I would like to
> send small packets (< MCU) at a very high rate. But that is not the
> case: I want to deliver large files (> 3GB).
> 
> When I look at the IP traffic with Wireshark I see something like this
> in the case where TWSocket.BufSize=1460 :
> 
> Client->Server 1448 bytes
> Client->Server 12 bytes
> Server->Client ACK
> Client->Server 1448 bytes
> Client->Server 12 bytes
> Server->Client ACK
> ....
> 
> And in the case where TWSocket.BufSize=1MB :
> 
> Client->Server 1448 bytes
> Client->Server 1448 bytes
> Client->Server 1448 bytes
> // previous line repeated 10-30 times
> Server->Client ACK
> Client->Server 1448 bytes
> Client->Server 1448 bytes
> Client->Server 1448 bytes
> // previous line repeated 10-30 times
> Server->Client ACK
> ....
> 
>>>> So shall I explicitly add a call setsockopt() that increases the
>>>> socket send buffer dramatically (>1MB)?
>>> Use WSocket option SocketSndBufSize instead, it will the call
>>> setsockopt() internally. I think that 1 MB is much too big, since
>>> this memory is allocated from kernel memory which is not an endless
>>> resource.
> 
> SocketSndBufSize property is read-only, at least in my version of
> WSocket.pas (V5.25).
> 
> /Tobias
> 
> 
> --
> NOA Audio Solutions Vertriebsges.m.b.H.    Tel: +43-1-5452700
> Johannagasse 42/4                          Fax: +43-1-545270014
> A - 1050 Wien                              Www: http://www.noa-
> audio.com 
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to