|
From: | David Haas |
Subject: | Re: [lwip-users] TCP tuning |
Date: | Tue, 28 Jan 2003 09:31:39 -0500 |
User-agent: | Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.2b) Gecko/20021107 |
This is my setup, which I think was basically the default. #define TCP_MSS 128 #define TCP_SND_BUF 256 #define TCP_SND_QUEUELEN 4 * TCP_SND_BUF/TCP_MSS #define TCP_WND 1024I measured approximately 33mb/sec using a 66Mhz MCF5272. I have sucessfully run with 3 simultaneous TCP sessions: 2 chargens from a linux client to my target and one telnet session from the linux client to my target. I am using PBUF_POOL buffers almost everywhere.
I did a bit of optimization which I think is important though: In my pseudo-terminal layer for telnet I added output buffering. I was noticing that my application sent out a lot of single characters (puts() was implemented as multiple putc() calls). This was generating lots of extra packets. I found that the output buffering improved this a lot. I use a buffer the same size as the TCP_SND_BUF and flush it when it is full or whenever getc() is called.
Another thing is that you should make sure you have enough input buffer. You need to be able to accept enough data at wire speed to fill a tcp window for each open tcp connection. That's actually a good reason to keep the TCP_WND to a low value.
If you want to figure out what is slow things down, just monitor your ethernet with something like ethereal and look for retransmissions.
David. Ed Sutter wrote:
Hi, In my current system I have (among other things) a telnet server and an http server. I'm finding that if I tune (lwipopts.h) things to work well for HTTP, then telnet is slow and choppy; however if I tune things for telnet, then HTTP is very slow. I'm certainly no TCP/IP wizard, but I'm guessing that it has something to do with TCP_WND, TCP_MSS and TCP_SND_BUF. Does anyone have any suggestions regarding how to tune the stack properly? I'm more concerned about improving user-response than I am RAM usage. Any thoughts? Ed _______________________________________________ lwip-users mailing list address@hidden http://mail.nongnu.org/mailman/listinfo/lwip-users
[Prev in Thread] | Current Thread | [Next in Thread] |