lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] Improving HTTP Server performance when SSI is enabled


From: Jayanth Moodliar
Subject: [lwip-users] Improving HTTP Server performance when SSI is enabled
Date: Sat, 27 Nov 2010 14:20:10 +0530

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 via email to

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