Rejean,
Thank you for this input, that solved the problem. I had not seen your
previous post in the archives but may have not searched on the right topic
(when did you post it). Based on your input I changed TCP_MSS to 1024 and
TCP_SND_BUF to 4*TCP_MSS and it works great. The files transfer very fast
now, practically no delay between the packets. I may have to increase
PCB_POOL_SIZE but I can test that later.
I greatly appreciate the response that everyone contributed to helping me
run this down.
Rick
----- Original Message -----
From: "Rejean Groleau" <[email protected]>
To: <[email protected]>
Sent: Friday, April 24, 2009 12:03 PM
Subject: Re: [lwip-users] httpd slow response
If your HTTP server is only sending every 200ms,
it is probably because your client browser is waiting
for at least 4380 bytes before ACKnowledging
(this value is based on your 1500 bytes MSS).
Since your send buffer is only 3000 bytes long,
you will never send those 4380 byte at once,
hence always waiting for the delayed ACK,
coming only after 200ms.
Like I said in a previous post:
Rejean Groleau wrote:
I had the same problem on my platform (a Luminary Stellaris
microcontroller with 64KB of RAM).
To speed things up (from a typical 200ms to a less-than-10ms delay), I
had
to do the following:
1. Use a TCP_SND_BUF value four times greater than the TCP_MSS (according
to RFC 3390).
2. Always fill completely the TCP_SND_BUF (unless no more data is to be
sent).
3. Set a callback through tcp_poll() to attempt resending data (after an
arbitrary amount of time).
4. In my case (an HTTP server), use the HTTP 1.1 specification (to reuse
connections).
I did this according to RFC 3390 (available at
http://tools.ietf.org/html/rfc3390), which states:
If (MSS <= 1095 bytes)
then win <= 4 * MSS;
If (1095 bytes < MSS < 2190 bytes)
then win <= 4380;
If (2190 bytes <= MSS)
then win <= 2 * MSS;
I interpreted (read between the lines) that when this "upper-bound" limit
is reached, an ACK is sent back.
Note that although my MSS is 1472 bytes, I still had to go under the
first
condition
(4 * MSS instead or 4380 bytes). It seems the web browsers (or windows
XP)
do not exactly follow this scheme.
--
View this message in context:
http://www.nabble.com/httpd-slow-response-tp23204551p23220815.html
Sent from the lwip-users mailing list archive at Nabble.com.
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users