lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [bug #31948] httpd: Improving HTTP Server performance when


From: Simon Goldschmidt
Subject: [lwip-devel] [bug #31948] httpd: Improving HTTP Server performance when SSI is enabled
Date: Wed, 22 Dec 2010 12:06:16 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13 ( .NET CLR 3.5.30729)

URL:
  <http://savannah.nongnu.org/bugs/?31948>

                 Summary: httpd: Improving HTTP Server performance when SSI
is enabled
                 Project: lwIP - A Lightweight TCP/IP stack
            Submitted by: goldsimon
            Submitted on: Mi 22 Dez 2010 12:06:16 GMT
                Category: Contrib
                Severity: 2 - Minor
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
         Planned Release: 
            lwIP version: CVS Head

    _______________________________________________________

Details:

Reported on Sat, 27 Nov 2010 on lwip-users:

Dear All,

   I am using the code from CVS HEAD (lwip + contrib).  lwIP is setup
for RAW mode.  Raw HTTP server with SSI+CGI is used.

   I have a HTML file with 20 SSI tags which takes 50ms to send
(LWIP_HTTPD_TIMING and HTTPD_DEBUG_TIMING enabled).  Found out that
once a tag is sent, the number of bytes sent to function 'http_write'
is set to the tag data length.  Found a @todo in function
'http_send_data' indicating 'somewhere in this loop, 'len' should grow
again..'

   In the function 'http_send_data', in switch case TAG_LEADOUT and
TAG_SENDING there is a check for 'len' as shown below:
if(len > hs->tag_end - hs->file) {
  len = (u16_t)(hs->tag_end - hs->file);
}
    'len' is passed to function 'http_write' that in turn passes it to
function 'tcp_write'.  Since these functions take care of how much can
be sent, 'len' should be set to the parsed length.  Thus in the above
code snippet the conditional check should be removed and length should
be set as len = (u16_t)(hs->tag_end - hs->file);

    Testing with the above change reduced the send time to 10ms.

    Hope this is useful for those using large number of SSI tags.

Regards,
Jayanth





    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/




reply via email to

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