lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Performance Tuning?


From: David Ryan
Subject: Re: [lwip-users] Performance Tuning?
Date: Mon, 28 Apr 2003 16:42:51 +1000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.1) Gecko/20020826

My performance checking has been with the latest version of lwip. I've written a small java app and server that simply receives the data via a socket connection. No action is taken on the data, so its basically the equivalent of a net /dev/null. Sending data to the ps2 is the most common use of the stack so this seemed to be a reasonable test. (I also did some round trip testing using an echo server).

I also used ethereal to capture the communications so I could see what was going on. What I found was that the TCP_WND(32Kb) was reducing to zero in about 50ms. It was then taking another 50ms for the data to be removed from the stack before an ACK was being sent with the TCP_WND back at 32Kb.

I am yet to work out why the server thread is not reading the data off the stack (could be related to thread priorties ). I'm assuming if I can fix this problem I should be able to double the performance.

David.

Hi David,

I would really recommend you port your code to the latest version of lwip. It has many bug fixes and performance improvements.

Take a look at the coldfire version of lwipopts.h in the contrib/ports/coldfire area. I tried hard to optimize for some performance. I think lwip is quite sensitive to the pbuf size. You want to make sure that is a decent size (1024 or bigger).

One other thing you want to watch out for is how you output data via TCP. You want to make sure your writes have a relatively large amount of data in them. I wrote a telnet server and was using that as a console for my application. I was getting terrible performance, but I found out that the code was basically calling a putc() routine for every character that wound up in a separate tcp frame. No wonder it was so slow. I implemented a buffering scheme in my pseudo-terminal layer and it improved performance immensely. I have'nt measured real performance quantitatively yet. At some point I have to implement an ftp server and I will probably do it then.

How are you measuring performance?

Regards,
David.


David Ryan wrote:


Hi All..

Another question.. I thought I'd keep it seperate from the last post as its on a rather different subject. Users of our implementation(based on lwip 0.5.3) have been complaining that the performance they get from the stack is around 150kb/sec - 350kb/sec using a 100mbit ethernet adapter. This seems to be way below the theoretical maximum and below the 1.5mb/sec people are getting using ps2linux on the same hardware.

I realise that performance can be effected by many things, however I'd like to know if there is any documentation or experience from people on how best to tune lwipopts.h for better performance when dealing with streaming data. Obviously some values relate to each other. The question is which values relate to each other and how.. and how should they be managed to get the best performance.

Thanks,
David.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]