cURL / Mailing Lists / curl-users / Single Mail

curl-users

slow http transfer (winxp)

From: <mailing_at_kamikaze.eu.org>
Date: Fri, 19 May 2006 10:59:47 +0200 (CEST)

Below is a trace of a curl http transfer between 2 PCs (WinXP) under the
same sub-net mask (connected by a hub). No routers were involved. The
Curl problem is this:

- Curl processes data 0x4000 bytes at a time (16,384).
- The TCP window does not seem to be opening up- max seemed to be 2 or 3
packets (4380 bytes)
- Curl stops sending data until an ACK is received for the last byte of
the 0x4000 bytes processed.
- When the destination (IP address 135.5.239.214) doesn't wait for 2 TCP
packets to ACK, and gets out of step, then the last packet of the 0x4000
(12th packet) incurs a 200 ms Delayed ACK penalty.
- This reduces throughput on a 100Mbps HDX circuit to < 1 Mbps. This is
the problem.

Below is a trace showing this. Starting with packet 14984 (the first
packet of the next 0x4000 bytes processed by Curl) we see good transfer
until packet 15003, which is the ACK that triggered the 200 ms delay
timer. This is a delta timestamp trace. Note that the 1500-byte packets
are taking around 130 us, which is correct for a 100Mbps HDX circuit. The
200 ms extra every 12 packets is what is causing the throughput problem.

- Conclusion- Curl is not using TCP correctly.

14979) +00:00:00.000130 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
14980) +00:00:00.000039 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
14981) +00:00:00.000010 If0: 016C IP: 135.5.239.10 -> 135.5.239.214 TCP:
14982) +00:00:00.000014 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
14983) +00:00:00.215391 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
***************** Delayed Ack Timer Fired******************
14984) +00:00:00.000295 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 023889E8
14985) +00:00:00.000129 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 02388F9C
14986) +00:00:00.000130 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 02389550
14987) +00:00:00.000039 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 02389550 (packet 14985)
14988) +00:00:00.000099 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 02389B04
14989) +00:00:00.000053 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 02389B04 (packet 14986)
14990) +00:00:00.000083 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238A0B8
14991) +00:00:00.000129 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238A66C
14992) +00:00:00.000045 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 02389A66C (packet 14990)
14993) +00:00:00.000094 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238AC20
14994) +00:00:00.000043 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 0238AC20 (packet 14991)
14995) +00:00:00.000094 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238B1D4
14996) +00:00:00.000131 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238B788
14997) +00:00:00.000040 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 0238B788 (packet 14995)
14998) +00:00:00.000096 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238BD3C
14999) +00:00:00.000041 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 0238BD3C (packet 14996)
15000) +00:00:00.000098 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238C2F0
15001) +00:00:00.000045 If0: 016C IP: 135.5.239.10 -> 135.5.239.214 TCP:
TCP sequence no 0238C8A4
15002) +00:00:00.000015 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 0238C8A4 (packet 15000)
15003) +00:00:00.217050 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
ACK for 0238C9E8 (packet 15001)
***************** Delayed Ack Timer Fired******************
15004) +00:00:00.000333 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
15005) +00:00:00.000129 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
15006) +00:00:00.000130 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:
15007) +00:00:00.000040 If0: 002E IP: 135.5.239.214 -> 135.5.239.10 TCP:
15008) +00:00:00.000102 If0: 05DC IP: 135.5.239.10 -> 135.5.239.214 TCP:

I found out that applying following registry settings on server XP machine
solved problem, however this is not solution that I can accept (just a
workaround):

For XP and W2003 go to
HKEY_LOCAL_MACHINE->SYSTEM->CurrentControlSet->Services->Tcpip->Parameters->Interfaces->{several
interfaces}. Look for your IP in {several interfaces} and for the one
that matches add the DWORD TcpAckFrequency value 1. The default is 2
(allow 1 ACK for 2 payload packets). By changing it to 1 forces a ACK per
packet. A value of 0 will revert to 2.

Is there any command line setting that I can apply to curl, or any other
seeting that can help to speed up http transfer to XP machine?
Received on 2006-05-19