lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #20506] LWIP: TCP Layer Performance


From: Frédéric Bernon
Subject: [lwip-devel] [bug #20506] LWIP: TCP Layer Performance
Date: Wed, 18 Jul 2007 11:02:41 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.8.1.4) Gecko/20070515 Firefox/2.0.0.4

Update of bug #20506 (project lwip):

                Category:                 Contrib => TCP                    
              Item Group:        Faulty Behaviour => Feature Request        
                  Status:               Confirmed => None                   
                 Summary: HTTP server doesn't call tcp_output => LWIP: TCP
Layer Performance 

    _______________________________________________________

Follow-up Comment #6:

If I understand you capture (not it will be better to attach the .cap/.acp
file), the problem is the delay between the first packet of the HTTP reply
and the second :

- First request: packet #19, 0.269278, and the next one : #21 0.389463,
~0.120 between. Between #21,22,24, there is only ~0.003. 

- Same for the second request: packet #31 0.509113, and packet #33 0.689868,
~0.180 between. Between #33,34,36, there us only ~0.004.

I don't have check the code, but do you have disable Nagle algorithm (if you
use socket api layer)? Or is your server is the httpd.c file in
FreeRTOSDemoARM9_STR91X_IARlwiplwipWebServer?


Some remarks about your lwipopts.h. Can you change some values to test ?

#define TCP_SND_BUF 1500 //for you
#define TCP_SND_BUF (4 * TCP_MSS) //to test

If it's not enough, try to reduce TCP_TMR_INTERVAL to 100 (if it was possible
in 1.2.0 release, Im' not sure).

>I really like lwip code but i observed that for a http request the time
taken from the starting of tcp_input function to function of http layer is
150ms which I think can be improved

Your target is very slow !!! :) I feel strange in httpd.c to directly call
tcp_sent AFTER your send_data. More, you could call tcp_output to "boost" the
send. But example, if tcp_write return ERR_OK, you could call :

err = tcp_output_nagle(conn->pcb.tcp);

where tcp_output_nagle is this define:

/**
 * This is the Nagle algorithm: inhibit the sending of new TCP
 * segments when new outgoing data arrives from the user if any
 * previously transmitted data on the connection remains
 * unacknowledged.
 */
#define tcp_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || 
                            ((tpcb)->flags & TF_NODELAY) || 
                            (((tpcb)->unsent != NULL) &&
((tpcb)->unsent->next != NULL))) ? 
                                tcp_output(tpcb) : ERR_OK)

It's from the current CVS HEAD code (I think it can be "easily" use like
this, but not sure at 100%)...






    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?20506>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

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